pub struct OpenAIProvider { /* private fields */ }
Expand description
Provider implementation for OpenAI’s API (GPT models)
Implementations§
Source§impl OpenAIProvider
impl OpenAIProvider
Sourcepub fn new(
api_key: String,
model: String,
supported_tasks: HashMap<String, TaskDefinition>,
enabled: bool,
) -> Self
pub fn new( api_key: String, model: String, supported_tasks: HashMap<String, TaskDefinition>, enabled: bool, ) -> Self
Creates a new OpenAI provider instance
§Parameters
api_key
- OpenAI API keymodel
- Default model to use (e.g. “gpt-4-turbo”)supported_tasks
- Map of tasks this provider supportsenabled
- Whether this provider is enabled
Trait Implementations§
Source§impl LlmProvider for OpenAIProvider
impl LlmProvider for OpenAIProvider
Source§fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LlmRequest,
) -> Pin<Box<dyn Future<Output = LlmResult<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 LlmRequest,
) -> Pin<Box<dyn Future<Output = LlmResult<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_supported_tasks(&self) -> &HashMap<String, TaskDefinition>
fn get_supported_tasks(&self) -> &HashMap<String, TaskDefinition>
Returns supported tasks for this provider
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Returns whether this provider is enabled
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