API Reference¶
Providers¶
Prebuilt clients for LLM providers
Anthropic¶
Client interface for interacting with Anthropic API |
|
Async client interface for interacting with Anthropic API |
OpenAI¶
Client interface for interacting with OpenAI API |
|
Async client interface for interacting with OpenAI API |
Ollama¶
Interface for using Ollama API |
|
Async interface for using Ollama API |
|
Failed to connect to Ollama server |
Core¶
Core components for creating client interfaces and model chats
Conversation¶
Building blocks for creating prompts to LLMs
Conversation builder to ensure messages are in a valid order |
|
Immutable conversation for LLM |
|
DTO for LLM messages |
|
Roles for LLM conversation |
Base Clients¶
Base clients for LLM clients
Abstract base class for synchronous model clients |
|
Abstract base class for asynchronous model clients |
|
Load API key from env variable |
|
Failed to validate LLM API key |
|
Requested model not found |
Retry Handlers¶
Automatic response validation and reprompting
Retry handler to validate LLM responses |
|
Async retry handler to validate LLM responses |
|
Handler for parsing JSON from LLM responses |
|
Async handler for parsing JSON from LLM responses |
|
Exceed the number of retries |