openai_struct/models/realtime_session_create_request.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 RealtimeSessionCreateRequest : Realtime session object configuration.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct RealtimeSessionCreateRequest {
18 /// The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, single channel (mono), and little-endian byte order.
19 #[serde(rename = "input_audio_format")]
20 pub input_audio_format: Option<String>,
21 #[serde(rename = "input_audio_noise_reduction")]
22 pub input_audio_noise_reduction: Option<crate::models::RealtimeSessionInputAudioNoiseReduction>,
23 #[serde(rename = "input_audio_transcription")]
24 pub input_audio_transcription: Option<crate::models::RealtimeSessionInputAudioTranscription>,
25 /// The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session.
26 #[serde(rename = "instructions")]
27 pub instructions: Option<String>,
28 /// Maximum number of output tokens for a single assistant response, inclusive of tool calls. Provide an integer between 1 and 4096 to limit output tokens, or `inf` for the maximum available tokens for a given model. Defaults to `inf`.
29 #[serde(rename = "max_response_output_tokens")]
30 pub max_response_output_tokens: Option<Value>,
31 /// The set of modalities the model can respond with. To disable audio, set this to [\"text\"].
32 #[serde(rename = "modalities")]
33 pub modalities: Option<Value>,
34 /// The Realtime model used for this session.
35 #[serde(rename = "model")]
36 pub model: Option<String>,
37 /// The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. For `pcm16`, output audio is sampled at a rate of 24kHz.
38 #[serde(rename = "output_audio_format")]
39 pub output_audio_format: Option<String>,
40 /// Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance.
41 #[serde(rename = "temperature")]
42 pub temperature: Option<f32>,
43 /// How the model chooses tools. Options are `auto`, `none`, `required`, or specify a function.
44 #[serde(rename = "tool_choice")]
45 pub tool_choice: Option<String>,
46 /// Tools (functions) available to the model.
47 #[serde(rename = "tools")]
48 pub tools: Option<Vec<crate::models::RealtimeResponseCreateParamsTools>>,
49 #[serde(rename = "turn_detection")]
50 pub turn_detection: Option<crate::models::RealtimeSessionTurnDetection>,
51 /// The voice the model uses to respond. Voice cannot be changed during the session once the model has responded with audio at least once. 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}