pub struct Response {
pub id: String,
pub choices: Vec<Choice>,
pub created: u64,
pub model: String,
pub service_tier: Option<ServiceTier>,
pub system_fingerprint: Option<String>,
pub object: String,
pub usage: Usage,
}Fields§
§id: StringA unique identifier for the chat completion.
choices: Vec<Choice>A list of chat completion choices. Can be more than one if n is greater than 1.
created: u64The Unix timestamp (in seconds) of when the chat completion was created.
model: StringThe model used for the chat completion.
service_tier: Option<ServiceTier>The service tier used for processing the request. This field is only included if the service_tier parameter is specified in the request.
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: StringThe object type, which is always chat.completion
usage: UsageUsage statistics for the completion request.
Implementations§
Source§impl Response
impl Response
pub fn first_assistant_message(&self) -> Option<&Message>
pub fn first_assistant_message_text(&self) -> Option<String>
pub fn first_assistant_message_reasoning_text(&self) -> Option<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
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
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
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