pub struct OpenAiCompatibleProvider { /* private fields */ }Implementations§
Source§impl OpenAiCompatibleProvider
impl OpenAiCompatibleProvider
pub fn new( config: OpenAiCompatibleConfig, ) -> Result<OpenAiCompatibleProvider, RuntimeError>
pub fn endpoint(&self) -> &str
pub fn location(&self) -> ExecutionLocation
Trait Implementations§
Source§impl Clone for OpenAiCompatibleProvider
impl Clone for OpenAiCompatibleProvider
Source§fn clone(&self) -> OpenAiCompatibleProvider
fn clone(&self) -> OpenAiCompatibleProvider
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 moreSource§impl Debug for OpenAiCompatibleProvider
impl Debug for OpenAiCompatibleProvider
Source§impl GenerationProvider for OpenAiCompatibleProvider
impl GenerationProvider for OpenAiCompatibleProvider
fn name(&self) -> &str
Source§fn capabilities(&self) -> ProviderCapabilities
fn capabilities(&self) -> ProviderCapabilities
Shared provider descriptor (local/remote, endpoint, streaming, …).
fn generation_capabilities(&self) -> GenerationCapabilities
Source§fn list_models<'life0, 'async_trait>(
&'life0 self,
cancellation: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenerationModelInfo>, RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAiCompatibleProvider: 'async_trait,
fn list_models<'life0, 'async_trait>(
&'life0 self,
cancellation: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<Vec<GenerationModelInfo>, RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAiCompatibleProvider: 'async_trait,
Lists models when the upstream supports discovery; otherwise returns
a
CapabilityMismatch error.fn chat<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
cancellation: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<ChatResponse, RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAiCompatibleProvider: 'async_trait,
Source§fn chat_stream<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
cancellation: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, RuntimeError>> + Send>>, RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAiCompatibleProvider: 'async_trait,
fn chat_stream<'life0, 'async_trait>(
&'life0 self,
request: ChatRequest,
cancellation: Option<CancellationToken>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<ChatStreamEvent, RuntimeError>> + Send>>, RuntimeError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OpenAiCompatibleProvider: 'async_trait,
Dropping the returned stream must release the upstream connection.
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAiCompatibleProvider
impl !UnwindSafe for OpenAiCompatibleProvider
impl Freeze for OpenAiCompatibleProvider
impl Send for OpenAiCompatibleProvider
impl Sync for OpenAiCompatibleProvider
impl Unpin for OpenAiCompatibleProvider
impl UnsafeUnpin for OpenAiCompatibleProvider
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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