pub struct ChatCompletionResponse {
pub id: Option<String>,
pub request_id: Option<String>,
pub created: Option<u64>,
pub model: Option<String>,
pub choices: Option<Vec<Choice>>,
pub usage: Option<Usage>,
pub video_result: Option<Vec<VideoResultItem>>,
pub web_search: Option<Vec<WebSearchInfo>>,
pub content_filter: Option<Vec<ContentFilterInfo>>,
pub task_status: Option<TaskStatus>,
}Expand description
Successful business response (HTTP 200, application/json). Notes:
choicesis often a single element in non-stream mode unless explicitly requested otherwise.id/request_idare normalized toStringeven if the server returns numbers.usageis typically present only after completion (not during streaming).
Fields§
§id: Option<String>Task ID
request_id: Option<String>Request ID
created: Option<u64>Request created time, Unix timestamp (seconds)
model: Option<String>Model name
choices: Option<Vec<Choice>>Model response list
usage: Option<Usage>Token usage statistics at the end of the call
video_result: Option<Vec<VideoResultItem>>Video generation results
web_search: Option<Vec<WebSearchInfo>>Information related to web search, returned when using WebSearchToolSchema
content_filter: Option<Vec<ContentFilterInfo>>Content safety related information
task_status: Option<TaskStatus>Processing status of the task. One of: PROCESSING (处理中), SUCCESS (成功), FAIL (失败). Note: When PROCESSING, the final result needs to be retrieved via a subsequent query.
Implementations§
Source§impl ChatCompletionResponse
impl ChatCompletionResponse
pub fn id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
pub fn created(&self) -> Option<u64>
pub fn model(&self) -> Option<&str>
pub fn choices(&self) -> Option<&[Choice]>
pub fn usage(&self) -> Option<&Usage>
pub fn video_result(&self) -> Option<&[VideoResultItem]>
pub fn web_search(&self) -> Option<&[WebSearchInfo]>
pub fn content_filter(&self) -> Option<&[ContentFilterInfo]>
pub fn task_status(&self) -> Option<&TaskStatus>
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 · 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 ChatCompletionResponsewhere
ChatCompletionResponse: Default,
impl<'de> Deserialize<'de> for ChatCompletionResponsewhere
ChatCompletionResponse: Default,
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 Serialize for ChatCompletionResponse
impl Serialize for ChatCompletionResponse
Source§impl Validate for ChatCompletionResponse
impl Validate for ChatCompletionResponse
Source§impl<'v_a> ValidateArgs<'v_a> for ChatCompletionResponse
impl<'v_a> ValidateArgs<'v_a> for ChatCompletionResponse
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