Expand description
Provider-neutral vocabulary for chat completions, plus the providers that speak it.
LlmProvider is the port: chat_completion
and chat_completion_stream over
LlmRequest / LlmResponse. openai covers OpenAI and every
OpenAI-compatible endpoint (OpenRouter, vLLM, llama.cpp); gemini covers
Google’s API. provider_from_env picks one from the environment.
The types are deliberately not tied to A2A. ToolCall and
ToolDefinition are the tool-calling vocabulary shared with the MCP
bridge, which is why they live in their own crate rather than inside an
agent framework.
Re-exports§
pub use provider::LlmConfigError;pub use provider::LlmSettings;pub use provider::PROVIDER_ENV_VARS;pub use provider::ReasoningPlan;pub use provider::SUPPORTED_PROVIDERS;pub use provider::SelectedLlm;pub use provider::provider_from_env;pub use provider::provider_from_settings;pub use tool_call::PartialToolCall;pub use tool_call::ToolCallAccumulator;
Modules§
- gemini
- openai
- provider
- Centralized
LlmProviderselection. - tool_
call - Incremental tool-call assembly for streaming LLM responses.
Structs§
- Chat
Message - A single message in a chat conversation.
- LlmRequest
- A request to an LLM provider for chat completion.
- LlmResponse
- A response from an LLM provider.
- Token
Usage - Tokens a provider reported for one request.
- Tool
Call - Represents a specific tool invocation requested by the LLM.
- Tool
Definition - Defines a tool (function) available for the LLM to call.
Enums§
- LlmError
- Represents an error returned by an LLM provider.
- LlmStream
Event - An event emitted during a streaming LLM response.
- Message
Role - The role of the message sender.
- Reasoning
- What to ask a reasoning-capable model to do with its thinking.
- Reasoning
Effort - How hard a reasoning model should think, when reasoning is requested.
Traits§
- LlmProvider
- Trait defining a generic LLM provider for standardizing AI integration across agents.