pub struct Chat<CP, Output = Unstructured> { /* private fields */ }Implementations§
Source§impl<CP: CompletionProvider> Chat<CP, Unstructured>
impl<CP: CompletionProvider> Chat<CP, Unstructured>
Sourcepub async fn complete(
&mut self,
messages: &mut Messages,
) -> Result<ChatOutcome<ChatResponse>, ChatFailure>
pub async fn complete( &mut self, messages: &mut Messages, ) -> Result<ChatOutcome<ChatResponse>, ChatFailure>
Run the chat loop until the model completes, max_steps is reached,
or a tool call strategy pauses execution (pending approval,
scheduled, etc). Callers handle ChatOutcome::Paused by mutating
pending tool statuses and invoking Chat::resume.
Sourcepub async fn resume(
&mut self,
messages: &mut Messages,
) -> Result<ChatOutcome<ChatResponse>, ChatFailure>
pub async fn resume( &mut self, messages: &mut Messages, ) -> Result<ChatOutcome<ChatResponse>, ChatFailure>
Resume a loop that previously returned ChatOutcome::Paused. The
caller is expected to have resolved at least one pending tool
(typically by calling tool.approve(...) or tool.reject(...)
on each) before calling resume.
Source§impl<CP: CompletionProvider, T> Chat<CP, Structured<T>>where
T: DeserializeOwned + JsonSchema,
impl<CP: CompletionProvider, T> Chat<CP, Structured<T>>where
T: DeserializeOwned + JsonSchema,
pub async fn complete( &mut self, messages: &mut Messages, ) -> Result<ChatOutcome<StructuredResponse<T>>, ChatFailure>
Source§impl<CP: EmbeddingsProvider> Chat<CP, Embedded>
impl<CP: EmbeddingsProvider> Chat<CP, Embedded>
pub async fn embed( &mut self, messages: &mut Messages, ) -> Result<EmbeddingsResponse, ChatFailure>
Trait Implementations§
Auto Trait Implementations§
impl<CP, Output> Freeze for Chat<CP, Output>where
CP: Freeze,
impl<CP, Output = Unstructured> !RefUnwindSafe for Chat<CP, Output>
impl<CP, Output> Send for Chat<CP, Output>
impl<CP, Output> Sync for Chat<CP, Output>
impl<CP, Output> Unpin for Chat<CP, Output>
impl<CP, Output> UnsafeUnpin for Chat<CP, Output>where
CP: UnsafeUnpin,
impl<CP, Output = Unstructured> !UnwindSafe for Chat<CP, Output>
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