pub struct RemoteOpenAIProvider { /* private fields */ }Expand description
Remote provider that calls the OpenAI API
for embedding (/v1/embeddings) and text generation (/v1/chat/completions).
Requires the OPENAI_API_KEY environment variable (or a custom env var name
via the api_key_env option).
Implementations§
Trait Implementations§
Source§impl Default for RemoteOpenAIProvider
impl Default for RemoteOpenAIProvider
Source§impl ModelProvider for RemoteOpenAIProvider
impl ModelProvider for RemoteOpenAIProvider
Source§fn provider_id(&self) -> &'static str
fn provider_id(&self) -> &'static str
Unique identifier for this provider (e.g.
"local/candle", "remote/openai").Source§fn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Return the set of tasks this provider supports.
Source§fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 ModelAliasSpec,
) -> Pin<Box<dyn Future<Output = Result<LoadedModelHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load<'life0, 'life1, 'async_trait>(
&'life0 self,
spec: &'life1 ModelAliasSpec,
) -> Pin<Box<dyn Future<Output = Result<LoadedModelHandle>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load (or connect to) a model described by
spec and return a type-erased
handle. Read moreAuto Trait Implementations§
impl !Freeze for RemoteOpenAIProvider
impl !RefUnwindSafe for RemoteOpenAIProvider
impl Send for RemoteOpenAIProvider
impl Sync for RemoteOpenAIProvider
impl Unpin for RemoteOpenAIProvider
impl !UnwindSafe for RemoteOpenAIProvider
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more