pub struct OpenAICompatibleEmbeddingModelBuilder<const WITH_NAME: bool> { /* private fields */ }Expand description
A builder for an openai compatible embedding model.
Implementations§
Source§impl OpenAICompatibleEmbeddingModelBuilder<false>
impl OpenAICompatibleEmbeddingModelBuilder<false>
Source§impl<const WITH_NAME: bool> OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
Sourcepub fn with_model(
self,
model: impl ToString,
) -> OpenAICompatibleEmbeddingModelBuilder<true>
pub fn with_model( self, model: impl ToString, ) -> OpenAICompatibleEmbeddingModelBuilder<true>
Set the name of the model to use.
Sourcepub fn with_text_embedding_3_small(
self,
) -> OpenAICompatibleEmbeddingModelBuilder<true>
pub fn with_text_embedding_3_small( self, ) -> OpenAICompatibleEmbeddingModelBuilder<true>
Set the model to text-embedding-3-small. This is the smallest model available with a score of 62.3% on mteb and a max sequence length of 8191
Sourcepub fn with_text_embedding_3_large(
self,
) -> OpenAICompatibleEmbeddingModelBuilder<true>
pub fn with_text_embedding_3_large( self, ) -> OpenAICompatibleEmbeddingModelBuilder<true>
Set the model to text-embedding-3-large. This is the smallest model available with a score of 64.6% on mteb and a max sequence length of 8191
Sourcepub fn with_client(self, client: OpenAICompatibleClient) -> Self
pub fn with_client(self, client: OpenAICompatibleClient) -> Self
Set the client used to make requests to the OpenAI API.
Source§impl OpenAICompatibleEmbeddingModelBuilder<true>
impl OpenAICompatibleEmbeddingModelBuilder<true>
Sourcepub fn build(self) -> OpenAICompatibleEmbeddingModel
pub fn build(self) -> OpenAICompatibleEmbeddingModel
Build the model.
Trait Implementations§
Source§impl<const WITH_NAME: bool> Debug for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Debug for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
Source§impl<const WITH_NAME: bool> Default for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Default for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
Source§fn default() -> OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
fn default() -> OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
Returns the “default value” for a type. Read more
Source§impl ModelBuilder for OpenAICompatibleEmbeddingModelBuilder<true>
impl ModelBuilder for OpenAICompatibleEmbeddingModelBuilder<true>
Source§type Model = OpenAICompatibleEmbeddingModel
type Model = OpenAICompatibleEmbeddingModel
The model that this trait creates.
Source§type Error = Infallible
type Error = Infallible
An error that can occur when creating the model.
Source§async fn start_with_loading_handler(
self,
_: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static,
) -> Result<Self::Model, Self::Error>
async fn start_with_loading_handler( self, _: impl FnMut(ModelLoadingProgress) + Send + Sync + 'static, ) -> Result<Self::Model, Self::Error>
Start the model with a loading handler.
Source§fn requires_download(&self) -> bool
fn requires_download(&self) -> bool
Check if the model will need to be downloaded before use (default: false)
Auto Trait Implementations§
impl<const WITH_NAME: bool> !Freeze for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !RefUnwindSafe for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Send for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Sync for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> Unpin for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
impl<const WITH_NAME: bool> !UnwindSafe for OpenAICompatibleEmbeddingModelBuilder<WITH_NAME>
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