pub struct RemoteEmbeddingProvider { /* private fields */ }Expand description
An OpenAI-compatible /embeddings endpoint, as the gear’s provider.
Implementations§
Source§impl RemoteEmbeddingProvider
impl RemoteEmbeddingProvider
Sourcepub fn new(config: RemoteProviderConfig) -> Result<Self, RemoteConfigError>
pub fn new(config: RemoteProviderConfig) -> Result<Self, RemoteConfigError>
Validate the configuration and build the client.
Nothing is sent: the identity is declarative, and a deployment whose endpoint is down at boot should still start and report the arm as unavailable when asked, not refuse to boot.
§Errors
A base URL that is not absolute http(s), an empty model, a zero
width or batch size, or a client that cannot be constructed.
Trait Implementations§
Source§impl EmbeddingProviderV1 for RemoteEmbeddingProvider
impl EmbeddingProviderV1 for RemoteEmbeddingProvider
Source§fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), EmbeddingProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
One short request. The endpoint has no cheaper probe that every compatible server implements, so readiness costs one embedding.
Source§fn embedding_space(&self) -> &EmbeddingSpaceId
fn embedding_space(&self) -> &EmbeddingSpaceId
Model artifact, tokenizer artifact, preprocessing and pooling
configuration — not just a dimension.
fn dimension(&self) -> u32
fn embed<'life0, 'async_trait>(
&'life0 self,
req: EmbedRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbedResponse, EmbeddingProviderError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for RemoteEmbeddingProvider
impl !UnwindSafe for RemoteEmbeddingProvider
impl Freeze for RemoteEmbeddingProvider
impl Send for RemoteEmbeddingProvider
impl Sync for RemoteEmbeddingProvider
impl Unpin for RemoteEmbeddingProvider
impl UnsafeUnpin for RemoteEmbeddingProvider
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