pub enum StreamedAssistantContent<R> {
Text(Text),
ToolCall(ToolCall),
Reasoning(Reasoning),
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>
Sourcepub fn tool_call(
id: impl Into<String>,
name: impl Into<String>,
arguments: Value,
) -> StreamedAssistantContent<R>
pub fn tool_call( id: impl Into<String>, name: impl Into<String>, arguments: Value, ) -> StreamedAssistantContent<R>
Helper constructor to make creating assistant tool call content easier.
pub fn tool_call_with_call_id( id: impl Into<String>, call_id: String, name: impl Into<String>, arguments: Value, ) -> 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 · Source§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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more