pub struct ModelReferenceDatabase { /* private fields */ }Expand description
A browsable, read-only factual reference database of model offerings.
Cards are sorted by (provider, model id) and de-duplicated on that
identity, so the database is deterministic regardless of input order.
Implementations§
Source§impl ModelReferenceDatabase
impl ModelReferenceDatabase
Sourcepub fn from_offerings(offerings: &[CatalogOffering]) -> Self
pub fn from_offerings(offerings: &[CatalogOffering]) -> Self
Build from raw catalog offerings.
Rows are keyed by (provider, model id); a later row with the same
identity replaces an earlier one, matching catalog merge semantics.
Sourcepub fn from_snapshot(snapshot: &CatalogSnapshot) -> Self
pub fn from_snapshot(snapshot: &CatalogSnapshot) -> Self
Build from a compiled catalog snapshot (bundled < live < overrides).
Sourcepub fn bundled() -> Self
pub fn bundled() -> Self
Build from CodeWhale’s offline/stale bundled catalog snapshot (#4188).
Prefer a live/compiled CatalogSnapshot when available. The bundled
set needs no credentials or network and remains the offline fallback
every install carries.
Sourcepub fn cards(&self) -> &[ModelReferenceCard]
pub fn cards(&self) -> &[ModelReferenceCard]
All cards, in stable (provider, model id) order.
Sourcepub fn for_provider(&self, provider: &str) -> Vec<&ModelReferenceCard>
pub fn for_provider(&self, provider: &str) -> Vec<&ModelReferenceCard>
All cards served by one provider id.
Trait Implementations§
Source§impl Clone for ModelReferenceDatabase
impl Clone for ModelReferenceDatabase
Source§fn clone(&self) -> ModelReferenceDatabase
fn clone(&self) -> ModelReferenceDatabase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more