pub struct OpenAiProvider { /* private fields */ }Expand description
OpenAI provider implementation
Implementations§
Trait Implementations§
Source§impl LlmProviderTrait for OpenAiProvider
impl LlmProviderTrait for OpenAiProvider
Source§fn generate_completion<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
max_tokens: Option<usize>,
temperature: Option<f32>,
top_p: Option<f32>,
stop_sequences: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate_completion<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
max_tokens: Option<usize>,
temperature: Option<f32>,
top_p: Option<f32>,
stop_sequences: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate text completion
Source§fn generate_chat_completion<'life0, 'async_trait>(
&'life0 self,
messages: Vec<ChatMessage>,
max_tokens: Option<usize>,
temperature: Option<f32>,
top_p: Option<f32>,
stop_sequences: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_chat_completion<'life0, 'async_trait>(
&'life0 self,
messages: Vec<ChatMessage>,
max_tokens: Option<usize>,
temperature: Option<f32>,
top_p: Option<f32>,
stop_sequences: Option<Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate chat completion
Source§fn get_available_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_available_models<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get available models
Source§fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Check if provider is available
Source§fn max_context_length(&self) -> usize
fn max_context_length(&self) -> usize
Get maximum context length
Auto Trait Implementations§
impl Freeze for OpenAiProvider
impl !RefUnwindSafe for OpenAiProvider
impl Send for OpenAiProvider
impl Sync for OpenAiProvider
impl Unpin for OpenAiProvider
impl !UnwindSafe for OpenAiProvider
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