pub struct ChatCompletionResponse {
pub id: String,
pub object: String,
pub created: i64,
pub model: String,
pub choices: Vec<ChatCompletionChoice>,
pub usage: Usage,
pub system_fingerprint: Option<String>,
pub headers: Option<HashMap<String, String>>,
}
Expand description
Represents a chat completion response.
Fields§
§id: String
Unique identifier for the response.
object: String
Object type.
created: i64
Creation timestamp.
model: String
Model used for the completion.
choices: Vec<ChatCompletionChoice>
List of choices in the response.
usage: Usage
Usage information.
system_fingerprint: Option<String>
Optional system fingerprint.
headers: Option<HashMap<String, String>>
Optional headers in the response.
Implementations§
Source§impl ChatCompletionResponse
impl ChatCompletionResponse
Sourcepub fn get_choice(&self) -> String
pub fn get_choice(&self) -> String
Gets the content of the first choice.
Trait Implementations§
Source§impl Debug for ChatCompletionResponse
impl Debug for ChatCompletionResponse
Source§impl<'de> Deserialize<'de> for ChatCompletionResponse
impl<'de> Deserialize<'de> for ChatCompletionResponse
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
Auto Trait Implementations§
impl Freeze for ChatCompletionResponse
impl RefUnwindSafe for ChatCompletionResponse
impl Send for ChatCompletionResponse
impl Sync for ChatCompletionResponse
impl Unpin for ChatCompletionResponse
impl UnwindSafe for ChatCompletionResponse
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