pub struct ChatGenerationChunk {
pub text: String,
pub message: BaseMessage,
pub generation_info: Option<HashMap<String, Value>>,
pub generation_type: String,
}Expand description
ChatGeneration chunk.
ChatGeneration chunks can be concatenated with other ChatGeneration chunks.
Fields§
§text: StringThe text contents of the output message.
message: BaseMessageThe message chunk output by the chat model.
generation_info: Option<HashMap<String, Value>>Raw response from the provider.
generation_type: StringType is used exclusively for serialization purposes.
Implementations§
Source§impl ChatGenerationChunk
impl ChatGenerationChunk
Sourcepub fn new(message: BaseMessage) -> Self
pub fn new(message: BaseMessage) -> Self
Create a new ChatGenerationChunk from a message.
Trait Implementations§
Source§impl Add for ChatGenerationChunk
impl Add for ChatGenerationChunk
Source§fn add(self, other: ChatGenerationChunk) -> Self::Output
fn add(self, other: ChatGenerationChunk) -> Self::Output
Concatenate two ChatGenerationChunks.
Returns a new ChatGenerationChunk concatenated from self and other.
Source§type Output = ChatGenerationChunk
type Output = ChatGenerationChunk
The resulting type after applying the
+ operator.Source§impl Clone for ChatGenerationChunk
impl Clone for ChatGenerationChunk
Source§fn clone(&self) -> ChatGenerationChunk
fn clone(&self) -> ChatGenerationChunk
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 Debug for ChatGenerationChunk
impl Debug for ChatGenerationChunk
Source§impl<'de> Deserialize<'de> for ChatGenerationChunk
impl<'de> Deserialize<'de> for ChatGenerationChunk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ChatGeneration> for ChatGenerationChunk
impl From<ChatGeneration> for ChatGenerationChunk
Source§fn from(chat_gen: ChatGeneration) -> Self
fn from(chat_gen: ChatGeneration) -> Self
Converts to this type from the input type.
Source§impl From<ChatGenerationChunk> for ChatGeneration
impl From<ChatGenerationChunk> for ChatGeneration
Source§fn from(chunk: ChatGenerationChunk) -> Self
fn from(chunk: ChatGenerationChunk) -> Self
Converts to this type from the input type.
Source§impl From<ChatGenerationChunk> for GenerationType
impl From<ChatGenerationChunk> for GenerationType
Source§fn from(generation: ChatGenerationChunk) -> Self
fn from(generation: ChatGenerationChunk) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ChatGenerationChunk
impl PartialEq for ChatGenerationChunk
Source§impl Serialize for ChatGenerationChunk
impl Serialize for ChatGenerationChunk
impl StructuralPartialEq for ChatGenerationChunk
Auto Trait Implementations§
impl Freeze for ChatGenerationChunk
impl RefUnwindSafe for ChatGenerationChunk
impl Send for ChatGenerationChunk
impl Sync for ChatGenerationChunk
impl Unpin for ChatGenerationChunk
impl UnwindSafe for ChatGenerationChunk
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