pub struct OpenAiInference<'runtime> {
pub http: &'runtime dyn Transport,
pub probe: &'runtime dyn ProcessProbe,
pub adapter: &'runtime dyn BackendAdapter,
pub token: Option<&'runtime str>,
}Fields§
§http: &'runtime dyn Transport§probe: &'runtime dyn ProcessProbe§adapter: &'runtime dyn BackendAdapter§token: Option<&'runtime str>Implementations§
Source§impl OpenAiInference<'_>
impl OpenAiInference<'_>
pub async fn chat( &self, handle: &ServerState, input: &ChatInput, cancel: &CancellationToken, ) -> Result<ChatResult, BackendError>
pub async fn embed( &self, handle: &ServerState, model: &str, inputs: &[String], cancel: &CancellationToken, ) -> Result<EmbedResult, BackendError>
Auto Trait Implementations§
impl<'runtime> !RefUnwindSafe for OpenAiInference<'runtime>
impl<'runtime> !UnwindSafe for OpenAiInference<'runtime>
impl<'runtime> Forget for OpenAiInference<'runtime>
impl<'runtime> Freeze for OpenAiInference<'runtime>
impl<'runtime> Send for OpenAiInference<'runtime>
impl<'runtime> Sync for OpenAiInference<'runtime>
impl<'runtime> Unpin for OpenAiInference<'runtime>
impl<'runtime> UnsafeUnpin for OpenAiInference<'runtime>
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