Skip to main content

ModelAlias

Struct ModelAlias 

Source
pub struct ModelAlias {
    pub harness: Option<String>,
    pub description: Option<String>,
    pub prompting: Option<String>,
    pub note: Option<String>,
    pub default_effort: Option<EffortRequest>,
    pub autocompact: Option<u32>,
    pub autocompact_pct: Option<u8>,
    pub spec: ModelSpec,
}

Fields§

§harness: Option<String>§description: Option<String>§prompting: Option<String>§note: Option<String>§default_effort: Option<EffortRequest>§autocompact: Option<u32>§autocompact_pct: Option<u8>§spec: ModelSpec

Implementations§

Source§

impl ModelAlias

Source

pub fn pinned_model_id(&self) -> Option<&str>

Source

pub fn description(&self) -> Option<&str>

The text fields as shown: an empty one is a layer clearing the text below it, and reads as none. Layers keep the empty string so it can clear.

Source

pub fn prompting(&self) -> Option<&str>

Source

pub fn note(&self) -> Option<&str>

Source

pub fn over(&self, lower: &ModelAlias) -> ModelAlias

This entry as a higher layer over lower, field by field. The routing fields (model, match, exclude, provider, harness) move as one group: an entry that sets any of them drops all of lower’s. The rest inherit when unset. An empty description, note or prompting clears the lower one (see the accessors).

Source§

impl ModelAlias

Source

pub fn resolve(&self, rows: &[CachedModel]) -> Option<String>

The id the alias resolves to over rows: a pinned model as written, else the best row an auto alias selects. None when an auto alias selects nothing.

Source

pub fn candidates(&self, rows: &[CachedModel]) -> Vec<String>

Every id the alias accepts, in resolve’s order: a pinned model first, then each row match, exclude and provider select, best first. A pinned alias with no match accepts its model alone.

Source

pub fn selected<'a>(&self, rows: &'a [CachedModel]) -> Vec<&'a CachedModel>

The rows match, exclude and provider select; a pinned model’s provider is inferred from its id when the alias names none.

Trait Implementations§

Source§

impl Clone for ModelAlias

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelAlias

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ModelAlias

Source§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ModelAlias

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ModelAlias

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ModelAlias

Auto Trait Implementations§

§

impl Forget for ModelAlias

§

impl Freeze for ModelAlias

§

impl Move for ModelAlias

§

impl RefUnwindSafe for ModelAlias

§

impl Send for ModelAlias
where RawVecInner: Send,

§

impl Sync for ModelAlias
where RawVecInner: Sync,

§

impl Unpin for ModelAlias
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ModelAlias

§

impl UnwindSafe for ModelAlias
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.