pub struct ChatResponseUpdate {
pub contents: Vec<Content>,
pub role: Option<Role>,
pub author_name: Option<String>,
pub response_id: Option<String>,
pub message_id: Option<String>,
pub conversation_id: Option<String>,
pub model: Option<String>,
pub created_at: Option<String>,
pub finish_reason: Option<FinishReason>,
pub additional_properties: HashMap<String, Value>,
pub raw_representation: Option<Value>,
}Expand description
A single streaming chunk from a chat client.
Fields§
§contents: Vec<Content>§role: Option<Role>§response_id: Option<String>§message_id: Option<String>§conversation_id: Option<String>§model: Option<String>§created_at: Option<String>§finish_reason: Option<FinishReason>§additional_properties: HashMap<String, Value>Provider-specific metadata for this update. Merged onto
ChatResponse::additional_properties during aggregation.
raw_representation: Option<Value>The raw provider payload this update was decoded from, if retained.
Implementations§
Source§impl ChatResponseUpdate
impl ChatResponseUpdate
Sourcepub fn text(text: impl Into<String>) -> ChatResponseUpdate
pub fn text(text: impl Into<String>) -> ChatResponseUpdate
A text-only update from the assistant.
Sourcepub fn text_content(&self) -> String
pub fn text_content(&self) -> String
The concatenated text of this update.
Trait Implementations§
Source§impl Clone for ChatResponseUpdate
impl Clone for ChatResponseUpdate
Source§fn clone(&self) -> ChatResponseUpdate
fn clone(&self) -> ChatResponseUpdate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatResponseUpdate
impl Debug for ChatResponseUpdate
Source§impl Default for ChatResponseUpdate
impl Default for ChatResponseUpdate
Source§fn default() -> ChatResponseUpdate
fn default() -> ChatResponseUpdate
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ChatResponseUpdate
impl<'de> Deserialize<'de> for ChatResponseUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChatResponseUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChatResponseUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ChatResponseUpdate
impl Serialize for ChatResponseUpdate
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
Auto Trait Implementations§
impl Freeze for ChatResponseUpdate
impl RefUnwindSafe for ChatResponseUpdate
impl Send for ChatResponseUpdate
impl Sync for ChatResponseUpdate
impl Unpin for ChatResponseUpdate
impl UnsafeUnpin for ChatResponseUpdate
impl UnwindSafe for ChatResponseUpdate
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