pub struct OpenAiCompatibleEmbedding { /* private fields */ }Expand description
Generic OpenAI-compatible embedding model. No default base URL — always
construct with OpenAiCompatibleEmbedding::new.
Implementations§
Source§impl OpenAiCompatibleEmbedding
impl OpenAiCompatibleEmbedding
Sourcepub fn with_base_url(self, url: impl Into<String>) -> Self
pub fn with_base_url(self, url: impl Into<String>) -> Self
Override the base URL set at construction.
Sourcepub fn with_model(self, name: impl Into<String>) -> Self
pub fn with_model(self, name: impl Into<String>) -> Self
Set the model name sent in the request body.
Sourcepub fn with_api_key(self, key: impl Into<String>) -> Self
pub fn with_api_key(self, key: impl Into<String>) -> Self
Set the API key / bearer token, if the server requires one.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set a custom timeout for HTTP requests.
Sourcepub fn with_max_retries(self, retries: u32) -> Self
pub fn with_max_retries(self, retries: u32) -> Self
Set the maximum number of retries for transient (429 / 5xx) errors on the initial request (default: 3).
Sourcepub fn allow_plaintext_api_key(self) -> Self
pub fn allow_plaintext_api_key(self) -> Self
Opts back into warn-and-send for an API key sent over a plaintext
http:// base URL (default: hard error). Only use this for a
genuinely local, unauthenticated-but-keyed server.
Sourcepub fn with_dimensions(self, dims: usize) -> Self
pub fn with_dimensions(self, dims: usize) -> Self
Declare the dimensionality of the embeddings this server produces.
Trait Implementations§
Source§impl Debug for OpenAiCompatibleEmbedding
impl Debug for OpenAiCompatibleEmbedding
Auto Trait Implementations§
impl !Freeze for OpenAiCompatibleEmbedding
impl !RefUnwindSafe for OpenAiCompatibleEmbedding
impl !UnwindSafe for OpenAiCompatibleEmbedding
impl Send for OpenAiCompatibleEmbedding
impl Sync for OpenAiCompatibleEmbedding
impl Unpin for OpenAiCompatibleEmbedding
impl UnsafeUnpin for OpenAiCompatibleEmbedding
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