Struct langchain_rust::llm::openai::OpenAI
source · pub struct OpenAI { /* private fields */ }Implementations§
source§impl OpenAI
impl OpenAI
pub fn new(opt: CallOptions) -> Self
pub fn with_model<S: Into<String>>(self, model: S) -> Self
pub fn with_api_key<S: Into<String>>(self, api_key: S) -> Self
pub fn with_api_base<S: Into<String>>(self, api_base: S) -> Self
pub fn with_org_id<S: Into<String>>(self, org_id: S) -> Self
Trait Implementations§
source§impl LLM for OpenAI
impl LLM for OpenAI
fn generate<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 [Message]
) -> Pin<Box<dyn Future<Output = Result<GenerateResult, Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
prompt: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<String, Box<dyn Error>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn with_options(&mut self, options: CallOptions)
fn messages_to_string(&self, messages: &[Message]) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for OpenAI
impl Send for OpenAI
impl Sync for OpenAI
impl Unpin for OpenAI
impl !UnwindSafe for OpenAI
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