pub struct OpenAIChatResponseWrapper {
pub response: OpenAIChatResponse,
pub converted_usage: Option<Usage>,
pub converted_metadata: Metadata,
pub converted_tool_calls: Option<Vec<ToolCall>>,
}Expand description
Wrapper for OpenAI chat response that includes converted generic data
Fields§
§response: OpenAIChatResponse§converted_usage: Option<Usage>§converted_metadata: Metadata§converted_tool_calls: Option<Vec<ToolCall>>Implementations§
Source§impl OpenAIChatResponseWrapper
impl OpenAIChatResponseWrapper
pub fn new(response: OpenAIChatResponse, request_id: Option<String>) -> Self
Trait Implementations§
Source§impl ChatResponse for OpenAIChatResponseWrapper
impl ChatResponse for OpenAIChatResponseWrapper
Source§fn finish_reason(&self) -> Option<FinishReason>
fn finish_reason(&self) -> Option<FinishReason>
Get the reason why generation finished
Source§fn as_message(&self) -> Message
fn as_message(&self) -> Message
Convert response to a Message for conversation history
Source§impl Clone for OpenAIChatResponseWrapper
impl Clone for OpenAIChatResponseWrapper
Source§fn clone(&self) -> OpenAIChatResponseWrapper
fn clone(&self) -> OpenAIChatResponseWrapper
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OpenAIChatResponseWrapper
impl RefUnwindSafe for OpenAIChatResponseWrapper
impl Send for OpenAIChatResponseWrapper
impl Sync for OpenAIChatResponseWrapper
impl Unpin for OpenAIChatResponseWrapper
impl UnwindSafe for OpenAIChatResponseWrapper
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