pub struct InMemoryModelProfileRegistry { /* private fields */ }Expand description
In-memory implementation of ModelProfileRegistry.
Thread-safe via an internal RwLock. Cloning shares the same backing store.
§Example
use synwire_core::language_models::registry::{
InMemoryModelProfileRegistry, ModelProfile, ModelProfileRegistry,
};
let registry = InMemoryModelProfileRegistry::default();
registry.register(ModelProfile {
model_id: "gpt-4o".into(),
provider: "openai".into(),
supports_tools: true,
supports_streaming: true,
supports_structured_output: false,
max_context_tokens: Some(128_000),
max_output_tokens: Some(16_384),
});
assert!(registry.supports("gpt-4o", "tools"));
assert!(!registry.supports("gpt-4o", "structured_output"));
assert!(registry.get("gpt-4o").is_some());Implementations§
Trait Implementations§
Source§impl Clone for InMemoryModelProfileRegistry
impl Clone for InMemoryModelProfileRegistry
Source§fn clone(&self) -> InMemoryModelProfileRegistry
fn clone(&self) -> InMemoryModelProfileRegistry
Returns a duplicate of the value. Read more
1.0.0 · 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 InMemoryModelProfileRegistry
impl Debug for InMemoryModelProfileRegistry
Source§impl Default for InMemoryModelProfileRegistry
impl Default for InMemoryModelProfileRegistry
Source§fn default() -> InMemoryModelProfileRegistry
fn default() -> InMemoryModelProfileRegistry
Returns the “default value” for a type. Read more
Source§impl ModelProfileRegistry for InMemoryModelProfileRegistry
impl ModelProfileRegistry for InMemoryModelProfileRegistry
Source§fn register(&self, profile: ModelProfile)
fn register(&self, profile: ModelProfile)
Register a model profile. Read more
Auto Trait Implementations§
impl Freeze for InMemoryModelProfileRegistry
impl RefUnwindSafe for InMemoryModelProfileRegistry
impl Send for InMemoryModelProfileRegistry
impl Sync for InMemoryModelProfileRegistry
impl Unpin for InMemoryModelProfileRegistry
impl UnsafeUnpin for InMemoryModelProfileRegistry
impl UnwindSafe for InMemoryModelProfileRegistry
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