gproxy_protocol/wire/openai/realtime/
transcription_response.rs1use super::wire::present_nullable;
6use super::{AudioTranscription, NoiseReductionType, RealtimeAudioFormats};
7use crate::Rest;
8use serde::{Deserialize, Serialize};
9
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
12#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
13#[derive(gproxy_protocol_macros::DeclaredFields)]
14#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
15pub struct RealtimeTranscriptionSessionCreateResponse {
16 pub id: String,
17 pub object: String,
18 #[serde(rename = "type")]
19 pub type_: RealtimeTranscriptionSessionCreateResponseType,
20 #[serde(
21 default,
22 deserialize_with = "present_nullable",
23 skip_serializing_if = "Option::is_none"
24 )]
25 pub audio: Option<Option<RealtimeTranscriptionSessionCreateResponseAudio>>,
26 #[serde(
27 default,
28 deserialize_with = "present_nullable",
29 skip_serializing_if = "Option::is_none"
30 )]
31 pub expires_at: Option<Option<i64>>,
32 #[serde(
33 default,
34 deserialize_with = "present_nullable",
35 skip_serializing_if = "Option::is_none"
36 )]
37 pub include: Option<Option<Vec<RealtimeTranscriptionSessionCreateResponseIncludeItem>>>,
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 RealtimeTranscriptionSessionCreateResponseAudio {
48 #[serde(
49 default,
50 deserialize_with = "present_nullable",
51 skip_serializing_if = "Option::is_none"
52 )]
53 pub input: Option<Option<RealtimeTranscriptionSessionCreateResponseAudioInput>>,
54 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
55 pub rest: Rest,
56}
57
58#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
60#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
61#[derive(gproxy_protocol_macros::DeclaredFields)]
62#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
63pub struct RealtimeTranscriptionSessionCreateResponseAudioInput {
64 #[serde(
65 default,
66 deserialize_with = "present_nullable",
67 skip_serializing_if = "Option::is_none"
68 )]
69 pub format: Option<Option<RealtimeAudioFormats>>,
70 #[serde(
71 default,
72 deserialize_with = "present_nullable",
73 skip_serializing_if = "Option::is_none"
74 )]
75 pub noise_reduction:
76 Option<Option<RealtimeTranscriptionSessionCreateResponseAudioInputNoiseReduction>>,
77 #[serde(
78 default,
79 deserialize_with = "present_nullable",
80 skip_serializing_if = "Option::is_none"
81 )]
82 pub transcription: Option<Option<AudioTranscription>>,
83 #[serde(
84 default,
85 deserialize_with = "present_nullable",
86 skip_serializing_if = "Option::is_none"
87 )]
88 pub turn_detection: Option<Option<RealtimeTranscriptionSessionTurnDetection>>,
89 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
90 pub rest: Rest,
91}
92
93#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
95#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
96#[derive(gproxy_protocol_macros::DeclaredFields)]
97#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
98pub struct RealtimeTranscriptionSessionCreateResponseAudioInputNoiseReduction {
99 #[serde(rename = "type")]
100 #[serde(
101 default,
102 deserialize_with = "present_nullable",
103 skip_serializing_if = "Option::is_none"
104 )]
105 pub type_: Option<Option<NoiseReductionType>>,
106 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
107 pub rest: Rest,
108}
109
110#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
112#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
113#[derive(gproxy_protocol_macros::DeclaredFields)]
114#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
115pub struct RealtimeTranscriptionSessionTurnDetection {
116 #[serde(
117 default,
118 deserialize_with = "present_nullable",
119 skip_serializing_if = "Option::is_none"
120 )]
121 pub prefix_padding_ms: Option<Option<i64>>,
122 #[serde(
123 default,
124 deserialize_with = "present_nullable",
125 skip_serializing_if = "Option::is_none"
126 )]
127 pub silence_duration_ms: Option<Option<i64>>,
128 #[serde(
129 default,
130 deserialize_with = "present_nullable",
131 skip_serializing_if = "Option::is_none"
132 )]
133 pub threshold: Option<Option<serde_json::Number>>,
134 #[serde(rename = "type")]
135 #[serde(
136 default,
137 deserialize_with = "present_nullable",
138 skip_serializing_if = "Option::is_none"
139 )]
140 pub type_: Option<Option<String>>,
141 #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
142 pub rest: Rest,
143}
144
145#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
146#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
147#[derive(gproxy_protocol_macros::DeclaredFields)]
148#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
149pub enum RealtimeTranscriptionSessionCreateResponseType {
150 #[serde(rename = "transcription")]
151 Transcription,
152}
153
154#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
155#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
156#[derive(gproxy_protocol_macros::DeclaredFields)]
157#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
158pub enum RealtimeTranscriptionSessionCreateResponseIncludeItem {
159 #[serde(rename = "item.input_audio_transcription.logprobs")]
160 ItemInputAudioTranscriptionLogprobs,
161}