pub enum ModelSpec {
Name(String),
Instance(BoxedModel),
}Expand description
Model specification - either a string like “openai:gpt-4o” or a Model instance.
This allows flexible model specification in the direct API functions.
§Examples
ⓘ
// From string
let spec: ModelSpec = "openai:gpt-4o".into();
// From model instance
let model = OpenAIChatModel::from_env("gpt-4o")?;
let spec: ModelSpec = model.into();Variants§
Name(String)
Model specified by name (e.g., “openai:gpt-4o”).
Instance(BoxedModel)
Pre-built model instance.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelSpec
impl !RefUnwindSafe for ModelSpec
impl Send for ModelSpec
impl Sync for ModelSpec
impl Unpin for ModelSpec
impl !UnwindSafe for ModelSpec
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