pub struct ChatCompletionResponse {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub choices: Vec<Choice>,
pub usage: Option<OpenAiUsage>,
pub system_fingerprint: Option<String>,
}Fields§
§id: String§object: String§created: u64§model: String§choices: Vec<Choice>§usage: Option<OpenAiUsage>§system_fingerprint: Option<String>Implementations§
Source§impl ChatCompletionResponse
impl ChatCompletionResponse
Sourcepub fn content(&self) -> Option<&str>
pub fn content(&self) -> Option<&str>
Text content from the first choice’s message, if non-empty.
Sourcepub fn reasoning_content(&self) -> Option<&str>
pub fn reasoning_content(&self) -> Option<&str>
Reasoning content from the first choice’s message, if non-empty.
Sourcepub fn finish_reason(&self) -> Option<&FinishReason>
pub fn finish_reason(&self) -> Option<&FinishReason>
Finish reason from the first choice, if present.
Trait Implementations§
Source§impl Clone for ChatCompletionResponse
impl Clone for ChatCompletionResponse
Source§fn clone(&self) -> ChatCompletionResponse
fn clone(&self) -> ChatCompletionResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ChatCompletionResponse
impl Debug for ChatCompletionResponse
Source§impl Default for ChatCompletionResponse
impl Default for ChatCompletionResponse
Source§fn default() -> ChatCompletionResponse
fn default() -> ChatCompletionResponse
Returns the “default value” for a type. Read more
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
Source§impl From<&Response> for ChatCompletionResponse
impl From<&Response> for ChatCompletionResponse
Source§impl From<ChatCompletionResponse> for Response
impl From<ChatCompletionResponse> for Response
Source§fn from(resp: ChatCompletionResponse) -> Self
fn from(resp: ChatCompletionResponse) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ChatCompletionResponse
impl RefUnwindSafe for ChatCompletionResponse
impl Send for ChatCompletionResponse
impl Sync for ChatCompletionResponse
impl Unpin for ChatCompletionResponse
impl UnsafeUnpin 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