pub struct ModelCatalog { /* private fields */ }Expand description
Represents the deduplicated set of models advertised by /v1/models,
always including the built-in fixture and sim/browse/plan entries.
Implementations§
Source§impl ModelCatalog
impl ModelCatalog
Sourcepub fn default_fixture() -> Self
pub fn default_fixture() -> Self
Returns the catalog containing only the built-in fixture models.
Sourcepub fn from_runner_card_exprs(
cards: impl IntoIterator<Item = Expr>,
) -> Result<Self>
pub fn from_runner_card_exprs( cards: impl IntoIterator<Item = Expr>, ) -> Result<Self>
Builds a catalog from runner model-card transcripts, parsing each
expression into a ModelCard and failing on a malformed transcript.
Sourcepub fn from_model_cards(cards: impl IntoIterator<Item = ModelCard>) -> Self
pub fn from_model_cards(cards: impl IntoIterator<Item = ModelCard>) -> Self
Builds a catalog from already-parsed runner model cards.
Sourcepub fn from_runner_args(cx: &mut Cx, args: Vec<SimValue>) -> Result<Self>
pub fn from_runner_args(cx: &mut Cx, args: Vec<SimValue>) -> Result<Self>
Builds a catalog by calling the runner/cards function with the given
arguments and parsing the returned list of model-card transcripts.
Returns the fixture-only catalog when no arguments are supplied, and
errors if runner/cards does not return a list.
Sourcepub fn models(&self) -> &[OpenAiModel]
pub fn models(&self) -> &[OpenAiModel]
Returns the catalog’s models in advertised order.
Trait Implementations§
Source§impl Clone for ModelCatalog
impl Clone for ModelCatalog
Source§fn clone(&self) -> ModelCatalog
fn clone(&self) -> ModelCatalog
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModelCatalog
impl Debug for ModelCatalog
impl Eq for ModelCatalog
Source§impl PartialEq for ModelCatalog
impl PartialEq for ModelCatalog
Source§fn eq(&self, other: &ModelCatalog) -> bool
fn eq(&self, other: &ModelCatalog) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ModelCatalog
Auto Trait Implementations§
impl Freeze for ModelCatalog
impl RefUnwindSafe for ModelCatalog
impl Send for ModelCatalog
impl Sync for ModelCatalog
impl Unpin for ModelCatalog
impl UnsafeUnpin for ModelCatalog
impl UnwindSafe for ModelCatalog
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