pub struct Model {Show 17 fields
pub id: String,
pub name: String,
pub api: String,
pub provider: String,
pub base_url: String,
pub reasoning: bool,
pub input: Vec<InputKind>,
pub cost: Pricing,
pub context_window: u64,
pub max_tokens: u64,
pub thinking_level_map: Option<IndexMap<String, Option<String>>>,
pub prompt_cache: Option<PromptCache>,
pub sampling_params: Option<Map<String, Value>>,
pub compat: Option<Map<String, Value>>,
pub input_limits: Option<InputLimits>,
pub headers: Option<IndexMap<String, String>>,
pub kind: Option<String>,
}Expand description
A chat model.
Fields§
§id: String§name: String§api: StringWire API id, such as anthropic-messages.
provider: String§base_url: String§reasoning: bool§input: Vec<InputKind>§cost: Pricing§context_window: u64§max_tokens: u64§thinking_level_map: Option<IndexMap<String, Option<String>>>pi thinking level to provider value; None marks the level unsupported.
prompt_cache: Option<PromptCache>§sampling_params: Option<Map<String, Value>>§compat: Option<Map<String, Value>>Wire-API-specific options; read through Model::compat.
input_limits: Option<InputLimits>§headers: Option<IndexMap<String, String>>§kind: Option<String>"chat" or absent.
Implementations§
Source§impl Model
impl Model
Sourcepub fn compat<T: DeserializeOwned + Default>(&self) -> T
pub fn compat<T: DeserializeOwned + Default>(&self) -> T
Reads compat as the view for this model’s wire API. Unknown or invalid keys
are ignored, as in pi.
Sourcepub fn accepts_images(&self) -> bool
pub fn accepts_images(&self) -> bool
Whether the model accepts image input.
Sourcepub fn image_resize(&self) -> Option<&ImageResize>
pub fn image_resize(&self) -> Option<&ImageResize>
The resize profile for images that enter the conversation, from
inputLimits.images.resize.
Sourcepub fn thinking_level_value(&self, level: ThinkingLevel) -> Option<Option<&str>>
pub fn thinking_level_value(&self, level: ThinkingLevel) -> Option<Option<&str>>
The provider value for a thinking level: Some(None) when the map marks it
unsupported, None when the map does not mention it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
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
Mutably borrows from an owned value. Read more