Struct openai_rust::chat::ChatResponse
source · pub struct ChatResponse {
pub id: String,
pub created: u32,
pub choices: Vec<Choice>,
pub usage: Usage,
}
Expand description
This is the response of a chat.
It implements Display as a shortcut to easily extract the content.
let msg = &res.choices[0].message.content;
// or
let msg = res.to_string();
Fields§
§id: String
§created: u32
§choices: Vec<Choice>
§usage: Usage
Trait Implementations§
source§impl Clone for ChatResponse
impl Clone for ChatResponse
source§fn clone(&self) -> ChatResponse
fn clone(&self) -> ChatResponse
Returns a copy 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 moresource§impl Debug for ChatResponse
impl Debug for ChatResponse
source§impl<'de> Deserialize<'de> for ChatResponse
impl<'de> Deserialize<'de> for ChatResponse
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