pub struct ProviderCapabilities {
pub streaming_tool_calls: bool,
pub named_sse_events: bool,
pub reasoning_content: bool,
pub image_input: bool,
pub system_as_top_level: bool,
pub ndjson_streaming: bool,
pub tool_support: bool,
pub structured_output: bool,
pub requires_version_header: bool,
pub supports_parallel_tool_calls: bool,
pub max_context_tokens: Option<u32>,
pub tokenizer_name: Option<&'static str>,
}Expand description
Protocol-level features that differ across LLM providers.
Fields§
§streaming_tool_calls: boolSupports incremental streaming tool call deltas (OpenAI delta.tool_calls).
When false, tool calls are only available in final message (Anthropic block events).
named_sse_events: boolUses named SSE event types (Anthropic event: content_block_start etc.)
vs bare data: lines (OpenAI-compatible).
reasoning_content: boolSupports reasoning_content / thinking output in streaming responses
(Qwen3, DeepSeek, OpenAI o-series).
image_input: boolSupports image inputs (multimodal content parts).
system_as_top_level: boolSystem prompt sent as a top-level request field (Anthropic system)
vs as a message in the messages array with role: "system".
ndjson_streaming: boolUses NDJSON (one JSON object per line, \n delimited) for streaming
instead of standard SSE data: lines (Ollama).
tool_support: boolSupports function/tool definitions in requests.
structured_output: boolSupports structured output (response_format with JSON Schema).
requires_version_header: boolRequires a provider-specific version header (Anthropic anthropic-version).
supports_parallel_tool_calls: boolSupports parallel tool calls (multiple tools requested in a single response). OpenAI, Anthropic, and most cloud providers support this; Ollama and local models typically do not.
max_context_tokens: Option<u32>Known maximum context window in tokens for this provider’s default model.
None means unknown.
tokenizer_name: Option<&'static str>Tokenizer name or identifier for accurate token counting (e.g.
"cl100k_base" for GPT-4, "o200k_base" for GPT-4o).
None means the tokenizer is unknown; callers should fall back to
heuristic counting.
Implementations§
Source§impl ProviderCapabilities
impl ProviderCapabilities
Sourcepub const fn openai_compatible() -> ProviderCapabilities
pub const fn openai_compatible() -> ProviderCapabilities
Default capabilities for OpenAI and OpenAI-compatible providers (DashScope, DeepSeek, Moonshot, Zhipu, etc.).
Sourcepub const fn anthropic() -> ProviderCapabilities
pub const fn anthropic() -> ProviderCapabilities
Capabilities for Anthropic Messages API.
Sourcepub const fn ollama() -> ProviderCapabilities
pub const fn ollama() -> ProviderCapabilities
Capabilities for local Ollama.
Sourcepub fn from_provider_name(name: &str) -> ProviderCapabilities
pub fn from_provider_name(name: &str) -> ProviderCapabilities
Resolve capabilities from a provider name string.
Trait Implementations§
Source§impl Clone for ProviderCapabilities
impl Clone for ProviderCapabilities
Source§fn clone(&self) -> ProviderCapabilities
fn clone(&self) -> ProviderCapabilities
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProviderCapabilities
impl Debug for ProviderCapabilities
Source§impl PartialEq for ProviderCapabilities
impl PartialEq for ProviderCapabilities
Source§fn eq(&self, other: &ProviderCapabilities) -> bool
fn eq(&self, other: &ProviderCapabilities) -> bool
self and other values to be equal, and is used by ==.impl Copy for ProviderCapabilities
impl Eq for ProviderCapabilities
impl StructuralPartialEq for ProviderCapabilities
Auto Trait Implementations§
impl Freeze for ProviderCapabilities
impl RefUnwindSafe for ProviderCapabilities
impl Send for ProviderCapabilities
impl Sync for ProviderCapabilities
impl Unpin for ProviderCapabilities
impl UnsafeUnpin for ProviderCapabilities
impl UnwindSafe for ProviderCapabilities
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request