#[non_exhaustive]pub enum Model {
Jev113,
Latest,
Custom(String),
}Expand description
A Jev / System One model identifier.
Model normalizes the documented ID mapping between the two API surfaces: the
Decisions surface expects an author-namespaced ID (typesafe/jev-1.13), while the
System One surface accepts and returns bare IDs (jev-1.13). Use
Model::wire_id to get the ID to send for a given Surface.
crate::Client additionally maps the pinned default to jev-1.13.0 for
crate::Provider::TypeSafe, following the direct API’s version convention.
§Examples
use jev::{Model, Surface};
let model = Model::Jev113;
assert_eq!(model.wire_id(Surface::Decisions), "typesafe/jev-1.13");
assert_eq!(model.wire_id(Surface::SystemOne), "jev-1.13");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Jev113
typesafe/jev-1.13 on the Decisions surface, jev-1.13 on System One.
This is DEFAULT_MODEL: pinned, not auto-updating. Thresholds are tuned
against one model’s calibration, so silently following jev-latest would
silently re-tune every gate in production.
Latest
~typesafe/jev-latest on the Decisions surface, jev-latest on System One.
Tracks the newest release. Intended for exploratory work, not for a service with tuned thresholds.
Custom(String)
Any other System One model ID, passed through unchanged on every surface.
Implementations§
Source§impl Model
impl Model
Sourcepub fn wire_id(&self, surface: Surface) -> Cow<'_, str>
pub fn wire_id(&self, surface: Surface) -> Cow<'_, str>
The identifier to send on the wire for the given Surface.
Model::Custom is never rewritten: the caller owns the exact string they
provided, on every surface.
§Examples
use jev::{Model, Surface};
let custom = Model::Custom("acme/experimental".to_string());
assert_eq!(custom.wire_id(Surface::Decisions), "acme/experimental");
assert_eq!(custom.wire_id(Surface::SystemOne), "acme/experimental");Sourcepub fn context_tokens(&self) -> Option<usize>
pub fn context_tokens(&self) -> Option<usize>
The model’s context window, in tokens, used for a cheap pre-flight size check.
Returns None for Model::Custom, since the SDK has no data for it; the
context-size guard is skipped in that case and the server remains authoritative.
Trait Implementations§
impl Eq for Model
Source§impl FromStr for Model
impl FromStr for Model
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a model ID in either its bare or namespaced form.
§Examples
use jev::Model;
assert_eq!("jev-1.13".parse::<Model>().unwrap(), Model::Jev113);
assert_eq!("typesafe/jev-1.13".parse::<Model>().unwrap(), Model::Jev113);
assert_eq!("~typesafe/jev-latest".parse::<Model>().unwrap(), Model::Latest);§Errors
Returns Error::Invalid when s is empty.
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
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.