pub struct ModelSpec {
pub id: String,
pub variant: Option<String>,
pub limits: ModelLimits,
}Fields§
§id: String§variant: Option<String>§limits: ModelLimitsImplementations§
Source§impl ModelSpec
impl ModelSpec
pub fn new(id: impl Into<String>, context_window_tokens: NonZeroUsize) -> Self
pub fn with_limits( id: impl Into<String>, variant: Option<String>, limits: ModelLimits, ) -> Self
pub fn with_variant(self, variant: Option<String>) -> Self
Sourcepub fn from_token_limits(
id: impl Into<String>,
variant: Option<String>,
context_window_tokens: usize,
output_token_capacity: Option<usize>,
) -> Result<Self, String>
pub fn from_token_limits( id: impl Into<String>, variant: Option<String>, context_window_tokens: usize, output_token_capacity: Option<usize>, ) -> Result<Self, String>
Build a spec from the prompt budget (context_window_tokens — the
maximum input the provider accepts for this model on this route) and the
optional output cap. The budget is what history pruning and the UI
measure against.
pub fn context_window_tokens(&self) -> usize
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ModelSpec
impl<'de> Deserialize<'de> for ModelSpec
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 Eq for ModelSpec
impl StructuralPartialEq for ModelSpec
Auto Trait Implementations§
impl Freeze for ModelSpec
impl RefUnwindSafe for ModelSpec
impl Send for ModelSpec
impl Sync for ModelSpec
impl Unpin for ModelSpec
impl UnsafeUnpin for ModelSpec
impl UnwindSafe for ModelSpec
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