Module completion

Module completion 

Source
Expand description

Language model completion and conversation management

Contains:

  • Client for managing LLM interactions
  • Message history tracking
  • Response extraction

Structs§

Client
A client for managing interactions with a completion model, including conversation history, tooling, state management, and token tracking.
PromptBuilder
Builder for constructing and executing completion prompts
State
Extractor for state
TokenUsage
Tracks token usage statistics for model interactions

Enums§

CompletionError
Errors that can happen during completion
ExtractionError
Errors related to response extraction from completions
Message
Messages exchanged with the completion model
StateError
Errors related to state management in the Client

Traits§

CompletionModel
Core trait defining the interface for completion models
Extractor
Types that can be deserialized from model completion responses.

Functions§

default_extractor_serializer
Generates a JSON schema serializer for extractor types
serialize_assistant
Serializes assistant messages with integrated tool call information
serialize_user
Serializes user messages, ignoring tool call responses