pub struct OpenAiChatResponse {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub choices: Vec<ChatChoice>,
pub usage: Option<ChatUsage>,
}Fields§
§id: String§object: String§created: u64§model: String§choices: Vec<ChatChoice>§usage: Option<ChatUsage>Implementations§
Source§impl OpenAiChatResponse
impl OpenAiChatResponse
Sourcepub fn first_message(&self) -> Option<ChatMessage>
pub fn first_message(&self) -> Option<ChatMessage>
Get the first choice’s message content, or an empty string if not available.
Trait Implementations§
Source§impl Debug for OpenAiChatResponse
impl Debug for OpenAiChatResponse
Source§impl<'de> Deserialize<'de> for OpenAiChatResponse
impl<'de> Deserialize<'de> for OpenAiChatResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<OpenAiChatResponse> for LlmOutput
impl From<OpenAiChatResponse> for LlmOutput
Source§fn from(response: OpenAiChatResponse) -> Self
fn from(response: OpenAiChatResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpenAiChatResponse
impl RefUnwindSafe for OpenAiChatResponse
impl Send for OpenAiChatResponse
impl Sync for OpenAiChatResponse
impl Unpin for OpenAiChatResponse
impl UnwindSafe for OpenAiChatResponse
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