Skip to main content

complete

Function complete 

Source
pub async fn complete(
    model: &Model,
    context: &Context,
    options: Option<StreamOptions>,
) -> Result<AssistantMessage, Error>
Expand description

High-level completion and token estimation. High-level complete function that collects all streaming events and returns the final assistant message.

§Arguments

  • model - The model to use
  • context - The conversation context
  • options - Optional streaming options

§Returns

The final assistant message containing all content blocks