pub struct OpenAiClient {
pub http: Client,
pub config: Arc<Config>,
}
Expand description
Wrapper around the OpenAI HTTP client.
Fields§
§http: Client
§config: Arc<Config>
Implementations§
Source§impl OpenAiClient
impl OpenAiClient
Sourcepub async fn chat_completion(
&self,
req: ChatRequest,
) -> Result<ChatResponse, AgentError>
pub async fn chat_completion( &self, req: ChatRequest, ) -> Result<ChatResponse, AgentError>
Send a chat completion request.
Auto Trait Implementations§
impl Freeze for OpenAiClient
impl !RefUnwindSafe for OpenAiClient
impl Send for OpenAiClient
impl Sync for OpenAiClient
impl Unpin for OpenAiClient
impl !UnwindSafe for OpenAiClient
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