pub enum StreamedAssistantContent<R> {
Text(Text),
ToolCall(ToolCall),
ToolCallDelta {
id: String,
delta: String,
},
Reasoning(Reasoning),
ReasoningDelta {
id: Option<String>,
reasoning: String,
},
Final(R),
}Expand description
Describes responses from a streamed provider response which is either text, a tool call or a final usage response.
Variants§
Implementations§
Source§impl<R> StreamedAssistantContent<R>
impl<R> StreamedAssistantContent<R>
pub fn text(text: &str) -> StreamedAssistantContent<R>
pub fn final_response(res: R) -> StreamedAssistantContent<R>
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>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<R> Debug for StreamedAssistantContent<R>where
R: Debug,
impl<R> Debug for StreamedAssistantContent<R>where
R: Debug,
Source§impl<'de, R> Deserialize<'de> for StreamedAssistantContent<R>where
R: Deserialize<'de>,
impl<'de, R> Deserialize<'de> for StreamedAssistantContent<R>where
R: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamedAssistantContent<R>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<StreamedAssistantContent<R>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<R> PartialEq for StreamedAssistantContent<R>where
R: PartialEq,
impl<R> PartialEq for StreamedAssistantContent<R>where
R: PartialEq,
Source§impl<R> Serialize for StreamedAssistantContent<R>where
R: Serialize,
impl<R> Serialize for StreamedAssistantContent<R>where
R: Serialize,
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<R> StructuralPartialEq for StreamedAssistantContent<R>
Auto Trait Implementations§
impl<R> Freeze for StreamedAssistantContent<R>where
R: Freeze,
impl<R> RefUnwindSafe for StreamedAssistantContent<R>where
R: RefUnwindSafe,
impl<R> Send for StreamedAssistantContent<R>where
R: Send,
impl<R> Sync for StreamedAssistantContent<R>where
R: Sync,
impl<R> Unpin for StreamedAssistantContent<R>where
R: Unpin,
impl<R> UnwindSafe for StreamedAssistantContent<R>where
R: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)