pub struct OpenAiChatModel { /* private fields */ }
Implementations§
Source§impl OpenAiChatModel
impl OpenAiChatModel
pub fn new(config: OpenAiConfig) -> Result<Self>
Trait Implementations§
Source§impl LanguageModel for OpenAiChatModel
impl LanguageModel for OpenAiChatModel
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<LlmResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a complete response (non-streaming)
Source§fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<ChunkStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_stream<'life0, 'async_trait>(
&'life0 self,
request: LlmRequest,
) -> Pin<Box<dyn Future<Output = Result<ChunkStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a streaming response
Default implementation falls back to non-streaming generate()
Auto Trait Implementations§
impl Freeze for OpenAiChatModel
impl !RefUnwindSafe for OpenAiChatModel
impl Send for OpenAiChatModel
impl Sync for OpenAiChatModel
impl Unpin for OpenAiChatModel
impl !UnwindSafe for OpenAiChatModel
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