pub struct Event { /* private fields */ }Expand description
A single event in a conversation thread.
An event represents a single message or interaction in a conversation, with an associated role indicating who/what generated the content.
Use the constructor methods (Event::system, Event::user, Event::assistant)
to create events, and the accessor methods (role, content)
to read the fields.
Implementations§
Source§impl Event
impl Event
Sourcepub fn into_content(self) -> Content
pub fn into_content(self) -> Content
Consumes the event and returns the content.
Sourcepub fn into_parts(self) -> (Role, Content)
pub fn into_parts(self) -> (Role, Content)
Consumes the event and returns both role and content.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
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<ToolResponse> for Event
impl From<ToolResponse> for Event
Source§fn from(value: ToolResponse) -> Self
fn from(value: ToolResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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