openai_struct/models/
realtime_response.rs

1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub RealtimeResponse : The response resource.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct RealtimeResponse {
18    /// Which conversation the response is added to, determined by the `conversation` field in the `response.create` event. If `auto`, the response will be added to the default conversation and the value of `conversation_id` will be an id like `conv_1234`. If `none`, the response will not be added to any conversation and the value of `conversation_id` will be `null`. If responses are being triggered by server VAD, the response will be added to the default conversation, thus the `conversation_id` will be an id like `conv_1234`.
19    #[serde(rename = "conversation_id")]
20    pub conversation_id: Option<String>,
21    /// The unique ID of the response.
22    #[serde(rename = "id")]
23    pub id: Option<String>,
24    /// Maximum number of output tokens for a single assistant response, inclusive of tool calls, that was used in this response.
25    #[serde(rename = "max_output_tokens")]
26    pub max_output_tokens: Option<Value>,
27    #[serde(rename = "metadata")]
28    pub metadata: Option<crate::models::Metadata>,
29    /// The set of modalities the model used to respond. If there are multiple modalities, the model will pick one, for example if `modalities` is `[\"text\", \"audio\"]`, the model could be responding in either text or audio.
30    #[serde(rename = "modalities")]
31    pub modalities: Option<Vec<String>>,
32    /// The object type, must be `realtime.response`.
33    #[serde(rename = "object")]
34    pub object: Option<String>,
35    /// The list of output items generated by the response.
36    #[serde(rename = "output")]
37    pub output: Option<Vec<crate::models::RealtimeConversationItem>>,
38    /// The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.
39    #[serde(rename = "output_audio_format")]
40    pub output_audio_format: Option<String>,
41    /// The final status of the response (`completed`, `cancelled`, `failed`, or  `incomplete`).
42    #[serde(rename = "status")]
43    pub status: Option<String>,
44    #[serde(rename = "status_details")]
45    pub status_details: Option<crate::models::RealtimeResponseStatusDetails>,
46    /// Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8.
47    #[serde(rename = "temperature")]
48    pub temperature: Option<f32>,
49    #[serde(rename = "usage")]
50    pub usage: Option<crate::models::RealtimeResponseUsage>,
51    /// The voice the model used to respond. Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `onyx`, `nova`, `sage`, `shimmer`, and `verse`.
52    #[serde(rename = "voice")]
53    pub voice: Option<crate::models::VoiceIdsShared>,
54}