pub struct OpenAIProvider { /* private fields */ }Implementations§
Source§impl OpenAIProvider
impl OpenAIProvider
pub fn new(model: impl Into<String>) -> Self
pub fn new_with_config(config: OpenAIConfig, model: impl Into<String>) -> Self
Trait Implementations§
Source§impl Provider for OpenAIProvider
impl Provider for OpenAIProvider
fn name(&self) -> &str
fn model(&self) -> &str
fn set_model(&mut self, model: String)
fn available_models(&self) -> Vec<String>
fn context_window(&self) -> u32
fn fetch_context_window( &self, ) -> Pin<Box<dyn Future<Output = Result<u32>> + Send + '_>>
fn fetch_models( &self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + '_>>
fn stream( &self, messages: &[Message], system: Option<&str>, tools: &[ToolDefinition], max_tokens: u32, thinking_budget: u32, ) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<StreamEvent>>> + Send + '_>>
fn stream_with_model( &self, model: &str, messages: &[Message], system: Option<&str>, tools: &[ToolDefinition], max_tokens: u32, _thinking_budget: u32, ) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<StreamEvent>>> + Send + '_>>
fn supports_server_compaction(&self) -> bool
fn supports_vision(&self) -> bool
Auto Trait Implementations§
impl !Freeze for OpenAIProvider
impl !RefUnwindSafe for OpenAIProvider
impl Send for OpenAIProvider
impl Sync for OpenAIProvider
impl Unpin for OpenAIProvider
impl UnsafeUnpin 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
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