A container for a streamed message delta and its termination signal.
During streaming, delta carries the incremental payload; once a terminal condition is reached, finish_reason may be populated to explain why.
delta
finish_reason
let mut out = MessageOutput::new();out.delta = MessageDelta::new().with_role(Role::Assistant).with_contents([PartDelta::Text { text: "Hi".into() }]);assert!(out.finish_reason.is_none()); Copy
let mut out = MessageOutput::new();out.delta = MessageDelta::new().with_role(Role::Assistant).with_contents([PartDelta::Text { text: "Hi".into() }]);assert!(out.finish_reason.is_none());
None
finish()
Message
Optional
A container for a streamed message delta and its termination signal.
During streaming,
deltacarries the incremental payload; once a terminal condition is reached,finish_reasonmay be populated to explain why.Examples
Lifecycle
finish_reasonis typicallyNone.finish_reasonis set; callers can thenfinish()the delta to obtain a concrete [Message].