pub struct ChatCompletionResponse {
pub id: String,
pub choices: Vec<CreateChatCompletionResponseChoicesInner>,
pub created: i32,
pub model: String,
pub service_tier: Option<Option<ServiceTier>>,
pub system_fingerprint: Option<String>,
pub object: Object,
pub usage: Option<Box<CompletionUsage>>,
}Expand description
CreateChatCompletionResponse : Represents a chat completion response returned by model, based on the provided input.
Fields§
§id: StringA unique identifier for the chat completion.
choices: Vec<CreateChatCompletionResponseChoicesInner>A list of chat completion choices. Can be more than one if n is greater than 1.
created: i32The Unix timestamp (in seconds) of when the chat completion was created.
model: StringThe model used for the chat completion.
service_tier: Option<Option<ServiceTier>>§system_fingerprint: Option<String>This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.
object: ObjectThe object type, which is always chat.completion.
usage: Option<Box<CompletionUsage>>Implementations§
Source§impl CreateChatCompletionResponse
impl CreateChatCompletionResponse
Sourcepub fn builder() -> CreateChatCompletionResponseBuilder
pub fn builder() -> CreateChatCompletionResponseBuilder
Create an instance of CreateChatCompletionResponse using the builder syntax
Source§impl CreateChatCompletionResponse
impl CreateChatCompletionResponse
Sourcepub fn new(
id: String,
choices: Vec<CreateChatCompletionResponseChoicesInner>,
created: i32,
model: String,
object: Object,
) -> CreateChatCompletionResponse
pub fn new( id: String, choices: Vec<CreateChatCompletionResponseChoicesInner>, created: i32, model: String, object: Object, ) -> CreateChatCompletionResponse
Represents a chat completion response returned by model, based on the provided input.
Trait Implementations§
Source§impl ChatCompletionResponseExt for CreateChatCompletionResponse
impl ChatCompletionResponseExt for CreateChatCompletionResponse
Source§fn tool_calls(&self) -> Vec<&ChatCompletionMessageToolCallsInner>
fn tool_calls(&self) -> Vec<&ChatCompletionMessageToolCallsInner>
Source§fn has_tool_calls(&self) -> bool
fn has_tool_calls(&self) -> bool
Source§fn first_choice(&self) -> Option<&CreateChatCompletionResponseChoicesInner>
fn first_choice(&self) -> Option<&CreateChatCompletionResponseChoicesInner>
Source§fn first_message(&self) -> Option<&ChatCompletionResponseMessage>
fn first_message(&self) -> Option<&ChatCompletionResponseMessage>
Source§fn is_refusal(&self) -> bool
fn is_refusal(&self) -> bool
Source§fn finish_reason(&self) -> Option<String>
fn finish_reason(&self) -> Option<String>
Source§impl Clone for CreateChatCompletionResponse
impl Clone for CreateChatCompletionResponse
Source§fn clone(&self) -> CreateChatCompletionResponse
fn clone(&self) -> CreateChatCompletionResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateChatCompletionResponse
impl Debug for CreateChatCompletionResponse
Source§impl Default for CreateChatCompletionResponse
impl Default for CreateChatCompletionResponse
Source§fn default() -> CreateChatCompletionResponse
fn default() -> CreateChatCompletionResponse
Source§impl<'de> Deserialize<'de> for CreateChatCompletionResponse
impl<'de> Deserialize<'de> for CreateChatCompletionResponse
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateChatCompletionResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CreateChatCompletionResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CreateChatCompletionResponse
impl PartialEq for CreateChatCompletionResponse
Source§fn eq(&self, other: &CreateChatCompletionResponse) -> bool
fn eq(&self, other: &CreateChatCompletionResponse) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CreateChatCompletionResponse
impl Serialize for CreateChatCompletionResponse
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CreateChatCompletionResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.