pub struct Conversation { /* private fields */ }Expand description
The messages of one conversation.
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub fn say(&mut self, text: &str)
pub fn say(&mut self, text: &str)
Adds what the person wrote. Right after another user message (a reply that was stopped before it said anything) the text joins that message, since the API wants the roles to take turns.
Sourcepub fn reply(&mut self, content: Vec<Value>)
pub fn reply(&mut self, content: Vec<Value>)
Adds the model’s reply. Nothing is added for a reply with no content.
Sourcepub fn results(&mut self, results: Vec<Value>)
pub fn results(&mut self, results: Vec<Value>)
Adds the results of tool calls, each a tool_result block.
Sourcepub fn open_calls(&self) -> Vec<Call>
pub fn open_calls(&self) -> Vec<Call>
The tool calls of the last message that have no result yet, in the order they were made.
Trait Implementations§
Source§impl Clone for Conversation
impl Clone for Conversation
Source§impl Debug for Conversation
impl Debug for Conversation
Source§impl Default for Conversation
impl Default for Conversation
Source§impl PartialEq for Conversation
impl PartialEq for Conversation
impl StructuralPartialEq for Conversation
Auto Trait Implementations§
impl Freeze for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl UnwindSafe for Conversation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more