pub struct CreateChatCompletionResponse {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub choices: Vec<ChatCompletionChoice>,
pub usage: Option<ChatCompletionUsage>,
}
Expand description
The response returned by the OpenAI Chat Completions API.
Includes one or more chat-based completion choices and any usage statistics.
Fields§
§id: String
An identifier for this chat completion (e.g., “chatcmpl-xxxxxx”).
object: String
The object type, usually “chat.completion”.
created: u64
The creation time in epoch seconds.
model: String
The base model used for this request.
choices: Vec<ChatCompletionChoice>
A list of generated chat completion choices.
usage: Option<ChatCompletionUsage>
Token usage data (optional field).
Trait Implementations§
Source§impl Debug for CreateChatCompletionResponse
impl Debug for CreateChatCompletionResponse
Source§impl<'de> Deserialize<'de> for CreateChatCompletionResponse
impl<'de> Deserialize<'de> for CreateChatCompletionResponse
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 CreateChatCompletionResponse
impl RefUnwindSafe for CreateChatCompletionResponse
impl Send for CreateChatCompletionResponse
impl Sync for CreateChatCompletionResponse
impl Unpin for CreateChatCompletionResponse
impl UnwindSafe for CreateChatCompletionResponse
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