Struct llm_api_adapter::models::ChatResponse
source · pub struct ChatResponse<'a> { /* private fields */ }
Expand description
Represents the response from a chat session.
The lifetime parameter 'a
indicates that the ChatResponse
borrows data from a ChatSession
instance and can only live as long as the ChatSession
instance.
Implementations§
source§impl<'a> ChatResponse<'a>
impl<'a> ChatResponse<'a>
sourcepub fn last_response(&self) -> &str
pub fn last_response(&self) -> &str
Returns the last response from the chat session.
sourcepub fn dialog(&self) -> &[Message]
pub fn dialog(&self) -> &[Message]
Returns the entire conversation history of the chat session.
sourcepub async fn add(
self,
message: &str
) -> Result<ChatResponse<'a>, AnthropicError>
pub async fn add( self, message: &str ) -> Result<ChatResponse<'a>, AnthropicError>
Auto Trait Implementations§
impl<'a> Freeze for ChatResponse<'a>
impl<'a> !RefUnwindSafe for ChatResponse<'a>
impl<'a> Send for ChatResponse<'a>
impl<'a> Sync for ChatResponse<'a>
impl<'a> Unpin for ChatResponse<'a>
impl<'a> !UnwindSafe for ChatResponse<'a>
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