pub struct ModelInfo {
pub id: String,
pub name: Option<String>,
pub description: Option<String>,
pub type: Option<String>,
pub created_at: Option<u64>,
pub owned_by: Option<String>,
pub context_length: Option<u32>,
pub max_output_tokens: Option<u32>,
pub supports_tool_calls: Option<bool>,
}Expand description
Provider-advertised model identifier and optional metadata.
Fields§
§id: StringThe unique identifier for the model (required)
name: Option<String>A human-readable name for the model
description: Option<String>A detailed description of the model’s capabilities
type: Option<String>The type of model (e.g., “chat”, “completion”, “embedding”)
created_at: Option<u64>Timestamp when the model was created (Unix epoch)
owned_by: Option<String>The organization or entity that owns the model
context_length: Option<u32>The maximum context window size for the model
max_output_tokens: Option<u32>Provider-reported output-token ceiling, or None when unreported.
Distinct from context length and not automatically applied to requests.
supports_tool_calls: Option<bool>Provider-reported tool-call support, or None when unreported.
Implementations§
Source§impl ModelInfo
impl ModelInfo
Sourcepub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
Creates a model with an ID and display name; other metadata is absent.
Sourcepub fn from_id(id: impl Into<String>) -> Self
pub fn from_id(id: impl Into<String>) -> Self
Creates a model with an ID and no optional metadata.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Returns the name when present, otherwise the ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelInfo
impl<'de> Deserialize<'de> for ModelInfo
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 ModelInfo
Source§impl From<ListModelEntry> for ModelInfo
impl From<ListModelEntry> for ModelInfo
Source§fn from(value: ListModelEntry) -> Self
fn from(value: ListModelEntry) -> Self
Source§impl From<ModelEntry> for ModelInfo
impl From<ModelEntry> for ModelInfo
Source§fn from(entry: ModelEntry) -> Self
fn from(entry: ModelEntry) -> Self
impl StructuralPartialEq for ModelInfo
Auto Trait Implementations§
impl Forget for ModelInfo
impl Freeze for ModelInfo
impl Move for ModelInfo
impl RefUnwindSafe for ModelInfo
impl Send for ModelInfo
impl Sync for ModelInfo
impl Unpin for ModelInfo
impl UnsafeUnpin for ModelInfo
impl UnwindSafe for ModelInfo
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>,
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> 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> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.