openai_struct/models/realtime_server_event_input_audio_buffer_speech_started.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 RealtimeServerEventInputAudioBufferSpeechStarted : Sent by the server when in `server_vad` mode to indicate that speech has been detected in the audio buffer. This can happen any time audio is added to the buffer (unless speech is already detected). The client may want to use this event to interrupt audio playback or provide visual feedback to the user. The client should expect to receive a `input_audio_buffer.speech_stopped` event when speech stops. The `item_id` property is the ID of the user message item that will be created when speech stops and will also be included in the `input_audio_buffer.speech_stopped` event (unless the client manually commits the audio buffer during VAD activation).
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16#[derive(Debug, Serialize, Deserialize)]
17pub struct RealtimeServerEventInputAudioBufferSpeechStarted {
18 /// Milliseconds from the start of all audio written to the buffer during the session when speech was first detected. This will correspond to the beginning of audio sent to the model, and thus includes the `prefix_padding_ms` configured in the Session.
19 #[serde(rename = "audio_start_ms")]
20 pub audio_start_ms: i32,
21 /// The unique ID of the server event.
22 #[serde(rename = "event_id")]
23 pub event_id: String,
24 /// The ID of the user message item that will be created when speech stops.
25 #[serde(rename = "item_id")]
26 pub item_id: String,
27 /// The event type, must be `input_audio_buffer.speech_started`.
28 #[serde(rename = "type")]
29 pub _type: String,
30}