pub enum StreamedAssistantContent<R> {
Text(Text),
ToolCall {
tool_call: ToolCall,
internal_call_id: String,
},
ToolCallDelta {
id: String,
internal_call_id: String,
content: ToolCallDeltaContent,
},
Reasoning(Reasoning),
ReasoningDelta {
id: Option<String>,
reasoning: String,
},
Final(R),
Unknown(Value),
}Expand description
Describes responses from a streamed provider response which is either text, a tool call or a final usage response.
Variants§
Text(Text)
Text delta emitted by the assistant.
ToolCall
Complete tool call emitted by the assistant.
Fields
ToolCallDelta
Partial tool call data emitted by the assistant.
Fields
content: ToolCallDeltaContentReasoning(Reasoning)
Complete reasoning block emitted by the assistant.
ReasoningDelta
Partial reasoning text emitted by the assistant.
Fields
Final(R)
Final provider response object, if yielded by the provider stream.
Unknown(Value)
A provider-native output item rig does not model, preserved verbatim —
e.g. an OpenAI Responses hosted-tool result (web_search_call,
file_search_call, computer_call, code_interpreter_call). It is
yielded to the consumer for inspection/forwarding but is not added to the
accumulated assistant message or persisted history. Kept last because the
enum is #[serde(untagged)] and a raw Value
matches anything, so earlier (typed) variants must be tried first.
Implementations§
Source§impl<R> StreamedAssistantContent<R>
impl<R> StreamedAssistantContent<R>
Sourcepub fn text(text: &str) -> StreamedAssistantContent<R>
pub fn text(text: &str) -> StreamedAssistantContent<R>
Create a text stream item.
Sourcepub fn final_response(res: R) -> StreamedAssistantContent<R>
pub fn final_response(res: R) -> StreamedAssistantContent<R>
Create a final response stream item.
Trait Implementations§
Source§impl<R> Clone for StreamedAssistantContent<R>where
R: Clone,
impl<R> Clone for StreamedAssistantContent<R>where
R: Clone,
Source§fn clone(&self) -> StreamedAssistantContent<R>
fn clone(&self) -> StreamedAssistantContent<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more