1use super::wire::present_nullable;
6use crate::Rest;
7use serde::{Deserialize, Serialize};
8
9#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
11#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
12#[derive(gproxy_protocol_macros::DeclaredFields)]
13#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
14pub struct InputAudioBufferClearedEvent {
15 pub event_id: String,
16 #[serde(rename = "type")]
17 pub type_: InputAudioBufferClearedEventType,
18 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
19 pub rest: Rest,
20}
21
22#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
24#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
25#[derive(gproxy_protocol_macros::DeclaredFields)]
26#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
27pub struct InputAudioBufferCommittedEvent {
28 pub event_id: String,
29 pub item_id: String,
30 #[serde(rename = "type")]
31 pub type_: InputAudioBufferCommittedEventType,
32 #[serde(
33 default,
34 deserialize_with = "present_nullable",
35 skip_serializing_if = "Option::is_none"
36 )]
37 pub previous_item_id: Option<Option<String>>,
38 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
39 pub rest: Rest,
40}
41
42#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
44#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
45#[derive(gproxy_protocol_macros::DeclaredFields)]
46#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
47pub struct InputAudioBufferDtmfEventReceivedEvent {
48 pub event: String,
49 pub received_at: i64,
50 #[serde(rename = "type")]
51 pub type_: InputAudioBufferDtmfEventReceivedEventType,
52 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
53 pub rest: Rest,
54}
55
56#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
58#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
59#[derive(gproxy_protocol_macros::DeclaredFields)]
60#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
61pub struct InputAudioBufferSpeechStartedEvent {
62 pub audio_start_ms: i64,
63 pub event_id: String,
64 pub item_id: String,
65 #[serde(rename = "type")]
66 pub type_: InputAudioBufferSpeechStartedEventType,
67 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
68 pub rest: Rest,
69}
70
71#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
73#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
74#[derive(gproxy_protocol_macros::DeclaredFields)]
75#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
76pub struct InputAudioBufferSpeechStoppedEvent {
77 pub audio_end_ms: i64,
78 pub event_id: String,
79 pub item_id: String,
80 #[serde(rename = "type")]
81 pub type_: InputAudioBufferSpeechStoppedEventType,
82 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
83 pub rest: Rest,
84}
85
86#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
88#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
89#[derive(gproxy_protocol_macros::DeclaredFields)]
90#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
91pub struct ResponseAudioDeltaEvent {
92 pub content_index: i64,
93 pub delta: String,
94 pub event_id: String,
95 pub item_id: String,
96 pub output_index: i64,
97 pub response_id: String,
98 #[serde(rename = "type")]
99 pub type_: ResponseAudioDeltaEventType,
100 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
101 pub rest: Rest,
102}
103
104#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
106#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
107#[derive(gproxy_protocol_macros::DeclaredFields)]
108#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
109pub struct ResponseAudioDoneEvent {
110 pub content_index: i64,
111 pub event_id: String,
112 pub item_id: String,
113 pub output_index: i64,
114 pub response_id: String,
115 #[serde(rename = "type")]
116 pub type_: ResponseAudioDoneEventType,
117 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
118 pub rest: Rest,
119}
120
121#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
123#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
124#[derive(gproxy_protocol_macros::DeclaredFields)]
125#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
126pub struct ResponseAudioTranscriptDeltaEvent {
127 pub content_index: i64,
128 pub delta: String,
129 pub event_id: String,
130 pub item_id: String,
131 pub output_index: i64,
132 pub response_id: String,
133 #[serde(rename = "type")]
134 pub type_: ResponseAudioTranscriptDeltaEventType,
135 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
136 pub rest: Rest,
137}
138
139#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
141#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
142#[derive(gproxy_protocol_macros::DeclaredFields)]
143#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
144pub struct ResponseAudioTranscriptDoneEvent {
145 pub content_index: i64,
146 pub event_id: String,
147 pub item_id: String,
148 pub output_index: i64,
149 pub response_id: String,
150 pub transcript: String,
151 #[serde(rename = "type")]
152 pub type_: ResponseAudioTranscriptDoneEventType,
153 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
154 pub rest: Rest,
155}
156
157#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
159#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
160#[derive(gproxy_protocol_macros::DeclaredFields)]
161#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
162pub struct InputAudioBufferTimeoutTriggered {
163 pub audio_end_ms: i64,
164 pub audio_start_ms: i64,
165 pub event_id: String,
166 pub item_id: String,
167 #[serde(rename = "type")]
168 pub type_: InputAudioBufferTimeoutTriggeredType,
169 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
170 pub rest: Rest,
171}
172
173#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
174#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
175#[derive(gproxy_protocol_macros::DeclaredFields)]
176#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
177pub enum InputAudioBufferClearedEventType {
178 #[serde(rename = "input_audio_buffer.cleared")]
179 InputAudioBufferCleared,
180}
181
182#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
183#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
184#[derive(gproxy_protocol_macros::DeclaredFields)]
185#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
186pub enum InputAudioBufferCommittedEventType {
187 #[serde(rename = "input_audio_buffer.committed")]
188 InputAudioBufferCommitted,
189}
190
191#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
192#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
193#[derive(gproxy_protocol_macros::DeclaredFields)]
194#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
195pub enum InputAudioBufferDtmfEventReceivedEventType {
196 #[serde(rename = "input_audio_buffer.dtmf_event_received")]
197 InputAudioBufferDtmfEventReceived,
198}
199
200#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
201#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
202#[derive(gproxy_protocol_macros::DeclaredFields)]
203#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
204pub enum InputAudioBufferSpeechStartedEventType {
205 #[serde(rename = "input_audio_buffer.speech_started")]
206 InputAudioBufferSpeechStarted,
207}
208
209#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
210#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
211#[derive(gproxy_protocol_macros::DeclaredFields)]
212#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
213pub enum InputAudioBufferSpeechStoppedEventType {
214 #[serde(rename = "input_audio_buffer.speech_stopped")]
215 InputAudioBufferSpeechStopped,
216}
217
218#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
219#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
220#[derive(gproxy_protocol_macros::DeclaredFields)]
221#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
222pub enum ResponseAudioDeltaEventType {
223 #[serde(rename = "response.output_audio.delta")]
224 ResponseOutputAudioDelta,
225}
226
227#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
228#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
229#[derive(gproxy_protocol_macros::DeclaredFields)]
230#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
231pub enum ResponseAudioDoneEventType {
232 #[serde(rename = "response.output_audio.done")]
233 ResponseOutputAudioDone,
234}
235
236#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
237#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
238#[derive(gproxy_protocol_macros::DeclaredFields)]
239#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
240pub enum ResponseAudioTranscriptDeltaEventType {
241 #[serde(rename = "response.output_audio_transcript.delta")]
242 ResponseOutputAudioTranscriptDelta,
243}
244
245#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
246#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
247#[derive(gproxy_protocol_macros::DeclaredFields)]
248#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
249pub enum ResponseAudioTranscriptDoneEventType {
250 #[serde(rename = "response.output_audio_transcript.done")]
251 ResponseOutputAudioTranscriptDone,
252}
253
254#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
255#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
256#[derive(gproxy_protocol_macros::DeclaredFields)]
257#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
258pub enum InputAudioBufferTimeoutTriggeredType {
259 #[serde(rename = "input_audio_buffer.timeout_triggered")]
260 InputAudioBufferTimeoutTriggered,
261}