Expand description
Core LLM provider trait and error types. Universal LLM provider abstraction with API-specific role handling.
The canonical trait, request/response types, and tool definitions live in
vtcode_llm::provider. This module re-exports them so the historical
crate::llm::provider::* import paths continue to resolve throughout
vtcode-core.
Structs§
- Anthropic
Request Overrides - Choice
Decision Answer - A validated choice answer. Confidence is retained without a threshold.
- Choice
Decision Request - Evidence and instructions for exactly one named choice question. Deliberately omits images, predicates, scores, and generation controls.
- Choice
Decision Response - An inconclusive answer still retains independently parsed billed usage.
- Coding
Agent Settings - Settings to refine model behavior for coding agent tasks
- Context
Window Provider - Provider-local context capacity discovered for the selected model. All transport and capability behavior remains delegated to the underlying provider.
- Decision
Choice Option - One supplied text category and its meaning.
- Decision
Probability - A probability for one supplied category.
- Fallback
Model - Fallback model configuration for Anthropic server-side fallback.
The explicit-list form of
fallbacks, sent with theserver-side-fallback-2026-06-01beta header (the"default"keyword form usesserver-side-fallback-2026-07-01; pairing a header with the other form is rejected). - Function
Call - Function call within a tool call
- Function
Definition - Function definition within a tool
- Grammar
Definition - Grammar definition for GPT-5 context-free grammar (CFG) constraints
- LLMError
Metadata - LLMRequest
- Universal LLM request structure
- LLMResponse
- Universal LLM response structure
- Message
- Universal message structure supporting both text and image content
- Parallel
Tool Config - Configuration for parallel tool use behavior Based on Anthropic’s parallel tool use guidelines
- Prepared
Responses Request - Provider
Capabilities - Cached provider capabilities to reduce repeated trait method calls
- Responses
Compaction Options - Optional overrides for standalone Responses compaction requests.
- Responses
Continuation State - Shell
Tool Definition - Shell tool definition for GPT-5.1 shell tool type Allows controlled command-line interface interactions
- Specific
Function Choice - Specific function choice details
- Specific
Tool Choice - Specific tool choice for forcing a particular function call
- Tool
Call - Universal tool call that matches OpenAI/Anthropic/Gemini specifications
- Tool
Definition - Universal tool definition that matches OpenAI/Anthropic/Gemini specifications Based on official API documentation from Context7
- Tool
Namespace - A namespace grouping for deferred tools. When a tool has a namespace and
defer_loadingis true, only the namespace metadata (name + description) is sent upfront. The full tool definitions are loaded when the model searches for a tool in that namespace. - Usage
Enums§
- Anthropic
Optional String Override - Anthropic
Optional U32Override - Anthropic
Thinking Config - Anthropic thinking configuration for fallback models.
- Anthropic
Thinking Display Override - Anthropic
Thinking Mode Override - Assistant
Phase - Phase metadata for assistant messages in multi-step Responses-style workflows.
- Content
Part - Content type for messages that can include both text and images
- Finish
Reason - LLMError
- LLM error types with optional provider metadata
- LLMStream
Event - Message
Clear At - Controls when an Anthropic mid-conversation system message is cleared.
- Message
Content - Message
Role - Normalized
Stream Event - Prompt
Cache Profile - Reasoning
Source - Provider-side classification for streamed reasoning text.
- Tool
Choice - Tool choice configuration that works across different providers Based on OpenAI, Anthropic, and Gemini API specifications Follows Anthropic’s tool use best practices for optimal performance
- Tool
Search Algorithm - Tool search algorithm for Anthropic’s advanced-tool-use beta
Constants§
- DECISIONS_
MODEL - The model supported by the experimental Decisions endpoint.
Traits§
- LLMProvider
- Universal LLM provider trait
Functions§
- get_
cached_ capabilities - Extract and cache provider capabilities for a given provider and model
- prepare_
openai_ responses_ request - prepare_
responses_ continuation_ request - records_
responses_ continuation_ state - responses_
continuation_ key - supports_
responses_ chaining - uses_
incremental_ responses_ history - Compatibility shim for older callers.