pub struct ClientBuilder { /* private fields */ }Expand description
Build a Client. Start with Client::builder. Debug redacts the API
key.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Override the provider base URL. Blank/whitespace falls back to the
provider default; a trailing / is trimmed.
Sourcepub fn api_key(self, api_key: impl Into<String>) -> Self
pub fn api_key(self, api_key: impl Into<String>) -> Self
Set the API key explicitly instead of reading it from the environment. Consulted by every keyed provider (Voyage, OpenAI, Gemini); ignored by keyless Ollama.
Sourcepub fn output_dimension(self, dim: usize) -> Self
pub fn output_dimension(self, dim: usize) -> Self
Request a specific embedding width: Voyage output_dimension, OpenAI
dimensions, Gemini outputDimensionality (Ollama is model-fixed and
ignores it). Whatever the provider, every returned vector is validated
against it, so a drift becomes an Error::DimMismatch rather than a
silent schema desync.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
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 ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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