pub struct OpenAIProvider { /* private fields */ }Expand description
OpenAI provider implementation
Implementations§
Source§impl OpenAIProvider
impl OpenAIProvider
Sourcepub fn new(
config: OpenAIConfig,
default_params: DefaultLLMParams,
) -> LlmResult<Self>
pub fn new( config: OpenAIConfig, default_params: DefaultLLMParams, ) -> LlmResult<Self>
Create a new OpenAI provider instance
§Errors
Returns LlmError::ConfigurationError if:
- API key is missing or invalid
- Provider configuration validation fails
- HTTP client initialization fails
Trait Implementations§
Source§impl Debug for OpenAIProvider
impl Debug for OpenAIProvider
Source§impl LlmProvider for OpenAIProvider
impl LlmProvider for OpenAIProvider
Source§fn execute_llm<'life0, 'async_trait>(
&'life0 self,
request: UnifiedLLMRequest,
_current_tool_round: Option<ToolCallingRound>,
config: Option<RequestConfig>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_llm<'life0, 'async_trait>(
&'life0 self,
request: UnifiedLLMRequest,
_current_tool_round: Option<ToolCallingRound>,
config: Option<RequestConfig>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute an LLM request and return the response. Read more
Source§fn execute_structured_llm<'life0, 'async_trait>(
&'life0 self,
request: UnifiedLLMRequest,
current_tool_round: Option<ToolCallingRound>,
schema: Value,
config: Option<RequestConfig>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_structured_llm<'life0, 'async_trait>(
&'life0 self,
request: UnifiedLLMRequest,
current_tool_round: Option<ToolCallingRound>,
schema: Value,
config: Option<RequestConfig>,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute an LLM request with structured JSON output. Read more
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider’s identifier. Read more
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