pub struct ModelCapabilities {
pub stateful: Option<bool>,
pub prompt_caching: Option<PromptCaching>,
pub forced_tool_choice: Option<bool>,
pub native_structured_output: Option<bool>,
pub server_side_summary: Option<bool>,
pub temporary_messages: Option<bool>,
pub deferred_tool_loading: Option<DeferredToolLoading>,
pub accepted_mime_types: Option<Vec<String>>,
pub reasoning_provider: Option<String>,
}Expand description
What the model can do (ModelCapabilities). None is unknown.
Fields are added as the SDK learns to read more facts, so build values with the builder or
ModelCapabilities { stateful: Some(true), ..Default::default() } rather than listing every
field. The same holds for ModelLimits and ModelInfo.
Fields§
§stateful: Option<bool>Whether the model keeps conversation state server-side; Model::stateful reads it.
prompt_caching: Option<PromptCaching>Whether and how the model caches prompts.
forced_tool_choice: Option<bool>Whether the Bedrock and Anthropic providers force the structured output tool (Any or a
named tool) on the structured output retry. False when the model rejects forcing, or when a
forced call degrades the response (for example, it skips thinking).
native_structured_output: Option<bool>Whether the provider can make the model’s text output conform to a JSON schema.
server_side_summary: Option<bool>Whether the model summarizes history server-side through Model::summarize; set
Some(false) in model_info to summarize client-side.
temporary_messages: Option<bool>Whether the model and provider take temporary messages: injected text the model reads only
until the next user message. When true, the provider receives each InjectedBlock as
stored; otherwise it receives only the latest user message’s injected text, as text. The
default Model::model_info reports false unless the provider can send them.
deferred_tool_loading: Option<DeferredToolLoading>How the model and provider defer tool schemas. In the shared data, Native is the path on
the model vendor’s own API and Unsupported marks a model that cannot fill in a stub’s
parameters, such as one that constrains its tool calls to the stub’s open schema. The
default Model::model_info reports Stubs for every other model; Native comes only
from a provider that sends the deferral flag (AnthropicModel), and Unsupported from one
that needs each tool’s full input schema (BedrockModel with strict_tools). A
model_info override that sets Unsupported sends every full spec to a model that handles
stubs badly. On a provider without the flag, an override that sets Native sends every full
spec and only changes the load_tools result: BedrockModel names each loaded tool and
other providers leave it out.
accepted_mime_types: Option<Vec<String>>MIME types the model and provider take in the media blocks of a user message; an empty list
when they take only text, None for every type. An entry matches a type exactly
(image/png) or by its type/*; case and ; parameters are ignored. A wildcard can also
mean the kind isn’t verified. Tool results can take fewer.
reasoning_provider: Option<String>The ReasoningProviderData::provider tag of the reasoning the model takes back from
history, such as openai_responses. Reasoning tagged otherwise does not reach the model.
Implementations§
Source§impl ModelCapabilities
impl ModelCapabilities
Sourcepub fn builder() -> ModelCapabilitiesBuilder
pub fn builder() -> ModelCapabilitiesBuilder
Create an instance of ModelCapabilities using the builder syntax
Trait Implementations§
Source§impl Clone for ModelCapabilities
impl Clone for ModelCapabilities
Source§impl Debug for ModelCapabilities
impl Debug for ModelCapabilities
Source§impl Default for ModelCapabilities
impl Default for ModelCapabilities
Source§impl<'de> Deserialize<'de> for ModelCapabilities
impl<'de> Deserialize<'de> for ModelCapabilities
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ModelCapabilities
Source§impl PartialEq for ModelCapabilities
impl PartialEq for ModelCapabilities
Source§impl Serialize for ModelCapabilities
impl Serialize for ModelCapabilities
impl StructuralPartialEq for ModelCapabilities
Auto Trait Implementations§
impl Freeze for ModelCapabilities
impl RefUnwindSafe for ModelCapabilities
impl Send for ModelCapabilities
impl Sync for ModelCapabilities
impl Unpin for ModelCapabilities
impl UnsafeUnpin for ModelCapabilities
impl UnwindSafe for ModelCapabilities
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more