pub struct ModelBuilder(/* private fields */);Available on crate feature
async-client only.Expand description
A model endpoint for HarnessOptions::model.
At least one model is required: a harness initialised without one exits immediately and drops the socket with no error frame.
Implementations§
Source§impl ModelBuilder
impl ModelBuilder
Sourcepub fn gemini(name: impl Into<String>, api_key: impl Into<String>) -> Self
pub fn gemini(name: impl Into<String>, api_key: impl Into<String>) -> Self
A model served by the Gemini Developer API, authenticated with an API key.
Sourcepub fn vertex(
name: impl Into<String>,
project: impl Into<String>,
location: impl Into<String>,
) -> Self
pub fn vertex( name: impl Into<String>, project: impl Into<String>, location: impl Into<String>, ) -> Self
A model served by Gemini Enterprise (formerly Vertex AI), authenticated with Application Default Credentials.
Sourcepub fn types(self, types: impl IntoIterator<Item = ModelType>) -> Self
pub fn types(self, types: impl IntoIterator<Item = ModelType>) -> Self
Declares what this model is used for. Defaults to ModelType::Text.
Sourcepub fn from_config(config: ModelConfig) -> Self
pub fn from_config(config: ModelConfig) -> Self
Escape hatch for an endpoint shape this builder does not cover.
Sourcepub fn build(self) -> ModelConfig
pub fn build(self) -> ModelConfig
The underlying wire config.
Trait Implementations§
Source§impl Clone for ModelBuilder
impl Clone for ModelBuilder
Source§fn clone(&self) -> ModelBuilder
fn clone(&self) -> ModelBuilder
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 moreAuto Trait Implementations§
impl Freeze for ModelBuilder
impl RefUnwindSafe for ModelBuilder
impl Send for ModelBuilder
impl Sync for ModelBuilder
impl Unpin for ModelBuilder
impl UnsafeUnpin for ModelBuilder
impl UnwindSafe for ModelBuilder
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