@azure/ai-voicelive 1.0.0-alpha.20251117.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +358 -0
  3. package/dist/browser/auth/credentialHandler.d.ts +43 -0
  4. package/dist/browser/auth/credentialHandler.js +147 -0
  5. package/dist/browser/auth/credentialHandler.js.map +1 -0
  6. package/dist/browser/errors/connectionErrors.d.ts +68 -0
  7. package/dist/browser/errors/connectionErrors.js +136 -0
  8. package/dist/browser/errors/connectionErrors.js.map +1 -0
  9. package/dist/browser/errors/index.d.ts +2 -0
  10. package/dist/browser/errors/index.js +4 -0
  11. package/dist/browser/errors/index.js.map +1 -0
  12. package/dist/browser/handlers/sessionHandlers.d.ts +250 -0
  13. package/dist/browser/handlers/sessionHandlers.js +4 -0
  14. package/dist/browser/handlers/sessionHandlers.js.map +1 -0
  15. package/dist/browser/handlers/subscriptionManager.d.ts +54 -0
  16. package/dist/browser/handlers/subscriptionManager.js +250 -0
  17. package/dist/browser/handlers/subscriptionManager.js.map +1 -0
  18. package/dist/browser/index.d.ts +7 -0
  19. package/dist/browser/index.js +12 -0
  20. package/dist/browser/index.js.map +1 -0
  21. package/dist/browser/logger.d.ts +2 -0
  22. package/dist/browser/logger.js +5 -0
  23. package/dist/browser/logger.js.map +1 -0
  24. package/dist/browser/models/index.d.ts +2 -0
  25. package/dist/browser/models/index.js +4 -0
  26. package/dist/browser/models/index.js.map +1 -0
  27. package/dist/browser/models/models.d.ts +2154 -0
  28. package/dist/browser/models/models.js +2251 -0
  29. package/dist/browser/models/models.js.map +1 -0
  30. package/dist/browser/package.json +3 -0
  31. package/dist/browser/protocol/messageParser.d.ts +42 -0
  32. package/dist/browser/protocol/messageParser.js +150 -0
  33. package/dist/browser/protocol/messageParser.js.map +1 -0
  34. package/dist/browser/voiceLiveClient.d.ts +65 -0
  35. package/dist/browser/voiceLiveClient.js +81 -0
  36. package/dist/browser/voiceLiveClient.js.map +1 -0
  37. package/dist/browser/voiceLiveSession.d.ts +138 -0
  38. package/dist/browser/voiceLiveSession.js +429 -0
  39. package/dist/browser/voiceLiveSession.js.map +1 -0
  40. package/dist/browser/websocket/connectionManager.d.ts +88 -0
  41. package/dist/browser/websocket/connectionManager.js +183 -0
  42. package/dist/browser/websocket/connectionManager.js.map +1 -0
  43. package/dist/browser/websocket/websocketBrowser.d.ts +26 -0
  44. package/dist/browser/websocket/websocketBrowser.js +175 -0
  45. package/dist/browser/websocket/websocketBrowser.js.map +1 -0
  46. package/dist/browser/websocket/websocketFactory.d.ts +23 -0
  47. package/dist/browser/websocket/websocketFactory.js +80 -0
  48. package/dist/browser/websocket/websocketFactory.js.map +1 -0
  49. package/dist/browser/websocket/websocketLike.d.ts +78 -0
  50. package/dist/browser/websocket/websocketLike.js +13 -0
  51. package/dist/browser/websocket/websocketLike.js.map +1 -0
  52. package/dist/browser/websocket/websocketNode.d.ts +26 -0
  53. package/dist/browser/websocket/websocketNode.js +180 -0
  54. package/dist/browser/websocket/websocketNode.js.map +1 -0
  55. package/dist/commonjs/auth/credentialHandler.d.ts +43 -0
  56. package/dist/commonjs/auth/credentialHandler.js +151 -0
  57. package/dist/commonjs/auth/credentialHandler.js.map +1 -0
  58. package/dist/commonjs/errors/connectionErrors.d.ts +68 -0
  59. package/dist/commonjs/errors/connectionErrors.js +146 -0
  60. package/dist/commonjs/errors/connectionErrors.js.map +1 -0
  61. package/dist/commonjs/errors/index.d.ts +2 -0
  62. package/dist/commonjs/errors/index.js +7 -0
  63. package/dist/commonjs/errors/index.js.map +1 -0
  64. package/dist/commonjs/handlers/sessionHandlers.d.ts +250 -0
  65. package/dist/commonjs/handlers/sessionHandlers.js +5 -0
  66. package/dist/commonjs/handlers/sessionHandlers.js.map +1 -0
  67. package/dist/commonjs/handlers/subscriptionManager.d.ts +54 -0
  68. package/dist/commonjs/handlers/subscriptionManager.js +255 -0
  69. package/dist/commonjs/handlers/subscriptionManager.js.map +1 -0
  70. package/dist/commonjs/index.d.ts +7 -0
  71. package/dist/commonjs/index.js +45 -0
  72. package/dist/commonjs/index.js.map +1 -0
  73. package/dist/commonjs/logger.d.ts +2 -0
  74. package/dist/commonjs/logger.js +8 -0
  75. package/dist/commonjs/logger.js.map +1 -0
  76. package/dist/commonjs/models/index.d.ts +2 -0
  77. package/dist/commonjs/models/index.js +27 -0
  78. package/dist/commonjs/models/index.js.map +1 -0
  79. package/dist/commonjs/models/models.d.ts +2154 -0
  80. package/dist/commonjs/models/models.js +2463 -0
  81. package/dist/commonjs/models/models.js.map +1 -0
  82. package/dist/commonjs/package.json +3 -0
  83. package/dist/commonjs/protocol/messageParser.d.ts +42 -0
  84. package/dist/commonjs/protocol/messageParser.js +154 -0
  85. package/dist/commonjs/protocol/messageParser.js.map +1 -0
  86. package/dist/commonjs/tsdoc-metadata.json +11 -0
  87. package/dist/commonjs/voiceLiveClient.d.ts +65 -0
  88. package/dist/commonjs/voiceLiveClient.js +85 -0
  89. package/dist/commonjs/voiceLiveClient.js.map +1 -0
  90. package/dist/commonjs/voiceLiveSession.d.ts +138 -0
  91. package/dist/commonjs/voiceLiveSession.js +433 -0
  92. package/dist/commonjs/voiceLiveSession.js.map +1 -0
  93. package/dist/commonjs/websocket/connectionManager.d.ts +88 -0
  94. package/dist/commonjs/websocket/connectionManager.js +187 -0
  95. package/dist/commonjs/websocket/connectionManager.js.map +1 -0
  96. package/dist/commonjs/websocket/websocketBrowser.d.ts +26 -0
  97. package/dist/commonjs/websocket/websocketBrowser.js +179 -0
  98. package/dist/commonjs/websocket/websocketBrowser.js.map +1 -0
  99. package/dist/commonjs/websocket/websocketFactory.d.ts +23 -0
  100. package/dist/commonjs/websocket/websocketFactory.js +86 -0
  101. package/dist/commonjs/websocket/websocketFactory.js.map +1 -0
  102. package/dist/commonjs/websocket/websocketLike.d.ts +78 -0
  103. package/dist/commonjs/websocket/websocketLike.js +16 -0
  104. package/dist/commonjs/websocket/websocketLike.js.map +1 -0
  105. package/dist/commonjs/websocket/websocketNode.d.ts +26 -0
  106. package/dist/commonjs/websocket/websocketNode.js +185 -0
  107. package/dist/commonjs/websocket/websocketNode.js.map +1 -0
  108. package/dist/esm/auth/credentialHandler.d.ts +43 -0
  109. package/dist/esm/auth/credentialHandler.js +147 -0
  110. package/dist/esm/auth/credentialHandler.js.map +1 -0
  111. package/dist/esm/errors/connectionErrors.d.ts +68 -0
  112. package/dist/esm/errors/connectionErrors.js +136 -0
  113. package/dist/esm/errors/connectionErrors.js.map +1 -0
  114. package/dist/esm/errors/index.d.ts +2 -0
  115. package/dist/esm/errors/index.js +4 -0
  116. package/dist/esm/errors/index.js.map +1 -0
  117. package/dist/esm/handlers/sessionHandlers.d.ts +250 -0
  118. package/dist/esm/handlers/sessionHandlers.js +4 -0
  119. package/dist/esm/handlers/sessionHandlers.js.map +1 -0
  120. package/dist/esm/handlers/subscriptionManager.d.ts +54 -0
  121. package/dist/esm/handlers/subscriptionManager.js +250 -0
  122. package/dist/esm/handlers/subscriptionManager.js.map +1 -0
  123. package/dist/esm/index.d.ts +7 -0
  124. package/dist/esm/index.js +12 -0
  125. package/dist/esm/index.js.map +1 -0
  126. package/dist/esm/logger.d.ts +2 -0
  127. package/dist/esm/logger.js +5 -0
  128. package/dist/esm/logger.js.map +1 -0
  129. package/dist/esm/models/index.d.ts +2 -0
  130. package/dist/esm/models/index.js +4 -0
  131. package/dist/esm/models/index.js.map +1 -0
  132. package/dist/esm/models/models.d.ts +2154 -0
  133. package/dist/esm/models/models.js +2251 -0
  134. package/dist/esm/models/models.js.map +1 -0
  135. package/dist/esm/package.json +3 -0
  136. package/dist/esm/protocol/messageParser.d.ts +42 -0
  137. package/dist/esm/protocol/messageParser.js +150 -0
  138. package/dist/esm/protocol/messageParser.js.map +1 -0
  139. package/dist/esm/voiceLiveClient.d.ts +65 -0
  140. package/dist/esm/voiceLiveClient.js +81 -0
  141. package/dist/esm/voiceLiveClient.js.map +1 -0
  142. package/dist/esm/voiceLiveSession.d.ts +138 -0
  143. package/dist/esm/voiceLiveSession.js +429 -0
  144. package/dist/esm/voiceLiveSession.js.map +1 -0
  145. package/dist/esm/websocket/connectionManager.d.ts +88 -0
  146. package/dist/esm/websocket/connectionManager.js +183 -0
  147. package/dist/esm/websocket/connectionManager.js.map +1 -0
  148. package/dist/esm/websocket/websocketBrowser.d.ts +26 -0
  149. package/dist/esm/websocket/websocketBrowser.js +175 -0
  150. package/dist/esm/websocket/websocketBrowser.js.map +1 -0
  151. package/dist/esm/websocket/websocketFactory.d.ts +23 -0
  152. package/dist/esm/websocket/websocketFactory.js +80 -0
  153. package/dist/esm/websocket/websocketFactory.js.map +1 -0
  154. package/dist/esm/websocket/websocketLike.d.ts +78 -0
  155. package/dist/esm/websocket/websocketLike.js +13 -0
  156. package/dist/esm/websocket/websocketLike.js.map +1 -0
  157. package/dist/esm/websocket/websocketNode.d.ts +26 -0
  158. package/dist/esm/websocket/websocketNode.js +180 -0
  159. package/dist/esm/websocket/websocketNode.js.map +1 -0
  160. package/dist/react-native/auth/credentialHandler.d.ts +43 -0
  161. package/dist/react-native/auth/credentialHandler.js +147 -0
  162. package/dist/react-native/auth/credentialHandler.js.map +1 -0
  163. package/dist/react-native/errors/connectionErrors.d.ts +68 -0
  164. package/dist/react-native/errors/connectionErrors.js +136 -0
  165. package/dist/react-native/errors/connectionErrors.js.map +1 -0
  166. package/dist/react-native/errors/index.d.ts +2 -0
  167. package/dist/react-native/errors/index.js +4 -0
  168. package/dist/react-native/errors/index.js.map +1 -0
  169. package/dist/react-native/handlers/sessionHandlers.d.ts +250 -0
  170. package/dist/react-native/handlers/sessionHandlers.js +4 -0
  171. package/dist/react-native/handlers/sessionHandlers.js.map +1 -0
  172. package/dist/react-native/handlers/subscriptionManager.d.ts +54 -0
  173. package/dist/react-native/handlers/subscriptionManager.js +250 -0
  174. package/dist/react-native/handlers/subscriptionManager.js.map +1 -0
  175. package/dist/react-native/index.d.ts +7 -0
  176. package/dist/react-native/index.js +12 -0
  177. package/dist/react-native/index.js.map +1 -0
  178. package/dist/react-native/logger.d.ts +2 -0
  179. package/dist/react-native/logger.js +5 -0
  180. package/dist/react-native/logger.js.map +1 -0
  181. package/dist/react-native/models/index.d.ts +2 -0
  182. package/dist/react-native/models/index.js +4 -0
  183. package/dist/react-native/models/index.js.map +1 -0
  184. package/dist/react-native/models/models.d.ts +2154 -0
  185. package/dist/react-native/models/models.js +2251 -0
  186. package/dist/react-native/models/models.js.map +1 -0
  187. package/dist/react-native/package.json +3 -0
  188. package/dist/react-native/protocol/messageParser.d.ts +42 -0
  189. package/dist/react-native/protocol/messageParser.js +150 -0
  190. package/dist/react-native/protocol/messageParser.js.map +1 -0
  191. package/dist/react-native/voiceLiveClient.d.ts +65 -0
  192. package/dist/react-native/voiceLiveClient.js +81 -0
  193. package/dist/react-native/voiceLiveClient.js.map +1 -0
  194. package/dist/react-native/voiceLiveSession.d.ts +138 -0
  195. package/dist/react-native/voiceLiveSession.js +429 -0
  196. package/dist/react-native/voiceLiveSession.js.map +1 -0
  197. package/dist/react-native/websocket/connectionManager.d.ts +88 -0
  198. package/dist/react-native/websocket/connectionManager.js +183 -0
  199. package/dist/react-native/websocket/connectionManager.js.map +1 -0
  200. package/dist/react-native/websocket/websocketBrowser.d.ts +26 -0
  201. package/dist/react-native/websocket/websocketBrowser.js +175 -0
  202. package/dist/react-native/websocket/websocketBrowser.js.map +1 -0
  203. package/dist/react-native/websocket/websocketFactory.d.ts +23 -0
  204. package/dist/react-native/websocket/websocketFactory.js +80 -0
  205. package/dist/react-native/websocket/websocketFactory.js.map +1 -0
  206. package/dist/react-native/websocket/websocketLike.d.ts +78 -0
  207. package/dist/react-native/websocket/websocketLike.js +13 -0
  208. package/dist/react-native/websocket/websocketLike.js.map +1 -0
  209. package/dist/react-native/websocket/websocketNode.d.ts +26 -0
  210. package/dist/react-native/websocket/websocketNode.js +180 -0
  211. package/dist/react-native/websocket/websocketNode.js.map +1 -0
  212. package/package.json +150 -0
@@ -0,0 +1,2154 @@
1
+ /** Error object returned in case of API failure. */
2
+ export interface VoiceLiveErrorDetails {
3
+ /** Error code, or null if unspecified. */
4
+ code?: string;
5
+ /** Human-readable error message. */
6
+ message: string;
7
+ /** Parameter name related to the error, if applicable. */
8
+ param?: string;
9
+ /** Type or category of the error. */
10
+ type?: string;
11
+ /** Event id of the error. */
12
+ eventId?: string;
13
+ }
14
+ export declare function voiceLiveErrorDetailsDeserializer(item: any): VoiceLiveErrorDetails;
15
+ /** Standard error response envelope. */
16
+ export interface ErrorResponse {
17
+ /** Error object returned in case of API failure. */
18
+ error: VoiceLiveErrorDetails;
19
+ }
20
+ export declare function errorResponseDeserializer(item: any): ErrorResponse;
21
+ /** A single log probability entry for a token. */
22
+ export interface LogProbProperties {
23
+ /** The token that was used to generate the log probability. */
24
+ token: string;
25
+ /** The log probability of the token. */
26
+ logprob: number;
27
+ /** The bytes that were used to generate the log probability. */
28
+ bytes: number[];
29
+ }
30
+ export declare function logProbPropertiesDeserializer(item: any): LogProbProperties;
31
+ /** A voicelive client event. */
32
+ export interface ClientEvent {
33
+ /** The type of event. */
34
+ /** The discriminator possible values: session.update, session.avatar.connect, input_audio.turn.start, input_audio.turn.append, input_audio.turn.end, input_audio.turn.cancel, input_audio.clear, input_audio_buffer.append, input_audio_buffer.commit, input_audio_buffer.clear, conversation.item.create, conversation.item.truncate, conversation.item.delete, response.create, response.cancel, conversation.item.retrieve */
35
+ type: ClientEventType;
36
+ eventId?: string;
37
+ }
38
+ export declare function clientEventSerializer(item: ClientEvent): any;
39
+ /** Alias for ClientEventUnion */
40
+ export type ClientEventUnion = ClientEventSessionUpdate | ClientEventSessionAvatarConnect | ClientEventInputAudioTurnStart | ClientEventInputAudioTurnAppend | ClientEventInputAudioTurnEnd | ClientEventInputAudioTurnCancel | ClientEventInputAudioClear | ClientEventInputAudioBufferAppend | ClientEventInputAudioBufferCommit | ClientEventInputAudioBufferClear | ClientEventConversationItemCreate | ClientEventConversationItemTruncate | ClientEventConversationItemDelete | ClientEventResponseCreate | ClientEventResponseCancel | ClientEventConversationItemRetrieve | ClientEvent;
41
+ export declare function clientEventUnionSerializer(item: ClientEventUnion): any;
42
+ /** Client event types used in VoiceLive protocol. */
43
+ export declare enum KnownClientEventType {
44
+ /** session.update */
45
+ SessionUpdate = "session.update",
46
+ /** input_audio_buffer.append */
47
+ InputAudioBufferAppend = "input_audio_buffer.append",
48
+ /** input_audio_buffer.commit */
49
+ InputAudioBufferCommit = "input_audio_buffer.commit",
50
+ /** input_audio_buffer.clear */
51
+ InputAudioBufferClear = "input_audio_buffer.clear",
52
+ /** input_audio.turn.start */
53
+ InputAudioTurnStart = "input_audio.turn.start",
54
+ /** input_audio.turn.append */
55
+ InputAudioTurnAppend = "input_audio.turn.append",
56
+ /** input_audio.turn.end */
57
+ InputAudioTurnEnd = "input_audio.turn.end",
58
+ /** input_audio.turn.cancel */
59
+ InputAudioTurnCancel = "input_audio.turn.cancel",
60
+ /** input_audio.clear */
61
+ InputAudioClear = "input_audio.clear",
62
+ /** conversation.item.create */
63
+ ConversationItemCreate = "conversation.item.create",
64
+ /** conversation.item.retrieve */
65
+ ConversationItemRetrieve = "conversation.item.retrieve",
66
+ /** conversation.item.truncate */
67
+ ConversationItemTruncate = "conversation.item.truncate",
68
+ /** conversation.item.delete */
69
+ ConversationItemDelete = "conversation.item.delete",
70
+ /** response.create */
71
+ ResponseCreate = "response.create",
72
+ /** response.cancel */
73
+ ResponseCancel = "response.cancel",
74
+ /** session.avatar.connect */
75
+ SessionAvatarConnect = "session.avatar.connect"
76
+ }
77
+ /**
78
+ * Client event types used in VoiceLive protocol. \
79
+ * {@link KnownClientEventType} can be used interchangeably with ClientEventType,
80
+ * this enum contains the known values that the service supports.
81
+ * ### Known values supported by the service
82
+ * **session.update** \
83
+ * **input_audio_buffer.append** \
84
+ * **input_audio_buffer.commit** \
85
+ * **input_audio_buffer.clear** \
86
+ * **input_audio.turn.start** \
87
+ * **input_audio.turn.append** \
88
+ * **input_audio.turn.end** \
89
+ * **input_audio.turn.cancel** \
90
+ * **input_audio.clear** \
91
+ * **conversation.item.create** \
92
+ * **conversation.item.retrieve** \
93
+ * **conversation.item.truncate** \
94
+ * **conversation.item.delete** \
95
+ * **response.create** \
96
+ * **response.cancel** \
97
+ * **session.avatar.connect**
98
+ */
99
+ export type ClientEventType = string;
100
+ /**
101
+ * Send this event to update the session’s default configuration.
102
+ * The client may send this event at any time to update any field,
103
+ * except for `voice`. However, note that once a session has been
104
+ * initialized with a particular `model`, it can’t be changed to
105
+ * another model using `session.update`.
106
+ * When the server receives a `session.update`, it will respond
107
+ * with a `session.updated` event showing the full, effective configuration.
108
+ * Only the fields that are present are updated. To clear a field like
109
+ * `instructions`, pass an empty string.
110
+ */
111
+ export interface ClientEventSessionUpdate extends ClientEvent {
112
+ /** The event type, must be `session.update`. */
113
+ type: "session.update";
114
+ session: RequestSession;
115
+ }
116
+ export declare function clientEventSessionUpdateSerializer(item: ClientEventSessionUpdate): any;
117
+ /** Base for session configuration shared between request and response. */
118
+ export interface RequestSession {
119
+ /** The model for the session. */
120
+ model?: string;
121
+ /** The modalities to be used in the session. */
122
+ modalities?: Modality[];
123
+ /** The animation configuration for the session. */
124
+ animation?: Animation;
125
+ /** The voice configuration for the session. */
126
+ voice?: Voice;
127
+ /** Optional instructions to guide the model's behavior throughout the session. */
128
+ instructions?: string;
129
+ /**
130
+ * Input audio sampling rate in Hz. Available values:
131
+ *
132
+ * - For pcm16: 8000, 16000, 24000
133
+ *
134
+ * - For g711_alaw/g711_ulaw: 8000
135
+ */
136
+ inputAudioSamplingRate?: number;
137
+ /** Input audio format. Default is 'pcm16'. */
138
+ inputAudioFormat?: InputAudioFormat;
139
+ /** Output audio format. Default is 'pcm16'. */
140
+ outputAudioFormat?: OutputAudioFormat;
141
+ /** Type of turn detection to use. */
142
+ turnDetection?: TurnDetectionUnion;
143
+ /** Configuration for input audio noise reduction. */
144
+ inputAudioNoiseReduction?: AudioNoiseReduction;
145
+ /** Configuration for echo cancellation during server-side audio processing. */
146
+ inputAudioEchoCancellation?: AudioEchoCancellation;
147
+ /** Configuration for avatar streaming and behavior during the session. */
148
+ avatar?: AvatarConfig;
149
+ /** Configuration for input audio transcription. */
150
+ inputAudioTranscription?: AudioInputTranscriptionOptions;
151
+ /** Types of timestamps to include in audio response content. */
152
+ outputAudioTimestampTypes?: AudioTimestampType[];
153
+ /** Configuration for tools to be used during the session, if applicable. */
154
+ tools?: ToolUnion[];
155
+ /** Specifies which tools the model is allowed to call during the session. */
156
+ toolChoice?: ToolChoice;
157
+ /** Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is 0.7. */
158
+ temperature?: number;
159
+ /** Maximum number of tokens to generate in the response. Default is unlimited. */
160
+ maxResponseOutputTokens?: number | "inf";
161
+ }
162
+ export declare function requestSessionSerializer(item: RequestSession): any;
163
+ /** Supported modalities for the session. */
164
+ export declare enum KnownModality {
165
+ /** Text modality. */
166
+ Text = "text",
167
+ /** Audio modality. */
168
+ Audio = "audio",
169
+ /** Animation modality. */
170
+ Animation = "animation",
171
+ /** Avatar modality. */
172
+ Avatar = "avatar"
173
+ }
174
+ /**
175
+ * Supported modalities for the session. \
176
+ * {@link KnownModality} can be used interchangeably with Modality,
177
+ * this enum contains the known values that the service supports.
178
+ * ### Known values supported by the service
179
+ * **text**: Text modality. \
180
+ * **audio**: Audio modality. \
181
+ * **animation**: Animation modality. \
182
+ * **avatar**: Avatar modality.
183
+ */
184
+ export type Modality = string;
185
+ /** Configuration for animation outputs including blendshapes and visemes metadata. */
186
+ export interface Animation {
187
+ /** The name of the animation model to use. */
188
+ modelName?: string;
189
+ /** Set of output data types requested from the animation system. */
190
+ outputs?: AnimationOutputType[];
191
+ }
192
+ export declare function animationSerializer(item: Animation): any;
193
+ export declare function animationDeserializer(item: any): Animation;
194
+ /** Specifies the types of animation data to output. */
195
+ export declare enum KnownAnimationOutputType {
196
+ /** Blendshapes output type. */
197
+ Blendshapes = "blendshapes",
198
+ /** Viseme ID output type. */
199
+ VisemeId = "viseme_id"
200
+ }
201
+ /**
202
+ * Specifies the types of animation data to output. \
203
+ * {@link KnownAnimationOutputType} can be used interchangeably with AnimationOutputType,
204
+ * this enum contains the known values that the service supports.
205
+ * ### Known values supported by the service
206
+ * **blendshapes**: Blendshapes output type. \
207
+ * **viseme_id**: Viseme ID output type.
208
+ */
209
+ export type AnimationOutputType = string;
210
+ /** Union of all supported voice configurations. */
211
+ export type Voice = OAIVoice | OpenAIVoice | AzureVoiceUnion;
212
+ export declare function voiceSerializer(item: Voice): any;
213
+ export declare function voiceDeserializer(item: any): Voice;
214
+ /** Supported OpenAI voice names (string enum). */
215
+ export declare enum KnownOAIVoice {
216
+ /** Alloy voice. */
217
+ Alloy = "alloy",
218
+ /** Ash voice. */
219
+ Ash = "ash",
220
+ /** Ballard voice. */
221
+ Ballad = "ballad",
222
+ /** Coral voice. */
223
+ Coral = "coral",
224
+ /** Echo voice. */
225
+ Echo = "echo",
226
+ /** Sage voice. */
227
+ Sage = "sage",
228
+ /** Shimmer voice. */
229
+ Shimmer = "shimmer",
230
+ /** Verse voice. */
231
+ Verse = "verse"
232
+ }
233
+ /**
234
+ * Supported OpenAI voice names (string enum). \
235
+ * {@link KnownOAIVoice} can be used interchangeably with OAIVoice,
236
+ * this enum contains the known values that the service supports.
237
+ * ### Known values supported by the service
238
+ * **alloy**: Alloy voice. \
239
+ * **ash**: Ash voice. \
240
+ * **ballad**: Ballard voice. \
241
+ * **coral**: Coral voice. \
242
+ * **echo**: Echo voice. \
243
+ * **sage**: Sage voice. \
244
+ * **shimmer**: Shimmer voice. \
245
+ * **verse**: Verse voice.
246
+ */
247
+ export type OAIVoice = string;
248
+ /**
249
+ * OpenAI voice configuration with explicit type field.
250
+ *
251
+ * This provides a unified interface for OpenAI voices, complementing the
252
+ * existing string-based OAIVoice for backward compatibility.
253
+ */
254
+ export interface OpenAIVoice {
255
+ /** The type of the voice. */
256
+ type: "openai";
257
+ /** The name of the OpenAI voice. */
258
+ name: OAIVoice;
259
+ }
260
+ export declare function openAIVoiceSerializer(item: OpenAIVoice): any;
261
+ export declare function openAIVoiceDeserializer(item: any): OpenAIVoice;
262
+ /** Base for Azure voice configurations. */
263
+ export interface AzureVoice {
264
+ /** The type of the Azure voice. */
265
+ /** The discriminator possible values: azure-custom, azure-standard, azure-personal */
266
+ type: AzureVoiceType;
267
+ }
268
+ export declare function azureVoiceSerializer(item: AzureVoice): any;
269
+ export declare function azureVoiceDeserializer(item: any): AzureVoice;
270
+ /** Alias for AzureVoiceUnion */
271
+ export type AzureVoiceUnion = AzureCustomVoice | AzureStandardVoice | AzurePersonalVoice | AzureVoice;
272
+ export declare function azureVoiceUnionSerializer(item: AzureVoiceUnion): any;
273
+ export declare function azureVoiceUnionDeserializer(item: any): AzureVoiceUnion;
274
+ /** Union of all supported Azure voice types. */
275
+ export declare enum KnownAzureVoiceType {
276
+ /** Azure custom voice. */
277
+ AzureCustom = "azure-custom",
278
+ /** Azure standard voice. */
279
+ AzureStandard = "azure-standard",
280
+ /** Azure personal voice. */
281
+ AzurePersonal = "azure-personal"
282
+ }
283
+ /**
284
+ * Union of all supported Azure voice types. \
285
+ * {@link KnownAzureVoiceType} can be used interchangeably with AzureVoiceType,
286
+ * this enum contains the known values that the service supports.
287
+ * ### Known values supported by the service
288
+ * **azure-custom**: Azure custom voice. \
289
+ * **azure-standard**: Azure standard voice. \
290
+ * **azure-personal**: Azure personal voice.
291
+ */
292
+ export type AzureVoiceType = string;
293
+ /** Azure custom voice configuration. */
294
+ export interface AzureCustomVoice extends AzureVoice {
295
+ type: "azure-custom";
296
+ /** Voice name cannot be empty. */
297
+ name: string;
298
+ /** Endpoint ID cannot be empty. */
299
+ endpointId: string;
300
+ /** Temperature must be between 0.0 and 1.0. */
301
+ temperature?: number;
302
+ customLexiconUrl?: string;
303
+ preferLocales?: string[];
304
+ locale?: string;
305
+ style?: string;
306
+ pitch?: string;
307
+ rate?: string;
308
+ volume?: string;
309
+ }
310
+ export declare function azureCustomVoiceSerializer(item: AzureCustomVoice): any;
311
+ export declare function azureCustomVoiceDeserializer(item: any): AzureCustomVoice;
312
+ /** Azure standard voice configuration. */
313
+ export interface AzureStandardVoice extends AzureVoice {
314
+ type: "azure-standard";
315
+ /** Voice name cannot be empty. */
316
+ name: string;
317
+ /** Temperature must be between 0.0 and 1.0. */
318
+ temperature?: number;
319
+ customLexiconUrl?: string;
320
+ preferLocales?: string[];
321
+ locale?: string;
322
+ style?: string;
323
+ pitch?: string;
324
+ rate?: string;
325
+ volume?: string;
326
+ }
327
+ export declare function azureStandardVoiceSerializer(item: AzureStandardVoice): any;
328
+ export declare function azureStandardVoiceDeserializer(item: any): AzureStandardVoice;
329
+ /** Azure personal voice configuration. */
330
+ export interface AzurePersonalVoice extends AzureVoice {
331
+ type: "azure-personal";
332
+ /** Voice name cannot be empty. */
333
+ name: string;
334
+ /** Temperature must be between 0.0 and 1.0. */
335
+ temperature?: number;
336
+ /** Underlying neural model to use for personal voice. */
337
+ model: PersonalVoiceModels;
338
+ }
339
+ export declare function azurePersonalVoiceSerializer(item: AzurePersonalVoice): any;
340
+ export declare function azurePersonalVoiceDeserializer(item: any): AzurePersonalVoice;
341
+ /** PersonalVoice models */
342
+ export declare enum KnownPersonalVoiceModels {
343
+ /** Use the latest Dragon model. */
344
+ DragonLatestNeural = "DragonLatestNeural",
345
+ /** Use the latest Phoenix model. */
346
+ PhoenixLatestNeural = "PhoenixLatestNeural",
347
+ /** Use the Phoenix V2 model. */
348
+ PhoenixV2Neural = "PhoenixV2Neural"
349
+ }
350
+ /**
351
+ * PersonalVoice models \
352
+ * {@link KnownPersonalVoiceModels} can be used interchangeably with PersonalVoiceModels,
353
+ * this enum contains the known values that the service supports.
354
+ * ### Known values supported by the service
355
+ * **DragonLatestNeural**: Use the latest Dragon model. \
356
+ * **PhoenixLatestNeural**: Use the latest Phoenix model. \
357
+ * **PhoenixV2Neural**: Use the Phoenix V2 model.
358
+ */
359
+ export type PersonalVoiceModels = string;
360
+ /** Input audio format types supported. */
361
+ export declare enum KnownInputAudioFormat {
362
+ /** 16-bit PCM audio format at default sampling rate (24kHz) */
363
+ Pcm16 = "pcm16",
364
+ /** G.711 μ-law (mu-law) audio format at 8kHz sampling rate */
365
+ G711Ulaw = "g711_ulaw",
366
+ /** G.711 A-law audio format at 8kHz sampling rate */
367
+ G711Alaw = "g711_alaw"
368
+ }
369
+ /**
370
+ * Input audio format types supported. \
371
+ * {@link KnownInputAudioFormat} can be used interchangeably with InputAudioFormat,
372
+ * this enum contains the known values that the service supports.
373
+ * ### Known values supported by the service
374
+ * **pcm16**: 16-bit PCM audio format at default sampling rate (24kHz) \
375
+ * **g711_ulaw**: G.711 μ-law (mu-law) audio format at 8kHz sampling rate \
376
+ * **g711_alaw**: G.711 A-law audio format at 8kHz sampling rate
377
+ */
378
+ export type InputAudioFormat = string;
379
+ /** Output audio format types supported. */
380
+ export declare enum KnownOutputAudioFormat {
381
+ /** 16-bit PCM audio format at default sampling rate (24kHz) */
382
+ Pcm16 = "pcm16",
383
+ /** 16-bit PCM audio format at 8kHz sampling rate */
384
+ Pcm168000Hz = "pcm16-8000hz",
385
+ /** 16-bit PCM audio format at 16kHz sampling rate */
386
+ Pcm1616000Hz = "pcm16-16000hz",
387
+ /** G.711 μ-law (mu-law) audio format at 8kHz sampling rate */
388
+ G711Ulaw = "g711_ulaw",
389
+ /** G.711 A-law audio format at 8kHz sampling rate */
390
+ G711Alaw = "g711_alaw"
391
+ }
392
+ /**
393
+ * Output audio format types supported. \
394
+ * {@link KnownOutputAudioFormat} can be used interchangeably with OutputAudioFormat,
395
+ * this enum contains the known values that the service supports.
396
+ * ### Known values supported by the service
397
+ * **pcm16**: 16-bit PCM audio format at default sampling rate (24kHz) \
398
+ * **pcm16-8000hz**: 16-bit PCM audio format at 8kHz sampling rate \
399
+ * **pcm16-16000hz**: 16-bit PCM audio format at 16kHz sampling rate \
400
+ * **g711_ulaw**: G.711 μ-law (mu-law) audio format at 8kHz sampling rate \
401
+ * **g711_alaw**: G.711 A-law audio format at 8kHz sampling rate
402
+ */
403
+ export type OutputAudioFormat = string;
404
+ /** Top-level union for turn detection configuration. */
405
+ export interface TurnDetection {
406
+ type: TurnDetectionType;
407
+ }
408
+ export declare function turnDetectionSerializer(item: TurnDetection): any;
409
+ export declare function turnDetectionDeserializer(item: any): TurnDetection;
410
+ /** Alias for TurnDetectionUnion */
411
+ export type TurnDetectionUnion = ServerVad | AzureSemanticVad | AzureSemanticVadEn | AzureSemanticVadMultilingual | TurnDetection;
412
+ export declare function turnDetectionUnionSerializer(item: TurnDetectionUnion): any;
413
+ export declare function turnDetectionUnionDeserializer(item: any): TurnDetectionUnion;
414
+ /** Known values of {@link TurnDetectionType} that the service accepts. */
415
+ export declare enum KnownTurnDetectionType {
416
+ /** server_vad */
417
+ ServerVad = "server_vad",
418
+ /** azure_semantic_vad */
419
+ AzureSemanticVad = "azure_semantic_vad",
420
+ /** azure_semantic_vad_en */
421
+ AzureSemanticVadEn = "azure_semantic_vad_en",
422
+ /** azure_semantic_vad_multilingual */
423
+ AzureSemanticVadMultilingual = "azure_semantic_vad_multilingual"
424
+ }
425
+ /** Type of TurnDetectionType */
426
+ export type TurnDetectionType = string;
427
+ /** Base model for VAD-based turn detection. */
428
+ export interface ServerVad extends TurnDetection {
429
+ type: "server_vad";
430
+ threshold?: number;
431
+ prefixPaddingInMs?: number;
432
+ silenceDurationInMs?: number;
433
+ endOfUtteranceDetection?: EouDetectionUnion;
434
+ autoTruncate?: boolean;
435
+ createResponse?: boolean;
436
+ interruptResponse?: boolean;
437
+ }
438
+ export declare function serverVadSerializer(item: ServerVad): any;
439
+ export declare function serverVadDeserializer(item: any): ServerVad;
440
+ /** Top-level union for end-of-utterance (EOU) semantic detection configuration. */
441
+ export interface EouDetection {
442
+ model: string;
443
+ }
444
+ export declare function eouDetectionSerializer(item: EouDetection): any;
445
+ export declare function eouDetectionDeserializer(item: any): EouDetection;
446
+ /** Alias for EouDetectionUnion */
447
+ export type EouDetectionUnion = AzureSemanticDetection | AzureSemanticDetectionEn | AzureSemanticDetectionMultilingual | EouDetection;
448
+ export declare function eouDetectionUnionSerializer(item: EouDetectionUnion): any;
449
+ export declare function eouDetectionUnionDeserializer(item: any): EouDetectionUnion;
450
+ /** Azure semantic end-of-utterance detection (default). */
451
+ export interface AzureSemanticDetection extends EouDetection {
452
+ model: "semantic_detection_v1";
453
+ /** Threshold level setting. Recommended instead of `threshold`. One of `low`, `medium`, `high`, or `default`. */
454
+ thresholdLevel?: EouThresholdLevel;
455
+ /** Timeout in milliseconds. Recommended instead of `timeout`. */
456
+ timeoutInMs?: number;
457
+ }
458
+ export declare function azureSemanticDetectionSerializer(item: AzureSemanticDetection): any;
459
+ export declare function azureSemanticDetectionDeserializer(item: any): AzureSemanticDetection;
460
+ /** Threshold level settings for Azure semantic end-of-utterance detection. */
461
+ export declare enum KnownEouThresholdLevel {
462
+ /** Low sensitivity threshold level. */
463
+ Low = "low",
464
+ /** Medium sensitivity threshold level. */
465
+ Medium = "medium",
466
+ /** High sensitivity threshold level. */
467
+ High = "high",
468
+ /** Default sensitivity threshold level. */
469
+ Default = "default"
470
+ }
471
+ /**
472
+ * Threshold level settings for Azure semantic end-of-utterance detection. \
473
+ * {@link KnownEouThresholdLevel} can be used interchangeably with EouThresholdLevel,
474
+ * this enum contains the known values that the service supports.
475
+ * ### Known values supported by the service
476
+ * **low**: Low sensitivity threshold level. \
477
+ * **medium**: Medium sensitivity threshold level. \
478
+ * **high**: High sensitivity threshold level. \
479
+ * **default**: Default sensitivity threshold level.
480
+ */
481
+ export type EouThresholdLevel = string;
482
+ /** Azure semantic end-of-utterance detection (English-optimized). */
483
+ export interface AzureSemanticDetectionEn extends EouDetection {
484
+ model: "semantic_detection_v1_en";
485
+ /** Threshold level setting. Recommended instead of `threshold`. One of `low`, `medium`, `high`, or `default`. */
486
+ thresholdLevel?: EouThresholdLevel;
487
+ /** Timeout in milliseconds. Recommended instead of `timeout`. */
488
+ timeoutInMs?: number;
489
+ }
490
+ export declare function azureSemanticDetectionEnSerializer(item: AzureSemanticDetectionEn): any;
491
+ export declare function azureSemanticDetectionEnDeserializer(item: any): AzureSemanticDetectionEn;
492
+ /** Azure semantic end-of-utterance detection (multilingual). */
493
+ export interface AzureSemanticDetectionMultilingual extends EouDetection {
494
+ model: "semantic_detection_v1_multilingual";
495
+ /** Threshold level setting. Recommended instead of `threshold`. One of `low`, `medium`, `high`, or `default`. */
496
+ thresholdLevel?: EouThresholdLevel;
497
+ /** Timeout in milliseconds. Recommended instead of `timeout`. */
498
+ timeoutInMs?: number;
499
+ }
500
+ export declare function azureSemanticDetectionMultilingualSerializer(item: AzureSemanticDetectionMultilingual): any;
501
+ export declare function azureSemanticDetectionMultilingualDeserializer(item: any): AzureSemanticDetectionMultilingual;
502
+ /** Server Speech Detection (Azure semantic VAD, default variant). */
503
+ export interface AzureSemanticVad extends TurnDetection {
504
+ type: "azure_semantic_vad";
505
+ threshold?: number;
506
+ prefixPaddingInMs?: number;
507
+ silenceDurationInMs?: number;
508
+ endOfUtteranceDetection?: EouDetectionUnion;
509
+ speechDurationInMs?: number;
510
+ removeFillerWords?: boolean;
511
+ languages?: string[];
512
+ autoTruncate?: boolean;
513
+ createResponse?: boolean;
514
+ interruptResponse?: boolean;
515
+ }
516
+ export declare function azureSemanticVadSerializer(item: AzureSemanticVad): any;
517
+ export declare function azureSemanticVadDeserializer(item: any): AzureSemanticVad;
518
+ /** Server Speech Detection (Azure semantic VAD, English-only). */
519
+ export interface AzureSemanticVadEn extends TurnDetection {
520
+ type: "azure_semantic_vad_en";
521
+ threshold?: number;
522
+ prefixPaddingInMs?: number;
523
+ silenceDurationInMs?: number;
524
+ endOfUtteranceDetection?: EouDetectionUnion;
525
+ speechDurationInMs?: number;
526
+ removeFillerWords?: boolean;
527
+ autoTruncate?: boolean;
528
+ createResponse?: boolean;
529
+ interruptResponse?: boolean;
530
+ }
531
+ export declare function azureSemanticVadEnSerializer(item: AzureSemanticVadEn): any;
532
+ export declare function azureSemanticVadEnDeserializer(item: any): AzureSemanticVadEn;
533
+ /** Server Speech Detection (Azure semantic VAD). */
534
+ export interface AzureSemanticVadMultilingual extends TurnDetection {
535
+ type: "azure_semantic_vad_multilingual";
536
+ threshold?: number;
537
+ prefixPaddingInMs?: number;
538
+ silenceDurationInMs?: number;
539
+ endOfUtteranceDetection?: EouDetectionUnion;
540
+ speechDurationInMs?: number;
541
+ removeFillerWords?: boolean;
542
+ languages?: string[];
543
+ autoTruncate?: boolean;
544
+ createResponse?: boolean;
545
+ interruptResponse?: boolean;
546
+ }
547
+ export declare function azureSemanticVadMultilingualSerializer(item: AzureSemanticVadMultilingual): any;
548
+ export declare function azureSemanticVadMultilingualDeserializer(item: any): AzureSemanticVadMultilingual;
549
+ /** Configuration for input audio noise reduction. */
550
+ export interface AudioNoiseReduction {
551
+ /** The type of noise reduction model. */
552
+ type: string;
553
+ }
554
+ export declare function audioNoiseReductionSerializer(item: AudioNoiseReduction): any;
555
+ export declare function audioNoiseReductionDeserializer(item: any): AudioNoiseReduction;
556
+ /** Echo cancellation configuration for server-side audio processing. */
557
+ export interface AudioEchoCancellation {
558
+ /** The type of echo cancellation model to use. */
559
+ type: "server_echo_cancellation";
560
+ }
561
+ export declare function audioEchoCancellationSerializer(item: AudioEchoCancellation): any;
562
+ export declare function audioEchoCancellationDeserializer(item: any): AudioEchoCancellation;
563
+ /** Configuration for avatar streaming and behavior during the session. */
564
+ export interface AvatarConfig {
565
+ /** Optional list of ICE servers to use for WebRTC connection establishment. */
566
+ iceServers?: IceServer[];
567
+ /** The character name or ID used for the avatar. */
568
+ character: string;
569
+ /** Optional avatar style, such as emotional tone or speaking style. */
570
+ style?: string;
571
+ /** Indicates whether the avatar is customized or not. */
572
+ customized: boolean;
573
+ /** Optional video configuration including resolution, bitrate, and codec. */
574
+ video?: VideoParams;
575
+ }
576
+ export declare function avatarConfigSerializer(item: AvatarConfig): any;
577
+ export declare function avatarConfigDeserializer(item: any): AvatarConfig;
578
+ export declare function iceServerArraySerializer(result: Array<IceServer>): any[];
579
+ export declare function iceServerArrayDeserializer(result: Array<IceServer>): any[];
580
+ /** ICE server configuration for WebRTC connection negotiation. */
581
+ export interface IceServer {
582
+ /** List of ICE server URLs (e.g., TURN or STUN endpoints). */
583
+ urls: string[];
584
+ /** Optional username used for authentication with the ICE server. */
585
+ username?: string;
586
+ /** Optional credential (e.g., password or token) used for authentication. */
587
+ credential?: string;
588
+ }
589
+ export declare function iceServerSerializer(item: IceServer): any;
590
+ export declare function iceServerDeserializer(item: any): IceServer;
591
+ /** Video streaming parameters for avatar. */
592
+ export interface VideoParams {
593
+ /** Bitrate in bits per second (e.g., 2000000 for 2 Mbps). */
594
+ bitrate?: number;
595
+ /** Codec to use for encoding. Currently only 'h264' is supported. */
596
+ codec?: "h264";
597
+ /** Optional cropping settings for the video stream. */
598
+ crop?: VideoCrop;
599
+ /** Optional resolution settings for the video stream. */
600
+ resolution?: VideoResolution;
601
+ /** Optional background settings for the video. Allows specifying either a solid color or an image URL. */
602
+ background?: Background;
603
+ /** Group of Pictures (GOP) size for video encoding. Controls the interval between keyframes, affecting compression efficiency and seeking performance. */
604
+ gopSize?: number;
605
+ }
606
+ export declare function videoParamsSerializer(item: VideoParams): any;
607
+ export declare function videoParamsDeserializer(item: any): VideoParams;
608
+ /** Defines a video crop rectangle using top-left and bottom-right coordinates. */
609
+ export interface VideoCrop {
610
+ /** Top-left corner of the crop region. Array of [x, y], must be non-negative integers. */
611
+ topLeft: number[];
612
+ /** Bottom-right corner of the crop region. Array of [x, y], must be non-negative integers. */
613
+ bottomRight: number[];
614
+ }
615
+ export declare function videoCropSerializer(item: VideoCrop): any;
616
+ export declare function videoCropDeserializer(item: any): VideoCrop;
617
+ /** Resolution of the video feed in pixels. */
618
+ export interface VideoResolution {
619
+ /** Width of the video in pixels. Must be greater than 0. */
620
+ width: number;
621
+ /** Height of the video in pixels. Must be greater than 0. */
622
+ height: number;
623
+ }
624
+ export declare function videoResolutionSerializer(item: VideoResolution): any;
625
+ export declare function videoResolutionDeserializer(item: any): VideoResolution;
626
+ /** Defines a video background, either a solid color or an image URL (mutually exclusive). */
627
+ export interface Background {
628
+ /** Background color in hex format (e.g., `#00FF00FF`). Cannot be set if `image_url` is provided. */
629
+ color?: string;
630
+ /** Background image URL. Cannot be set if `color` is provided. */
631
+ imageUrl?: string;
632
+ }
633
+ export declare function backgroundSerializer(item: Background): any;
634
+ export declare function backgroundDeserializer(item: any): Background;
635
+ /** Configuration for input audio transcription. */
636
+ export interface AudioInputTranscriptionOptions {
637
+ /**
638
+ * The transcription model to use. Supported values:
639
+ * 'whisper-1', 'gpt-4o-transcribe', 'gpt-4o-mini-transcribe',
640
+ * 'azure-speech'.
641
+ */
642
+ model: string;
643
+ /** Optional language code in BCP-47 (e.g., 'en-US'), or ISO-639-1 (e.g., 'en'), or multi languages with auto detection, (e.g., 'en,zh'). */
644
+ language?: string;
645
+ /** Optional configuration for custom speech models. */
646
+ customSpeech?: Record<string, string>;
647
+ /** Optional list of phrase hints to bias recognition. */
648
+ phraseList?: string[];
649
+ }
650
+ export declare function audioInputTranscriptionOptionsSerializer(item: AudioInputTranscriptionOptions): any;
651
+ export declare function audioInputTranscriptionOptionsDeserializer(item: any): AudioInputTranscriptionOptions;
652
+ /** Output timestamp types supported in audio response content. */
653
+ export declare enum KnownAudioTimestampType {
654
+ /** Timestamps per word in the output audio. */
655
+ Word = "word"
656
+ }
657
+ /**
658
+ * Output timestamp types supported in audio response content. \
659
+ * {@link KnownAudioTimestampType} can be used interchangeably with AudioTimestampType,
660
+ * this enum contains the known values that the service supports.
661
+ * ### Known values supported by the service
662
+ * **word**: Timestamps per word in the output audio.
663
+ */
664
+ export type AudioTimestampType = string;
665
+ export declare function toolUnionArraySerializer(result: Array<ToolUnion>): any[];
666
+ export declare function toolUnionArrayDeserializer(result: Array<ToolUnion>): any[];
667
+ /** The base representation of a voicelive tool definition. */
668
+ export interface Tool {
669
+ type: ToolType;
670
+ }
671
+ export declare function toolSerializer(item: Tool): any;
672
+ export declare function toolDeserializer(item: any): Tool;
673
+ /** Alias for ToolUnion */
674
+ export type ToolUnion = FunctionTool | Tool;
675
+ export declare function toolUnionSerializer(item: ToolUnion): any;
676
+ export declare function toolUnionDeserializer(item: any): ToolUnion;
677
+ /**
678
+ * The supported tool type discriminators for voicelive tools.
679
+ * Currently, only 'function' tools are supported.
680
+ */
681
+ export declare enum KnownToolType {
682
+ /** function */
683
+ Function = "function"
684
+ }
685
+ /**
686
+ * The supported tool type discriminators for voicelive tools.
687
+ * Currently, only 'function' tools are supported. \
688
+ * {@link KnownToolType} can be used interchangeably with ToolType,
689
+ * this enum contains the known values that the service supports.
690
+ * ### Known values supported by the service
691
+ * **function**
692
+ */
693
+ export type ToolType = string;
694
+ /** The definition of a function tool as used by the voicelive endpoint. */
695
+ export interface FunctionTool extends Tool {
696
+ type: "function";
697
+ name: string;
698
+ description?: string;
699
+ parameters?: any;
700
+ }
701
+ export declare function functionToolSerializer(item: FunctionTool): any;
702
+ export declare function functionToolDeserializer(item: any): FunctionTool;
703
+ /**
704
+ * The combined set of available representations for a voicelive tool_choice parameter, encompassing both string
705
+ * literal options like 'auto' as well as structured references to defined tools.
706
+ */
707
+ export type ToolChoice = ToolChoiceLiteral | ToolChoiceSelectionUnion;
708
+ export declare function toolChoiceSerializer(item: ToolChoice): any;
709
+ export declare function toolChoiceDeserializer(item: any): ToolChoice;
710
+ /** The available set of mode-level, string literal tool_choice options for the voicelive endpoint. */
711
+ export declare enum KnownToolChoiceLiteral {
712
+ /** Specifies that the model should freely determine which tool or tools, if any, to call. */
713
+ Auto = "auto",
714
+ /** Specifies that the model should call no tools whatsoever. */
715
+ None = "none",
716
+ /** Specifies that the model should call at least one tool. */
717
+ Required = "required"
718
+ }
719
+ /**
720
+ * The available set of mode-level, string literal tool_choice options for the voicelive endpoint. \
721
+ * {@link KnownToolChoiceLiteral} can be used interchangeably with ToolChoiceLiteral,
722
+ * this enum contains the known values that the service supports.
723
+ * ### Known values supported by the service
724
+ * **auto**: Specifies that the model should freely determine which tool or tools, if any, to call. \
725
+ * **none**: Specifies that the model should call no tools whatsoever. \
726
+ * **required**: Specifies that the model should call at least one tool.
727
+ */
728
+ export type ToolChoiceLiteral = string;
729
+ /** A base representation for a voicelive tool_choice selecting a named tool. */
730
+ export interface ToolChoiceSelection {
731
+ type: ToolType;
732
+ }
733
+ export declare function toolChoiceSelectionSerializer(item: ToolChoiceSelection): any;
734
+ export declare function toolChoiceSelectionDeserializer(item: any): ToolChoiceSelection;
735
+ /** Alias for ToolChoiceSelectionUnion */
736
+ export type ToolChoiceSelectionUnion = ToolChoiceFunctionSelection | ToolChoiceSelection;
737
+ export declare function toolChoiceSelectionUnionSerializer(item: ToolChoiceSelectionUnion): any;
738
+ export declare function toolChoiceSelectionUnionDeserializer(item: any): ToolChoiceSelectionUnion;
739
+ /** The representation of a voicelive tool_choice selecting a named function tool. */
740
+ export interface ToolChoiceFunctionSelection extends ToolChoiceSelection {
741
+ type: "function";
742
+ name: string;
743
+ }
744
+ export declare function toolChoiceFunctionSelectionSerializer(item: ToolChoiceFunctionSelection): any;
745
+ export declare function toolChoiceFunctionSelectionDeserializer(item: any): ToolChoiceFunctionSelection;
746
+ /** Alias for _RequestSessionMaxResponseOutputTokens */
747
+ export type _RequestSessionMaxResponseOutputTokens = number | "inf";
748
+ export declare function _requestSessionMaxResponseOutputTokensSerializer(item: _RequestSessionMaxResponseOutputTokens): any;
749
+ export declare function _requestSessionMaxResponseOutputTokensDeserializer(item: any): _RequestSessionMaxResponseOutputTokens;
750
+ /**
751
+ * Sent when the client connects and provides its SDP (Session Description Protocol)
752
+ *
753
+ * for avatar-related media negotiation.
754
+ */
755
+ export interface ClientEventSessionAvatarConnect extends ClientEvent {
756
+ /** The event type, must be 'session.avatar.connect'. */
757
+ type: "session.avatar.connect";
758
+ /** The client's SDP offer. */
759
+ clientSdp: string;
760
+ }
761
+ export declare function clientEventSessionAvatarConnectSerializer(item: ClientEventSessionAvatarConnect): any;
762
+ /** Indicates the start of a new audio input turn. */
763
+ export interface ClientEventInputAudioTurnStart extends ClientEvent {
764
+ /** The event type, must be 'input_audio.turn.start'. */
765
+ type: "input_audio.turn.start";
766
+ /** Unique identifier for the input audio turn. */
767
+ turnId: string;
768
+ }
769
+ export declare function clientEventInputAudioTurnStartSerializer(item: ClientEventInputAudioTurnStart): any;
770
+ /** Appends audio data to an ongoing input turn. */
771
+ export interface ClientEventInputAudioTurnAppend extends ClientEvent {
772
+ /** The event type, must be 'input_audio.turn.append'. */
773
+ type: "input_audio.turn.append";
774
+ /** The ID of the turn this audio is part of. */
775
+ turnId: string;
776
+ /** Base64-encoded audio chunk. */
777
+ audio: string;
778
+ }
779
+ export declare function clientEventInputAudioTurnAppendSerializer(item: ClientEventInputAudioTurnAppend): any;
780
+ /** Marks the end of an audio input turn. */
781
+ export interface ClientEventInputAudioTurnEnd extends ClientEvent {
782
+ /** The event type, must be 'input_audio.turn.end'. */
783
+ type: "input_audio.turn.end";
784
+ /** The ID of the audio turn being ended. */
785
+ turnId: string;
786
+ }
787
+ export declare function clientEventInputAudioTurnEndSerializer(item: ClientEventInputAudioTurnEnd): any;
788
+ /** Cancels an in-progress input audio turn. */
789
+ export interface ClientEventInputAudioTurnCancel extends ClientEvent {
790
+ /** The event type, must be 'input_audio.turn.cancel'. */
791
+ type: "input_audio.turn.cancel";
792
+ /** The ID of the turn to cancel. */
793
+ turnId: string;
794
+ }
795
+ export declare function clientEventInputAudioTurnCancelSerializer(item: ClientEventInputAudioTurnCancel): any;
796
+ /** Clears all input audio currently being streamed. */
797
+ export interface ClientEventInputAudioClear extends ClientEvent {
798
+ /** The event type, must be 'input_audio.clear'. */
799
+ type: "input_audio.clear";
800
+ }
801
+ export declare function clientEventInputAudioClearSerializer(item: ClientEventInputAudioClear): any;
802
+ /**
803
+ * Send this event to append audio bytes to the input audio buffer. The audio
804
+ * buffer is temporary storage you can write to and later commit. In Server VAD
805
+ * mode, the audio buffer is used to detect speech and the server will decide
806
+ * when to commit. When Server VAD is disabled, you must commit the audio buffer
807
+ * manually.
808
+ *
809
+ * The client may choose how much audio to place in each event up to a maximum
810
+ * of 15 MiB, for example streaming smaller chunks from the client may allow the
811
+ * VAD to be more responsive. Unlike made other client events, the server will
812
+ * not send a confirmation response to this event.
813
+ */
814
+ export interface ClientEventInputAudioBufferAppend extends ClientEvent {
815
+ /** The event type, must be `input_audio_buffer.append`. */
816
+ type: "input_audio_buffer.append";
817
+ /**
818
+ * Base64-encoded audio. This must be in the format specified by the
819
+ * `input_audio_format` field in the session configuration.
820
+ */
821
+ audio: string;
822
+ }
823
+ export declare function clientEventInputAudioBufferAppendSerializer(item: ClientEventInputAudioBufferAppend): any;
824
+ /**
825
+ * Send this event to commit the user input audio buffer, which will create a
826
+ * new user message item in the conversation. This event will produce an error
827
+ * if the input audio buffer is empty. When in Server VAD mode, the client does
828
+ * not need to send this event, the server will commit the audio buffer
829
+ * automatically.
830
+ * Committing the input audio buffer will trigger input audio transcription
831
+ * (if enabled in session configuration), but it will not create a response
832
+ * from the model. The server will respond with an `input_audio_buffer.committed`
833
+ * event.
834
+ */
835
+ export interface ClientEventInputAudioBufferCommit extends ClientEvent {
836
+ /** The event type, must be `input_audio_buffer.commit`. */
837
+ type: "input_audio_buffer.commit";
838
+ }
839
+ export declare function clientEventInputAudioBufferCommitSerializer(item: ClientEventInputAudioBufferCommit): any;
840
+ /**
841
+ * Send this event to clear the audio bytes in the buffer. The server will
842
+ * respond with an `input_audio_buffer.cleared` event.
843
+ */
844
+ export interface ClientEventInputAudioBufferClear extends ClientEvent {
845
+ /** The event type, must be `input_audio_buffer.clear`. */
846
+ type: "input_audio_buffer.clear";
847
+ }
848
+ export declare function clientEventInputAudioBufferClearSerializer(item: ClientEventInputAudioBufferClear): any;
849
+ /**
850
+ * Add a new Item to the Conversation's context, including messages, function
851
+ * calls, and function call responses. This event can be used both to populate a
852
+ * "history" of the conversation and to add new items mid-stream, but has the
853
+ * current limitation that it cannot populate assistant audio messages.
854
+ * If successful, the server will respond with a `conversation.item.created`
855
+ * event, otherwise an `error` event will be sent.
856
+ */
857
+ export interface ClientEventConversationItemCreate extends ClientEvent {
858
+ /** The event type, must be `conversation.item.create`. */
859
+ type: "conversation.item.create";
860
+ /** Optional client-generated ID used to identify this event. */
861
+ eventId?: string;
862
+ /**
863
+ * The ID of the preceding item after which the new item will be inserted.
864
+ * If not set, the new item will be appended to the end of the conversation.
865
+ * If set to `root`, the new item will be added to the beginning of the conversation.
866
+ * If set to an existing ID, it allows an item to be inserted mid-conversation. If the
867
+ * ID cannot be found, an error will be returned and the item will not be added.
868
+ */
869
+ previousItemId?: string;
870
+ item?: ConversationRequestItemUnion;
871
+ }
872
+ export declare function clientEventConversationItemCreateSerializer(item: ClientEventConversationItemCreate): any;
873
+ /** Base for any response item; discriminated by `type`. */
874
+ export interface ConversationRequestItem {
875
+ type: ItemType;
876
+ id?: string;
877
+ }
878
+ export declare function conversationRequestItemSerializer(item: ConversationRequestItem): any;
879
+ export declare function conversationRequestItemDeserializer(item: any): ConversationRequestItem;
880
+ /** Alias for ConversationRequestItemUnion */
881
+ export type ConversationRequestItemUnion = MessageItemUnion | FunctionCallItem | FunctionCallOutputItem | ConversationRequestItem;
882
+ export declare function conversationRequestItemUnionSerializer(item: ConversationRequestItemUnion): any;
883
+ export declare function conversationRequestItemUnionDeserializer(item: any): ConversationRequestItemUnion;
884
+ /** Known values of {@link ItemType} that the service accepts. */
885
+ export declare enum KnownItemType {
886
+ /** message */
887
+ Message = "message",
888
+ /** function_call */
889
+ FunctionCall = "function_call",
890
+ /** function_call_output */
891
+ FunctionCallOutput = "function_call_output"
892
+ }
893
+ /** Type of ItemType */
894
+ export type ItemType = string;
895
+ /** A message item within a conversation. */
896
+ export interface MessageItem extends ConversationRequestItem {
897
+ /** The type of the item; must be 'message' for message items. */
898
+ type: "message";
899
+ /** The role of the message origionator. */
900
+ /** The discriminator possible values: system, user, assistant */
901
+ role: MessageRole;
902
+ /** The content parts of the message. */
903
+ content: MessageContentPartUnion[];
904
+ /** Processing status of the message item. */
905
+ status?: ItemParamStatus;
906
+ }
907
+ export declare function messageItemSerializer(item: MessageItem): any;
908
+ export declare function messageItemDeserializer(item: any): MessageItem;
909
+ /** Alias for MessageItemUnion */
910
+ export type MessageItemUnion = SystemMessageItem | UserMessageItem | AssistantMessageItem | MessageItem;
911
+ export declare function messageItemUnionSerializer(item: MessageItemUnion): any;
912
+ export declare function messageItemUnionDeserializer(item: any): MessageItemUnion;
913
+ /** Known values of {@link MessageRole} that the service accepts. */
914
+ export declare enum KnownMessageRole {
915
+ /** system */
916
+ System = "system",
917
+ /** user */
918
+ User = "user",
919
+ /** assistant */
920
+ Assistant = "assistant"
921
+ }
922
+ /** Type of MessageRole */
923
+ export type MessageRole = string;
924
+ export declare function messageContentPartUnionArraySerializer(result: Array<MessageContentPartUnion>): any[];
925
+ export declare function messageContentPartUnionArrayDeserializer(result: Array<MessageContentPartUnion>): any[];
926
+ /** Base for any message content part; discriminated by `type`. */
927
+ export interface MessageContentPart {
928
+ /** The type of the content part. */
929
+ /** The discriminator possible values: input_text, input_audio, text */
930
+ type: ContentPartType;
931
+ }
932
+ export declare function messageContentPartSerializer(item: MessageContentPart): any;
933
+ export declare function messageContentPartDeserializer(item: any): MessageContentPart;
934
+ /** Alias for MessageContentPartUnion */
935
+ export type MessageContentPartUnion = InputTextContentPart | InputAudioContentPart | OutputTextContentPart | MessageContentPart;
936
+ export declare function messageContentPartUnionSerializer(item: MessageContentPartUnion): any;
937
+ export declare function messageContentPartUnionDeserializer(item: any): MessageContentPartUnion;
938
+ /** Known values of {@link ContentPartType} that the service accepts. */
939
+ export declare enum KnownContentPartType {
940
+ /** input_text */
941
+ InputText = "input_text",
942
+ /** input_audio */
943
+ InputAudio = "input_audio",
944
+ /** text */
945
+ Text = "text",
946
+ /** audio */
947
+ Audio = "audio"
948
+ }
949
+ /** Type of ContentPartType */
950
+ export type ContentPartType = string;
951
+ /** Input text content part. */
952
+ export interface InputTextContentPart extends MessageContentPart {
953
+ type: "input_text";
954
+ text: string;
955
+ }
956
+ export declare function inputTextContentPartSerializer(item: InputTextContentPart): any;
957
+ export declare function inputTextContentPartDeserializer(item: any): InputTextContentPart;
958
+ /** Input audio content part. */
959
+ export interface InputAudioContentPart extends MessageContentPart {
960
+ type: "input_audio";
961
+ audio: string;
962
+ transcript?: string;
963
+ }
964
+ export declare function inputAudioContentPartSerializer(item: InputAudioContentPart): any;
965
+ export declare function inputAudioContentPartDeserializer(item: any): InputAudioContentPart;
966
+ /** Output text content part. */
967
+ export interface OutputTextContentPart extends MessageContentPart {
968
+ /** The type of the content part. */
969
+ type: "text";
970
+ /** The text content. */
971
+ text: string;
972
+ }
973
+ export declare function outputTextContentPartSerializer(item: OutputTextContentPart): any;
974
+ export declare function outputTextContentPartDeserializer(item: any): OutputTextContentPart;
975
+ /** Indicates the processing status of an item or parameter. */
976
+ export declare enum KnownItemParamStatus {
977
+ /** Item or parameter is still being processed. */
978
+ Completed = "completed",
979
+ /** Item or parameter is not yet complete. */
980
+ Incomplete = "incomplete"
981
+ }
982
+ /**
983
+ * Indicates the processing status of an item or parameter. \
984
+ * {@link KnownItemParamStatus} can be used interchangeably with ItemParamStatus,
985
+ * this enum contains the known values that the service supports.
986
+ * ### Known values supported by the service
987
+ * **completed**: Item or parameter is still being processed. \
988
+ * **incomplete**: Item or parameter is not yet complete.
989
+ */
990
+ export type ItemParamStatus = string;
991
+ /** A system message item within a conversation. */
992
+ export interface SystemMessageItem extends MessageItem {
993
+ role: "system";
994
+ }
995
+ export declare function systemMessageItemSerializer(item: SystemMessageItem): any;
996
+ export declare function systemMessageItemDeserializer(item: any): SystemMessageItem;
997
+ /** A user message item within a conversation. */
998
+ export interface UserMessageItem extends MessageItem {
999
+ role: "user";
1000
+ }
1001
+ export declare function userMessageItemSerializer(item: UserMessageItem): any;
1002
+ export declare function userMessageItemDeserializer(item: any): UserMessageItem;
1003
+ /** An assistant message item within a conversation. */
1004
+ export interface AssistantMessageItem extends MessageItem {
1005
+ role: "assistant";
1006
+ }
1007
+ export declare function assistantMessageItemSerializer(item: AssistantMessageItem): any;
1008
+ export declare function assistantMessageItemDeserializer(item: any): AssistantMessageItem;
1009
+ /** A function call item within a conversation. */
1010
+ export interface FunctionCallItem extends ConversationRequestItem {
1011
+ type: "function_call";
1012
+ name: string;
1013
+ callId: string;
1014
+ arguments: string;
1015
+ status?: ItemParamStatus;
1016
+ }
1017
+ export declare function functionCallItemSerializer(item: FunctionCallItem): any;
1018
+ export declare function functionCallItemDeserializer(item: any): FunctionCallItem;
1019
+ /** A function call output item within a conversation. */
1020
+ export interface FunctionCallOutputItem extends ConversationRequestItem {
1021
+ type: "function_call_output";
1022
+ callId: string;
1023
+ output: string;
1024
+ status?: ItemParamStatus;
1025
+ }
1026
+ export declare function functionCallOutputItemSerializer(item: FunctionCallOutputItem): any;
1027
+ export declare function functionCallOutputItemDeserializer(item: any): FunctionCallOutputItem;
1028
+ /**
1029
+ * Send this event to truncate a previous assistant message’s audio. The server
1030
+ * will produce audio faster than voicelive, so this event is useful when the user
1031
+ * interrupts to truncate audio that has already been sent to the client but not
1032
+ * yet played. This will synchronize the server's understanding of the audio with
1033
+ * the client's playback.
1034
+ * Truncating audio will delete the server-side text transcript to ensure there
1035
+ * is not text in the context that hasn't been heard by the user.
1036
+ * If successful, the server will respond with a `conversation.item.truncated`
1037
+ * event.
1038
+ */
1039
+ export interface ClientEventConversationItemTruncate extends ClientEvent {
1040
+ /** The event type, must be `conversation.item.truncate`. */
1041
+ type: "conversation.item.truncate";
1042
+ /**
1043
+ * The ID of the assistant message item to truncate. Only assistant message
1044
+ * items can be truncated.
1045
+ */
1046
+ itemId: string;
1047
+ /** The index of the content part to truncate. Set this to 0. */
1048
+ contentIndex: number;
1049
+ /**
1050
+ * Inclusive duration up to which audio is truncated, in milliseconds. If
1051
+ * the audio_end_ms is greater than the actual audio duration, the server
1052
+ * will respond with an error.
1053
+ */
1054
+ audioEndInMs: number;
1055
+ }
1056
+ export declare function clientEventConversationItemTruncateSerializer(item: ClientEventConversationItemTruncate): any;
1057
+ /**
1058
+ * Send this event when you want to remove any item from the conversation
1059
+ * history. The server will respond with a `conversation.item.deleted` event,
1060
+ * unless the item does not exist in the conversation history, in which case the
1061
+ * server will respond with an error.
1062
+ */
1063
+ export interface ClientEventConversationItemDelete extends ClientEvent {
1064
+ /** The event type, must be `conversation.item.delete`. */
1065
+ type: "conversation.item.delete";
1066
+ /** The ID of the item to delete. */
1067
+ itemId: string;
1068
+ }
1069
+ export declare function clientEventConversationItemDeleteSerializer(item: ClientEventConversationItemDelete): any;
1070
+ /**
1071
+ * This event instructs the server to create a Response, which means triggering
1072
+ * model inference. When in Server VAD mode, the server will create Responses
1073
+ * automatically.
1074
+ * A Response will include at least one Item, and may have two, in which case
1075
+ * the second will be a function call. These Items will be appended to the
1076
+ * conversation history.
1077
+ * The server will respond with a `response.created` event, events for Items
1078
+ * and content created, and finally a `response.done` event to indicate the
1079
+ * Response is complete.
1080
+ * The `response.create` event includes inference configuration like
1081
+ * `instructions`, and `temperature`. These fields will override the Session's
1082
+ * configuration for this Response only.
1083
+ */
1084
+ export interface ClientEventResponseCreate extends ClientEvent {
1085
+ /** The event type, must be `response.create`. */
1086
+ type: "response.create";
1087
+ response?: ResponseCreateParams;
1088
+ /** additional instructions (system prompt) appended to the default instructions of the session. Only affects this response only. */
1089
+ additionalInstructions?: string;
1090
+ }
1091
+ export declare function clientEventResponseCreateSerializer(item: ClientEventResponseCreate): any;
1092
+ /** Create a new VoiceLive response with these parameters */
1093
+ export interface ResponseCreateParams {
1094
+ /** Whether to commit the response to the conversation. Defaults to true. */
1095
+ commit?: boolean;
1096
+ /** Whether to cancel any ongoing generation before starting this one. Defaults to true. */
1097
+ cancelPrevious?: boolean;
1098
+ /** Input items to append to the conversation context before generating a response. */
1099
+ appendInputItems?: ConversationRequestItemUnion[];
1100
+ /**
1101
+ * Input items to be used as the context for this response.
1102
+ * An empty array clears previous context.
1103
+ */
1104
+ inputItems?: ConversationRequestItemUnion[];
1105
+ /**
1106
+ * The set of modalities the model can respond with. To disable audio,
1107
+ * set this to ["text"].
1108
+ */
1109
+ modalities?: Modality[];
1110
+ /**
1111
+ * The default system instructions (i.e. system message) prepended to model
1112
+ * calls. This field allows the client to guide the model on desired
1113
+ * responses. The model can be instructed on response content and format,
1114
+ * (e.g. "be extremely succinct", "act friendly", "here are examples of good
1115
+ * responses") and on audio behavior (e.g. "talk quickly", "inject emotion
1116
+ * into your voice", "laugh frequently"). The instructions are not guaranteed
1117
+ * to be followed by the model, but they provide guidance to the model on the
1118
+ * desired behavior.
1119
+ *
1120
+ * Note that the server sets default instructions which will be used if this
1121
+ * field is not set and are visible in the `session.created` event at the
1122
+ * start of the session.
1123
+ */
1124
+ instructions?: string;
1125
+ /** supported voice identifiers and configurations. */
1126
+ voice?: Voice;
1127
+ /** The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. */
1128
+ outputAudioFormat?: OutputAudioFormat;
1129
+ /** Tools (functions) available to the model. */
1130
+ tools?: ToolUnion[];
1131
+ /**
1132
+ * How the model chooses tools. Options are `auto`, `none`, `required`, or
1133
+ * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`.
1134
+ */
1135
+ toolChoice?: string;
1136
+ /** Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. */
1137
+ temperature?: number;
1138
+ /**
1139
+ * Maximum number of output tokens for a single assistant response,
1140
+ * inclusive of tool calls. Provide an integer between 1 and 4096 to
1141
+ * limit output tokens, or `inf` for the maximum available tokens for a
1142
+ * given model. Defaults to `inf`.
1143
+ */
1144
+ maxOutputTokens?: number | "inf";
1145
+ }
1146
+ export declare function responseCreateParamsSerializer(item: ResponseCreateParams): any;
1147
+ export declare function responseCreateParamsDeserializer(item: any): ResponseCreateParams;
1148
+ export declare function conversationRequestItemUnionArraySerializer(result: Array<ConversationRequestItemUnion>): any[];
1149
+ export declare function conversationRequestItemUnionArrayDeserializer(result: Array<ConversationRequestItemUnion>): any[];
1150
+ /** Alias for _ResponseCreateParamsMaxOutputTokens */
1151
+ export type _ResponseCreateParamsMaxOutputTokens = number | "inf";
1152
+ export declare function _responseCreateParamsMaxOutputTokensSerializer(item: _ResponseCreateParamsMaxOutputTokens): any;
1153
+ export declare function _responseCreateParamsMaxOutputTokensDeserializer(item: any): _ResponseCreateParamsMaxOutputTokens;
1154
+ /**
1155
+ * Send this event to cancel an in-progress response. The server will respond
1156
+ * with a `response.cancelled` event or an error if there is no response to
1157
+ * cancel.
1158
+ */
1159
+ export interface ClientEventResponseCancel extends ClientEvent {
1160
+ /** The event type, must be `response.cancel`. */
1161
+ type: "response.cancel";
1162
+ /**
1163
+ * A specific response ID to cancel - if not provided, will cancel an
1164
+ * in-progress response in the default conversation.
1165
+ */
1166
+ responseId?: string;
1167
+ }
1168
+ export declare function clientEventResponseCancelSerializer(item: ClientEventResponseCancel): any;
1169
+ /**
1170
+ * Send this event when you want to retrieve the server's representation of a specific item in the conversation history. This is useful, for example, to inspect user audio after noise cancellation and VAD.
1171
+ * The server will respond with a `conversation.item.retrieved` event,
1172
+ * unless the item does not exist in the conversation history, in which case the
1173
+ * server will respond with an error.
1174
+ */
1175
+ export interface ClientEventConversationItemRetrieve extends ClientEvent {
1176
+ /** The event type, must be `conversation.item.retrieve`. */
1177
+ type: "conversation.item.retrieve";
1178
+ /** The ID of the item to retrieve. */
1179
+ itemId: string;
1180
+ }
1181
+ export declare function clientEventConversationItemRetrieveSerializer(item: ClientEventConversationItemRetrieve): any;
1182
+ /** VoiceLive session object configuration. */
1183
+ export interface SessionBase {
1184
+ }
1185
+ export declare function sessionBaseDeserializer(item: any): SessionBase;
1186
+ /** The item to add to the conversation. */
1187
+ export interface ConversationItemBase {
1188
+ }
1189
+ export declare function conversationItemBaseSerializer(item: ConversationItemBase): any;
1190
+ /** The response resource. */
1191
+ export interface Response {
1192
+ /** The unique ID of the response. */
1193
+ id?: string;
1194
+ /** The object type, must be `realtime.response`. */
1195
+ object?: "realtime.response";
1196
+ /**
1197
+ * The final status of the response.
1198
+ *
1199
+ * One of: `completed`, `cancelled`, `failed`, `incomplete`, or `in_progress`.
1200
+ */
1201
+ status?: ResponseStatus;
1202
+ /** Additional details about the status. */
1203
+ statusDetails?: ResponseStatusDetailsUnion;
1204
+ /** The list of output items generated by the response. */
1205
+ output?: ResponseItemUnion[];
1206
+ /**
1207
+ * Usage statistics for the Response, this will correspond to billing. A
1208
+ * VoiceLive API session will maintain a conversation context and append new
1209
+ * Items to the Conversation, thus output from previous turns (text and
1210
+ * audio tokens) will become the input for later turns.
1211
+ */
1212
+ usage?: TokenUsage;
1213
+ /**
1214
+ * Which conversation the response is added to, determined by the `conversation`
1215
+ * field in the `response.create` event. If `auto`, the response will be added to
1216
+ * the default conversation and the value of `conversation_id` will be an id like
1217
+ * `conv_1234`. If `none`, the response will not be added to any conversation and
1218
+ * the value of `conversation_id` will be `null`. If responses are being triggered
1219
+ * by server VAD, the response will be added to the default conversation, thus
1220
+ * the `conversation_id` will be an id like `conv_1234`.
1221
+ */
1222
+ conversationId?: string;
1223
+ /** supported voice identifiers and configurations. */
1224
+ voice?: Voice;
1225
+ /**
1226
+ * The set of modalities the model used to respond. If there are multiple modalities,
1227
+ * the model will pick one, for example if `modalities` is `["text", "audio"]`, the model
1228
+ * could be responding in either text or audio.
1229
+ */
1230
+ modalities?: Modality[];
1231
+ /** The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. */
1232
+ outputAudioFormat?: OutputAudioFormat;
1233
+ /** Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. */
1234
+ temperature?: number;
1235
+ /**
1236
+ * Maximum number of output tokens for a single assistant response,
1237
+ * inclusive of tool calls, that was used in this response.
1238
+ */
1239
+ maxOutputTokens?: number | "inf";
1240
+ }
1241
+ export declare function responseDeserializer(item: any): Response;
1242
+ /** Terminal status of a response. */
1243
+ export declare enum KnownResponseStatus {
1244
+ /** completed */
1245
+ Completed = "completed",
1246
+ /** cancelled */
1247
+ Cancelled = "cancelled",
1248
+ /** failed */
1249
+ Failed = "failed",
1250
+ /** incomplete */
1251
+ Incomplete = "incomplete",
1252
+ /** in_progress */
1253
+ InProgress = "in_progress"
1254
+ }
1255
+ /**
1256
+ * Terminal status of a response. \
1257
+ * {@link KnownResponseStatus} can be used interchangeably with ResponseStatus,
1258
+ * this enum contains the known values that the service supports.
1259
+ * ### Known values supported by the service
1260
+ * **completed** \
1261
+ * **cancelled** \
1262
+ * **failed** \
1263
+ * **incomplete** \
1264
+ * **in_progress**
1265
+ */
1266
+ export type ResponseStatus = string;
1267
+ /** Base for all non-success response details. */
1268
+ export interface ResponseStatusDetails {
1269
+ type: ResponseStatus;
1270
+ }
1271
+ export declare function responseStatusDetailsDeserializer(item: any): ResponseStatusDetails;
1272
+ /** Alias for ResponseStatusDetailsUnion */
1273
+ export type ResponseStatusDetailsUnion = ResponseCancelledDetails | ResponseIncompleteDetails | ResponseFailedDetails | ResponseStatusDetails;
1274
+ export declare function responseStatusDetailsUnionDeserializer(item: any): ResponseStatusDetailsUnion;
1275
+ /** Details for a cancelled response. */
1276
+ export interface ResponseCancelledDetails extends ResponseStatusDetails {
1277
+ type: "cancelled";
1278
+ reason: string;
1279
+ }
1280
+ export declare function responseCancelledDetailsDeserializer(item: any): ResponseCancelledDetails;
1281
+ /** Details for an incomplete response. */
1282
+ export interface ResponseIncompleteDetails extends ResponseStatusDetails {
1283
+ type: "incomplete";
1284
+ reason: string;
1285
+ }
1286
+ export declare function responseIncompleteDetailsDeserializer(item: any): ResponseIncompleteDetails;
1287
+ /** Details for a failed response. */
1288
+ export interface ResponseFailedDetails extends ResponseStatusDetails {
1289
+ type: "failed";
1290
+ error: any;
1291
+ }
1292
+ export declare function responseFailedDetailsDeserializer(item: any): ResponseFailedDetails;
1293
+ export declare function responseItemUnionArrayDeserializer(result: Array<ResponseItemUnion>): any[];
1294
+ /** Base for any response item; discriminated by `type`. */
1295
+ export interface ResponseItem {
1296
+ type: ItemType;
1297
+ id?: string;
1298
+ object?: "realtime.item";
1299
+ }
1300
+ export declare function responseItemDeserializer(item: any): ResponseItem;
1301
+ /** Alias for ResponseItemUnion */
1302
+ export type ResponseItemUnion = ResponseMessageItem | ResponseFunctionCallItem | ResponseFunctionCallOutputItem | ResponseItem;
1303
+ export declare function responseItemUnionDeserializer(item: any): ResponseItemUnion;
1304
+ /** Base type for message item within a conversation. */
1305
+ export interface ResponseMessageItem extends ResponseItem {
1306
+ type: "message";
1307
+ role: MessageRole;
1308
+ content: ContentPartUnion[];
1309
+ status: ResponseItemStatus;
1310
+ }
1311
+ export declare function responseMessageItemDeserializer(item: any): ResponseMessageItem;
1312
+ export declare function contentPartUnionArraySerializer(result: Array<ContentPartUnion>): any[];
1313
+ export declare function contentPartUnionArrayDeserializer(result: Array<ContentPartUnion>): any[];
1314
+ /** Base for any content part; discriminated by `type`. */
1315
+ export interface ContentPart {
1316
+ type: ContentPartType;
1317
+ }
1318
+ export declare function contentPartSerializer(item: ContentPart): any;
1319
+ export declare function contentPartDeserializer(item: any): ContentPart;
1320
+ /** Alias for ContentPartUnion */
1321
+ export type ContentPartUnion = RequestTextContentPart | RequestAudioContentPart | ResponseTextContentPart | ResponseAudioContentPart | ContentPart;
1322
+ export declare function contentPartUnionSerializer(item: ContentPartUnion): any;
1323
+ export declare function contentPartUnionDeserializer(item: any): ContentPartUnion;
1324
+ /** A text content part for a request. */
1325
+ export interface RequestTextContentPart extends ContentPart {
1326
+ type: "input_text";
1327
+ text?: string;
1328
+ }
1329
+ export declare function requestTextContentPartSerializer(item: RequestTextContentPart): any;
1330
+ export declare function requestTextContentPartDeserializer(item: any): RequestTextContentPart;
1331
+ /** An audio content part for a request. */
1332
+ export interface RequestAudioContentPart extends ContentPart {
1333
+ type: "input_audio";
1334
+ transcript?: string;
1335
+ }
1336
+ export declare function requestAudioContentPartSerializer(item: RequestAudioContentPart): any;
1337
+ export declare function requestAudioContentPartDeserializer(item: any): RequestAudioContentPart;
1338
+ /** A text content part for a response. */
1339
+ export interface ResponseTextContentPart extends ContentPart {
1340
+ type: "text";
1341
+ text?: string;
1342
+ }
1343
+ export declare function responseTextContentPartDeserializer(item: any): ResponseTextContentPart;
1344
+ /** An audio content part for a response. */
1345
+ export interface ResponseAudioContentPart extends ContentPart {
1346
+ type: "audio";
1347
+ transcript?: string;
1348
+ }
1349
+ export declare function responseAudioContentPartDeserializer(item: any): ResponseAudioContentPart;
1350
+ /** Indicates the processing status of a response item. */
1351
+ export declare enum KnownResponseItemStatus {
1352
+ /** Item that is in progress. */
1353
+ InProgress = "in_progress",
1354
+ /** Item has been fully processed and is complete. */
1355
+ Completed = "completed",
1356
+ /** Item has been processed but is incomplete. */
1357
+ Incomplete = "incomplete"
1358
+ }
1359
+ /**
1360
+ * Indicates the processing status of a response item. \
1361
+ * {@link KnownResponseItemStatus} can be used interchangeably with ResponseItemStatus,
1362
+ * this enum contains the known values that the service supports.
1363
+ * ### Known values supported by the service
1364
+ * **in_progress**: Item that is in progress. \
1365
+ * **completed**: Item has been fully processed and is complete. \
1366
+ * **incomplete**: Item has been processed but is incomplete.
1367
+ */
1368
+ export type ResponseItemStatus = string;
1369
+ /** A function call item within a conversation. */
1370
+ export interface ResponseFunctionCallItem extends ResponseItem {
1371
+ type: "function_call";
1372
+ name: string;
1373
+ callId: string;
1374
+ arguments: string;
1375
+ status: ResponseItemStatus;
1376
+ }
1377
+ export declare function responseFunctionCallItemDeserializer(item: any): ResponseFunctionCallItem;
1378
+ /** A function call output item within a conversation. */
1379
+ export interface ResponseFunctionCallOutputItem extends ResponseItem {
1380
+ type: "function_call_output";
1381
+ callId: string;
1382
+ output: string;
1383
+ }
1384
+ export declare function responseFunctionCallOutputItemDeserializer(item: any): ResponseFunctionCallOutputItem;
1385
+ /** Overall usage statistics for a response. */
1386
+ export interface TokenUsage {
1387
+ /** Total number of tokens (input + output). */
1388
+ totalTokens: number;
1389
+ /** Number of input tokens. */
1390
+ inputTokens: number;
1391
+ /** Number of output tokens. */
1392
+ outputTokens: number;
1393
+ /** Detailed breakdown of input tokens. */
1394
+ inputTokenDetails: InputTokenDetails;
1395
+ /** Detailed breakdown of output tokens. */
1396
+ outputTokenDetails: OutputTokenDetails;
1397
+ }
1398
+ export declare function tokenUsageDeserializer(item: any): TokenUsage;
1399
+ /** Details of input token usage. */
1400
+ export interface InputTokenDetails {
1401
+ /** Number of cached tokens used in the input. */
1402
+ cachedTokens: number;
1403
+ /** Number of text tokens used in the input. */
1404
+ textTokens: number;
1405
+ /** Number of audio tokens used in the input. */
1406
+ audioTokens: number;
1407
+ /** Details of cached token usage. */
1408
+ cachedTokensDetails: CachedTokenDetails;
1409
+ }
1410
+ export declare function inputTokenDetailsDeserializer(item: any): InputTokenDetails;
1411
+ /** Details of output token usage. */
1412
+ export interface CachedTokenDetails {
1413
+ /** Number of cached text tokens. */
1414
+ textTokens: number;
1415
+ /** Number of cached audio tokens. */
1416
+ audioTokens: number;
1417
+ }
1418
+ export declare function cachedTokenDetailsDeserializer(item: any): CachedTokenDetails;
1419
+ /** Details of output token usage. */
1420
+ export interface OutputTokenDetails {
1421
+ /** Number of text tokens generated in the output. */
1422
+ textTokens: number;
1423
+ /** Number of audio tokens generated in the output. */
1424
+ audioTokens: number;
1425
+ }
1426
+ export declare function outputTokenDetailsDeserializer(item: any): OutputTokenDetails;
1427
+ /** Alias for _ResponseMaxOutputTokens */
1428
+ export type _ResponseMaxOutputTokens = number | "inf";
1429
+ export declare function _responseMaxOutputTokensDeserializer(item: any): _ResponseMaxOutputTokens;
1430
+ /** A voicelive server event. */
1431
+ export interface ServerEvent {
1432
+ /** The type of event. */
1433
+ /** The discriminator possible values: error, session.created, session.updated, session.avatar.connecting, input_audio_buffer.committed, input_audio_buffer.cleared, input_audio_buffer.speech_started, input_audio_buffer.speech_stopped, conversation.item.created, conversation.item.input_audio_transcription.completed, conversation.item.input_audio_transcription.failed, conversation.item.truncated, conversation.item.deleted, response.created, response.done, response.output_item.added, response.output_item.done, response.content_part.added, response.content_part.done, response.text.delta, response.text.done, response.audio_transcript.delta, response.audio_transcript.done, response.audio.delta, response.audio.done, response.animation_blendshapes.delta, response.animation_blendshapes.done, response.audio_timestamp.delta, response.audio_timestamp.done, response.animation_viseme.delta, response.animation_viseme.done, conversation.item.input_audio_transcription.delta, conversation.item.retrieved, response.function_call_arguments.delta, response.function_call_arguments.done */
1434
+ type: ServerEventType;
1435
+ eventId?: string;
1436
+ }
1437
+ export declare function serverEventDeserializer(item: any): ServerEvent;
1438
+ /** Alias for ServerEventUnion */
1439
+ export type ServerEventUnion = ServerEventError | ServerEventSessionCreated | ServerEventSessionUpdated | ServerEventSessionAvatarConnecting | ServerEventInputAudioBufferCommitted | ServerEventInputAudioBufferCleared | ServerEventInputAudioBufferSpeechStarted | ServerEventInputAudioBufferSpeechStopped | ServerEventConversationItemCreated | ServerEventConversationItemInputAudioTranscriptionCompleted | ServerEventConversationItemInputAudioTranscriptionFailed | ServerEventConversationItemTruncated | ServerEventConversationItemDeleted | ServerEventResponseCreated | ServerEventResponseDone | ServerEventResponseOutputItemAdded | ServerEventResponseOutputItemDone | ServerEventResponseContentPartAdded | ServerEventResponseContentPartDone | ServerEventResponseTextDelta | ServerEventResponseTextDone | ServerEventResponseAudioTranscriptDelta | ServerEventResponseAudioTranscriptDone | ServerEventResponseAudioDelta | ServerEventResponseAudioDone | ServerEventResponseAnimationBlendshapeDelta | ServerEventResponseAnimationBlendshapeDone | ServerEventResponseAudioTimestampDelta | ServerEventResponseAudioTimestampDone | ServerEventResponseAnimationVisemeDelta | ServerEventResponseAnimationVisemeDone | ServerEventConversationItemInputAudioTranscriptionDelta | ServerEventConversationItemRetrieved | ServerEventResponseFunctionCallArgumentsDelta | ServerEventResponseFunctionCallArgumentsDone | ServerEvent;
1440
+ export declare function serverEventUnionDeserializer(item: any): ServerEventUnion;
1441
+ /** Server event types used in VoiceLive protocol. */
1442
+ export declare enum KnownServerEventType {
1443
+ /** error */
1444
+ Error = "error",
1445
+ /** session.avatar.connecting */
1446
+ SessionAvatarConnecting = "session.avatar.connecting",
1447
+ /** session.created */
1448
+ SessionCreated = "session.created",
1449
+ /** session.updated */
1450
+ SessionUpdated = "session.updated",
1451
+ /** conversation.item.input_audio_transcription.completed */
1452
+ ConversationItemInputAudioTranscriptionCompleted = "conversation.item.input_audio_transcription.completed",
1453
+ /** conversation.item.input_audio_transcription.delta */
1454
+ ConversationItemInputAudioTranscriptionDelta = "conversation.item.input_audio_transcription.delta",
1455
+ /** conversation.item.input_audio_transcription.failed */
1456
+ ConversationItemInputAudioTranscriptionFailed = "conversation.item.input_audio_transcription.failed",
1457
+ /** conversation.item.created */
1458
+ ConversationItemCreated = "conversation.item.created",
1459
+ /** conversation.item.retrieved */
1460
+ ConversationItemRetrieved = "conversation.item.retrieved",
1461
+ /** conversation.item.truncated */
1462
+ ConversationItemTruncated = "conversation.item.truncated",
1463
+ /** conversation.item.deleted */
1464
+ ConversationItemDeleted = "conversation.item.deleted",
1465
+ /** input_audio_buffer.committed */
1466
+ InputAudioBufferCommitted = "input_audio_buffer.committed",
1467
+ /** input_audio_buffer.cleared */
1468
+ InputAudioBufferCleared = "input_audio_buffer.cleared",
1469
+ /** input_audio_buffer.speech_started */
1470
+ InputAudioBufferSpeechStarted = "input_audio_buffer.speech_started",
1471
+ /** input_audio_buffer.speech_stopped */
1472
+ InputAudioBufferSpeechStopped = "input_audio_buffer.speech_stopped",
1473
+ /** response.created */
1474
+ ResponseCreated = "response.created",
1475
+ /** response.done */
1476
+ ResponseDone = "response.done",
1477
+ /** response.output_item.added */
1478
+ ResponseOutputItemAdded = "response.output_item.added",
1479
+ /** response.output_item.done */
1480
+ ResponseOutputItemDone = "response.output_item.done",
1481
+ /** response.content_part.added */
1482
+ ResponseContentPartAdded = "response.content_part.added",
1483
+ /** response.content_part.done */
1484
+ ResponseContentPartDone = "response.content_part.done",
1485
+ /** response.text.delta */
1486
+ ResponseTextDelta = "response.text.delta",
1487
+ /** response.text.done */
1488
+ ResponseTextDone = "response.text.done",
1489
+ /** response.audio_transcript.delta */
1490
+ ResponseAudioTranscriptDelta = "response.audio_transcript.delta",
1491
+ /** response.audio_transcript.done */
1492
+ ResponseAudioTranscriptDone = "response.audio_transcript.done",
1493
+ /** response.audio.delta */
1494
+ ResponseAudioDelta = "response.audio.delta",
1495
+ /** response.audio.done */
1496
+ ResponseAudioDone = "response.audio.done",
1497
+ /** response.animation_blendshapes.delta */
1498
+ ResponseAnimationBlendshapesDelta = "response.animation_blendshapes.delta",
1499
+ /** response.animation_blendshapes.done */
1500
+ ResponseAnimationBlendshapesDone = "response.animation_blendshapes.done",
1501
+ /** response.audio_timestamp.delta */
1502
+ ResponseAudioTimestampDelta = "response.audio_timestamp.delta",
1503
+ /** response.audio_timestamp.done */
1504
+ ResponseAudioTimestampDone = "response.audio_timestamp.done",
1505
+ /** response.animation_viseme.delta */
1506
+ ResponseAnimationVisemeDelta = "response.animation_viseme.delta",
1507
+ /** response.animation_viseme.done */
1508
+ ResponseAnimationVisemeDone = "response.animation_viseme.done",
1509
+ /** response.function_call_arguments.delta */
1510
+ ResponseFunctionCallArgumentsDelta = "response.function_call_arguments.delta",
1511
+ /** response.function_call_arguments.done */
1512
+ ResponseFunctionCallArgumentsDone = "response.function_call_arguments.done"
1513
+ }
1514
+ /**
1515
+ * Server event types used in VoiceLive protocol. \
1516
+ * {@link KnownServerEventType} can be used interchangeably with ServerEventType,
1517
+ * this enum contains the known values that the service supports.
1518
+ * ### Known values supported by the service
1519
+ * **error** \
1520
+ * **session.avatar.connecting** \
1521
+ * **session.created** \
1522
+ * **session.updated** \
1523
+ * **conversation.item.input_audio_transcription.completed** \
1524
+ * **conversation.item.input_audio_transcription.delta** \
1525
+ * **conversation.item.input_audio_transcription.failed** \
1526
+ * **conversation.item.created** \
1527
+ * **conversation.item.retrieved** \
1528
+ * **conversation.item.truncated** \
1529
+ * **conversation.item.deleted** \
1530
+ * **input_audio_buffer.committed** \
1531
+ * **input_audio_buffer.cleared** \
1532
+ * **input_audio_buffer.speech_started** \
1533
+ * **input_audio_buffer.speech_stopped** \
1534
+ * **response.created** \
1535
+ * **response.done** \
1536
+ * **response.output_item.added** \
1537
+ * **response.output_item.done** \
1538
+ * **response.content_part.added** \
1539
+ * **response.content_part.done** \
1540
+ * **response.text.delta** \
1541
+ * **response.text.done** \
1542
+ * **response.audio_transcript.delta** \
1543
+ * **response.audio_transcript.done** \
1544
+ * **response.audio.delta** \
1545
+ * **response.audio.done** \
1546
+ * **response.animation_blendshapes.delta** \
1547
+ * **response.animation_blendshapes.done** \
1548
+ * **response.audio_timestamp.delta** \
1549
+ * **response.audio_timestamp.done** \
1550
+ * **response.animation_viseme.delta** \
1551
+ * **response.animation_viseme.done** \
1552
+ * **response.function_call_arguments.delta** \
1553
+ * **response.function_call_arguments.done**
1554
+ */
1555
+ export type ServerEventType = string;
1556
+ /**
1557
+ * Returned when an error occurs, which could be a client problem or a server
1558
+ * problem. Most errors are recoverable and the session will stay open, we
1559
+ * recommend to implementors to monitor and log error messages by default.
1560
+ */
1561
+ export interface ServerEventError extends ServerEvent {
1562
+ /** The event type, must be `error`. */
1563
+ type: "error";
1564
+ /** Details of the error. */
1565
+ error: ServerEventErrorDetails;
1566
+ }
1567
+ export declare function serverEventErrorDeserializer(item: any): ServerEventError;
1568
+ /** Details of the error. */
1569
+ export interface ServerEventErrorDetails {
1570
+ /** The type of error (e.g., "invalid_request_error", "server_error"). */
1571
+ type: string;
1572
+ /** Error code, if any. */
1573
+ code?: string;
1574
+ /** A human-readable error message. */
1575
+ message: string;
1576
+ /** Parameter related to the error, if any. */
1577
+ param?: string;
1578
+ /** The event_id of the client event that caused the error, if applicable. */
1579
+ eventId?: string;
1580
+ }
1581
+ export declare function serverEventErrorDetailsDeserializer(item: any): ServerEventErrorDetails;
1582
+ /**
1583
+ * Returned when a Session is created. Emitted automatically when a new
1584
+ * connection is established as the first server event. This event will contain
1585
+ * the default Session configuration.
1586
+ */
1587
+ export interface ServerEventSessionCreated extends ServerEvent {
1588
+ /** The event type, must be `session.created`. */
1589
+ type: "session.created";
1590
+ session: ResponseSession;
1591
+ }
1592
+ export declare function serverEventSessionCreatedDeserializer(item: any): ServerEventSessionCreated;
1593
+ /** Base for session configuration in the response. */
1594
+ export interface ResponseSession {
1595
+ /** The model for the session. */
1596
+ model?: string;
1597
+ /** The modalities to be used in the session. */
1598
+ modalities?: Modality[];
1599
+ /** The animation configuration for the session. */
1600
+ animation?: Animation;
1601
+ /** The voice configuration for the session. */
1602
+ voice?: Voice;
1603
+ /** Optional instructions to guide the model's behavior throughout the session. */
1604
+ instructions?: string;
1605
+ /**
1606
+ * Input audio sampling rate in Hz. Available values:
1607
+ *
1608
+ * - For pcm16: 8000, 16000, 24000
1609
+ *
1610
+ * - For g711_alaw/g711_ulaw: 8000
1611
+ */
1612
+ inputAudioSamplingRate?: number;
1613
+ /** Input audio format. Default is 'pcm16'. */
1614
+ inputAudioFormat?: InputAudioFormat;
1615
+ /** Output audio format. Default is 'pcm16'. */
1616
+ outputAudioFormat?: OutputAudioFormat;
1617
+ /** Type of turn detection to use. */
1618
+ turnDetection?: TurnDetectionUnion;
1619
+ /** Configuration for input audio noise reduction. */
1620
+ inputAudioNoiseReduction?: AudioNoiseReduction;
1621
+ /** Configuration for echo cancellation during server-side audio processing. */
1622
+ inputAudioEchoCancellation?: AudioEchoCancellation;
1623
+ /** Configuration for avatar streaming and behavior during the session. */
1624
+ avatar?: AvatarConfig;
1625
+ /** Configuration for input audio transcription. */
1626
+ inputAudioTranscription?: AudioInputTranscriptionOptions;
1627
+ /** Types of timestamps to include in audio response content. */
1628
+ outputAudioTimestampTypes?: AudioTimestampType[];
1629
+ /** Configuration for tools to be used during the session, if applicable. */
1630
+ tools?: ToolUnion[];
1631
+ /** Specifies which tools the model is allowed to call during the session. */
1632
+ toolChoice?: ToolChoice;
1633
+ /** Controls the randomness of the model's output. Range: 0.0 to 1.0. Default is 0.7. */
1634
+ temperature?: number;
1635
+ /** Maximum number of tokens to generate in the response. Default is unlimited. */
1636
+ maxResponseOutputTokens?: number | "inf";
1637
+ /** The agent configuration for the session, if applicable. */
1638
+ agent?: AgentConfig;
1639
+ /** The unique identifier for the session. */
1640
+ id?: string;
1641
+ }
1642
+ export declare function responseSessionSerializer(item: ResponseSession): any;
1643
+ export declare function responseSessionDeserializer(item: any): ResponseSession;
1644
+ /** Configuration for the agent. */
1645
+ export interface AgentConfig {
1646
+ /** The type of agent to use. */
1647
+ type: "agent";
1648
+ /** The name of the agent. */
1649
+ name: string;
1650
+ /** Optional description of the agent. */
1651
+ description?: string;
1652
+ /** The ID of the agent. */
1653
+ agentId: string;
1654
+ /** The ID of the conversation thread. */
1655
+ threadId: string;
1656
+ }
1657
+ export declare function agentConfigSerializer(item: AgentConfig): any;
1658
+ export declare function agentConfigDeserializer(item: any): AgentConfig;
1659
+ /**
1660
+ * Returned when a session is updated with a `session.update` event, unless
1661
+ * there is an error.
1662
+ */
1663
+ export interface ServerEventSessionUpdated extends ServerEvent {
1664
+ /** The event type, must be `session.updated`. */
1665
+ type: "session.updated";
1666
+ session: ResponseSession;
1667
+ }
1668
+ export declare function serverEventSessionUpdatedDeserializer(item: any): ServerEventSessionUpdated;
1669
+ /** Sent when the server is in the process of establishing an avatar media connection and provides its SDP answer. */
1670
+ export interface ServerEventSessionAvatarConnecting extends ServerEvent {
1671
+ /** The event type, must be 'session.avatar.connecting'. */
1672
+ type: "session.avatar.connecting";
1673
+ /** The server's SDP answer for the avatar connection. */
1674
+ serverSdp: string;
1675
+ }
1676
+ export declare function serverEventSessionAvatarConnectingDeserializer(item: any): ServerEventSessionAvatarConnecting;
1677
+ /**
1678
+ * Returned when an input audio buffer is committed, either by the client or
1679
+ * automatically in server VAD mode. The `item_id` property is the ID of the user
1680
+ * message item that will be created, thus a `conversation.item.created` event
1681
+ * will also be sent to the client.
1682
+ */
1683
+ export interface ServerEventInputAudioBufferCommitted extends ServerEvent {
1684
+ /** The event type, must be `input_audio_buffer.committed`. */
1685
+ type: "input_audio_buffer.committed";
1686
+ /** The ID of the preceding item after which the new item will be inserted. */
1687
+ previousItemId?: string;
1688
+ /** The ID of the user message item that will be created. */
1689
+ itemId: string;
1690
+ }
1691
+ export declare function serverEventInputAudioBufferCommittedDeserializer(item: any): ServerEventInputAudioBufferCommitted;
1692
+ /**
1693
+ * Returned when the input audio buffer is cleared by the client with a
1694
+ * `input_audio_buffer.clear` event.
1695
+ */
1696
+ export interface ServerEventInputAudioBufferCleared extends ServerEvent {
1697
+ /** The event type, must be `input_audio_buffer.cleared`. */
1698
+ type: "input_audio_buffer.cleared";
1699
+ }
1700
+ export declare function serverEventInputAudioBufferClearedDeserializer(item: any): ServerEventInputAudioBufferCleared;
1701
+ /**
1702
+ * Sent by the server when in `server_vad` mode to indicate that speech has been
1703
+ * detected in the audio buffer. This can happen any time audio is added to the
1704
+ * buffer (unless speech is already detected). The client may want to use this
1705
+ * event to interrupt audio playback or provide visual feedback to the user.
1706
+ * The client should expect to receive a `input_audio_buffer.speech_stopped` event
1707
+ * when speech stops. The `item_id` property is the ID of the user message item
1708
+ * that will be created when speech stops and will also be included in the
1709
+ * `input_audio_buffer.speech_stopped` event (unless the client manually commits
1710
+ * the audio buffer during VAD activation).
1711
+ */
1712
+ export interface ServerEventInputAudioBufferSpeechStarted extends ServerEvent {
1713
+ /** The event type, must be `input_audio_buffer.speech_started`. */
1714
+ type: "input_audio_buffer.speech_started";
1715
+ /**
1716
+ * Milliseconds from the start of all audio written to the buffer during the
1717
+ * session when speech was first detected. This will correspond to the
1718
+ * beginning of audio sent to the model, and thus includes the
1719
+ * `prefix_padding_ms` configured in the Session.
1720
+ */
1721
+ audioStartInMs: number;
1722
+ /** The ID of the user message item that will be created when speech stops. */
1723
+ itemId: string;
1724
+ }
1725
+ export declare function serverEventInputAudioBufferSpeechStartedDeserializer(item: any): ServerEventInputAudioBufferSpeechStarted;
1726
+ /**
1727
+ * Returned in `server_vad` mode when the server detects the end of speech in
1728
+ * the audio buffer. The server will also send an `conversation.item.created`
1729
+ * event with the user message item that is created from the audio buffer.
1730
+ */
1731
+ export interface ServerEventInputAudioBufferSpeechStopped extends ServerEvent {
1732
+ /** The event type, must be `input_audio_buffer.speech_stopped`. */
1733
+ type: "input_audio_buffer.speech_stopped";
1734
+ /**
1735
+ * Milliseconds since the session started when speech stopped. This will
1736
+ * correspond to the end of audio sent to the model, and thus includes the
1737
+ * `min_silence_duration_ms` configured in the Session.
1738
+ */
1739
+ audioEndInMs: number;
1740
+ /** The ID of the user message item that will be created. */
1741
+ itemId: string;
1742
+ }
1743
+ export declare function serverEventInputAudioBufferSpeechStoppedDeserializer(item: any): ServerEventInputAudioBufferSpeechStopped;
1744
+ /**
1745
+ * Returned when a conversation item is created. There are several scenarios that produce this event:
1746
+ * - The server is generating a Response, which if successful will produce
1747
+ * either one or two Items, which will be of type `message`
1748
+ * (role `assistant`) or type `function_call`.
1749
+ * - The input audio buffer has been committed, either by the client or the
1750
+ * server (in `server_vad` mode). The server will take the content of the
1751
+ * input audio buffer and add it to a new user message Item.
1752
+ * - The client has sent a `conversation.item.create` event to add a new Item
1753
+ * to the Conversation.
1754
+ */
1755
+ export interface ServerEventConversationItemCreated extends ServerEvent {
1756
+ /** The event type, must be `conversation.item.created`. */
1757
+ type: "conversation.item.created";
1758
+ /**
1759
+ * The ID of the preceding item in the Conversation context, allows the
1760
+ * client to understand the order of the conversation.
1761
+ */
1762
+ previousItemId?: string;
1763
+ item?: ResponseItemUnion;
1764
+ }
1765
+ export declare function serverEventConversationItemCreatedDeserializer(item: any): ServerEventConversationItemCreated;
1766
+ /**
1767
+ * This event is the output of audio transcription for user audio written to the
1768
+ * user audio buffer. Transcription begins when the input audio buffer is
1769
+ * committed by the client or server (in `server_vad` mode). Transcription runs
1770
+ * asynchronously with Response creation, so this event may come before or after
1771
+ * the Response events.
1772
+ * VoiceLive API models accept audio natively, and thus input transcription is a
1773
+ * separate process run on a separate ASR (Automatic Speech Recognition) model.
1774
+ * The transcript may diverge somewhat from the model's interpretation, and
1775
+ * should be treated as a rough guide.
1776
+ */
1777
+ export interface ServerEventConversationItemInputAudioTranscriptionCompleted extends ServerEvent {
1778
+ /**
1779
+ * The event type, must be
1780
+ * `conversation.item.input_audio_transcription.completed`.
1781
+ */
1782
+ type: "conversation.item.input_audio_transcription.completed";
1783
+ /** The ID of the user message item containing the audio. */
1784
+ itemId: string;
1785
+ /** The index of the content part containing the audio. */
1786
+ contentIndex: number;
1787
+ /** The transcribed text. */
1788
+ transcript: string;
1789
+ }
1790
+ export declare function serverEventConversationItemInputAudioTranscriptionCompletedDeserializer(item: any): ServerEventConversationItemInputAudioTranscriptionCompleted;
1791
+ /**
1792
+ * Returned when input audio transcription is configured, and a transcription
1793
+ * request for a user message failed. These events are separate from other
1794
+ * `error` events so that the client can identify the related Item.
1795
+ */
1796
+ export interface ServerEventConversationItemInputAudioTranscriptionFailed extends ServerEvent {
1797
+ /**
1798
+ * The event type, must be
1799
+ * `conversation.item.input_audio_transcription.failed`.
1800
+ */
1801
+ type: "conversation.item.input_audio_transcription.failed";
1802
+ /** The ID of the user message item. */
1803
+ itemId: string;
1804
+ /** The index of the content part containing the audio. */
1805
+ contentIndex: number;
1806
+ /** Details of the transcription error. */
1807
+ error: VoiceLiveErrorDetails;
1808
+ }
1809
+ export declare function serverEventConversationItemInputAudioTranscriptionFailedDeserializer(item: any): ServerEventConversationItemInputAudioTranscriptionFailed;
1810
+ /**
1811
+ * Returned when an earlier assistant audio message item is truncated by the
1812
+ * client with a `conversation.item.truncate` event. This event is used to
1813
+ * synchronize the server's understanding of the audio with the client's playback.
1814
+ * This action will truncate the audio and remove the server-side text transcript
1815
+ * to ensure there is no text in the context that hasn't been heard by the user.
1816
+ */
1817
+ export interface ServerEventConversationItemTruncated extends ServerEvent {
1818
+ /** The event type, must be `conversation.item.truncated`. */
1819
+ type: "conversation.item.truncated";
1820
+ /** The ID of the assistant message item that was truncated. */
1821
+ itemId: string;
1822
+ /** The index of the content part that was truncated. */
1823
+ contentIndex: number;
1824
+ /** The duration up to which the audio was truncated, in milliseconds. */
1825
+ audioEndInMs: number;
1826
+ eventId?: string;
1827
+ }
1828
+ export declare function serverEventConversationItemTruncatedDeserializer(item: any): ServerEventConversationItemTruncated;
1829
+ /**
1830
+ * Returned when an item in the conversation is deleted by the client with a
1831
+ * `conversation.item.delete` event. This event is used to synchronize the
1832
+ * server's understanding of the conversation history with the client's view.
1833
+ */
1834
+ export interface ServerEventConversationItemDeleted extends ServerEvent {
1835
+ /** The event type, must be `conversation.item.deleted`. */
1836
+ type: "conversation.item.deleted";
1837
+ /** The ID of the item that was deleted. */
1838
+ itemId: string;
1839
+ eventId?: string;
1840
+ }
1841
+ export declare function serverEventConversationItemDeletedDeserializer(item: any): ServerEventConversationItemDeleted;
1842
+ /**
1843
+ * Returned when a new Response is created. The first event of response creation,
1844
+ * where the response is in an initial state of `in_progress`.
1845
+ */
1846
+ export interface ServerEventResponseCreated extends ServerEvent {
1847
+ /** The event type, must be `response.created`. */
1848
+ type: "response.created";
1849
+ response: Response;
1850
+ }
1851
+ export declare function serverEventResponseCreatedDeserializer(item: any): ServerEventResponseCreated;
1852
+ /**
1853
+ * Returned when a Response is done streaming. Always emitted, no matter the
1854
+ * final state. The Response object included in the `response.done` event will
1855
+ * include all output Items in the Response but will omit the raw audio data.
1856
+ */
1857
+ export interface ServerEventResponseDone extends ServerEvent {
1858
+ /** The event type, must be `response.done`. */
1859
+ type: "response.done";
1860
+ response: Response;
1861
+ }
1862
+ export declare function serverEventResponseDoneDeserializer(item: any): ServerEventResponseDone;
1863
+ /** Returned when a new Item is created during Response generation. */
1864
+ export interface ServerEventResponseOutputItemAdded extends ServerEvent {
1865
+ /** The event type, must be `response.output_item.added`. */
1866
+ type: "response.output_item.added";
1867
+ /** The ID of the Response to which the item belongs. */
1868
+ responseId: string;
1869
+ /** The index of the output item in the Response. */
1870
+ outputIndex: number;
1871
+ item?: ResponseItemUnion;
1872
+ }
1873
+ export declare function serverEventResponseOutputItemAddedDeserializer(item: any): ServerEventResponseOutputItemAdded;
1874
+ /**
1875
+ * Returned when an Item is done streaming. Also emitted when a Response is
1876
+ * interrupted, incomplete, or cancelled.
1877
+ */
1878
+ export interface ServerEventResponseOutputItemDone extends ServerEvent {
1879
+ /** The event type, must be `response.output_item.done`. */
1880
+ type: "response.output_item.done";
1881
+ /** The ID of the Response to which the item belongs. */
1882
+ responseId: string;
1883
+ /** The index of the output item in the Response. */
1884
+ outputIndex: number;
1885
+ item?: ResponseItemUnion;
1886
+ }
1887
+ export declare function serverEventResponseOutputItemDoneDeserializer(item: any): ServerEventResponseOutputItemDone;
1888
+ /**
1889
+ * Returned when a new content part is added to an assistant message item during
1890
+ * response generation.
1891
+ */
1892
+ export interface ServerEventResponseContentPartAdded extends ServerEvent {
1893
+ /** The event type, must be `response.content_part.added`. */
1894
+ type: "response.content_part.added";
1895
+ /** The ID of the response. */
1896
+ responseId: string;
1897
+ /** The ID of the item to which the content part was added. */
1898
+ itemId: string;
1899
+ /** The index of the output item in the response. */
1900
+ outputIndex: number;
1901
+ /** The index of the content part in the item's content array. */
1902
+ contentIndex: number;
1903
+ /** The content part that was added. */
1904
+ part: ContentPartUnion;
1905
+ }
1906
+ export declare function serverEventResponseContentPartAddedDeserializer(item: any): ServerEventResponseContentPartAdded;
1907
+ /**
1908
+ * Returned when a content part is done streaming in an assistant message item.
1909
+ * Also emitted when a Response is interrupted, incomplete, or cancelled.
1910
+ */
1911
+ export interface ServerEventResponseContentPartDone extends ServerEvent {
1912
+ /** The event type, must be `response.content_part.done`. */
1913
+ type: "response.content_part.done";
1914
+ /** The ID of the response. */
1915
+ responseId: string;
1916
+ /** The ID of the item. */
1917
+ itemId: string;
1918
+ /** The index of the output item in the response. */
1919
+ outputIndex: number;
1920
+ /** The index of the content part in the item's content array. */
1921
+ contentIndex: number;
1922
+ /** The content part that is done. */
1923
+ part: ContentPartUnion;
1924
+ }
1925
+ export declare function serverEventResponseContentPartDoneDeserializer(item: any): ServerEventResponseContentPartDone;
1926
+ /** Returned when the text value of a "text" content part is updated. */
1927
+ export interface ServerEventResponseTextDelta extends ServerEvent {
1928
+ /** The event type, must be `response.text.delta`. */
1929
+ type: "response.text.delta";
1930
+ /** The ID of the response. */
1931
+ responseId: string;
1932
+ /** The ID of the item. */
1933
+ itemId: string;
1934
+ /** The index of the output item in the response. */
1935
+ outputIndex: number;
1936
+ /** The index of the content part in the item's content array. */
1937
+ contentIndex: number;
1938
+ /** The text delta. */
1939
+ delta: string;
1940
+ }
1941
+ export declare function serverEventResponseTextDeltaDeserializer(item: any): ServerEventResponseTextDelta;
1942
+ /**
1943
+ * Returned when the text value of a "text" content part is done streaming. Also
1944
+ * emitted when a Response is interrupted, incomplete, or cancelled.
1945
+ */
1946
+ export interface ServerEventResponseTextDone extends ServerEvent {
1947
+ /** The event type, must be `response.text.done`. */
1948
+ type: "response.text.done";
1949
+ /** The ID of the response. */
1950
+ responseId: string;
1951
+ /** The ID of the item. */
1952
+ itemId: string;
1953
+ /** The index of the output item in the response. */
1954
+ outputIndex: number;
1955
+ /** The index of the content part in the item's content array. */
1956
+ contentIndex: number;
1957
+ /** The final text content. */
1958
+ text: string;
1959
+ }
1960
+ export declare function serverEventResponseTextDoneDeserializer(item: any): ServerEventResponseTextDone;
1961
+ /** Returned when the model-generated transcription of audio output is updated. */
1962
+ export interface ServerEventResponseAudioTranscriptDelta extends ServerEvent {
1963
+ /** The event type, must be `response.audio_transcript.delta`. */
1964
+ type: "response.audio_transcript.delta";
1965
+ /** The ID of the response. */
1966
+ responseId: string;
1967
+ /** The ID of the item. */
1968
+ itemId: string;
1969
+ /** The index of the output item in the response. */
1970
+ outputIndex: number;
1971
+ /** The index of the content part in the item's content array. */
1972
+ contentIndex: number;
1973
+ /** The transcript delta. */
1974
+ delta: string;
1975
+ }
1976
+ export declare function serverEventResponseAudioTranscriptDeltaDeserializer(item: any): ServerEventResponseAudioTranscriptDelta;
1977
+ /**
1978
+ * Returned when the model-generated transcription of audio output is done
1979
+ * streaming. Also emitted when a Response is interrupted, incomplete, or
1980
+ * cancelled.
1981
+ */
1982
+ export interface ServerEventResponseAudioTranscriptDone extends ServerEvent {
1983
+ /** The event type, must be `response.audio_transcript.done`. */
1984
+ type: "response.audio_transcript.done";
1985
+ /** The ID of the response. */
1986
+ responseId: string;
1987
+ /** The ID of the item. */
1988
+ itemId: string;
1989
+ /** The index of the output item in the response. */
1990
+ outputIndex: number;
1991
+ /** The index of the content part in the item's content array. */
1992
+ contentIndex: number;
1993
+ /** The final transcript of the audio. */
1994
+ transcript: string;
1995
+ }
1996
+ export declare function serverEventResponseAudioTranscriptDoneDeserializer(item: any): ServerEventResponseAudioTranscriptDone;
1997
+ /** Returned when the model-generated audio is updated. */
1998
+ export interface ServerEventResponseAudioDelta extends ServerEvent {
1999
+ /** The event type, must be `response.audio.delta`. */
2000
+ type: "response.audio.delta";
2001
+ /** The ID of the response. */
2002
+ responseId: string;
2003
+ /** The ID of the item. */
2004
+ itemId: string;
2005
+ /** The index of the output item in the response. */
2006
+ outputIndex: number;
2007
+ /** The index of the content part in the item's content array. */
2008
+ contentIndex: number;
2009
+ /** Base64-encoded audio data delta. */
2010
+ delta: Uint8Array;
2011
+ }
2012
+ export declare function serverEventResponseAudioDeltaDeserializer(item: any): ServerEventResponseAudioDelta;
2013
+ /**
2014
+ * Returned when the model-generated audio is done. Also emitted when a Response
2015
+ * is interrupted, incomplete, or cancelled.
2016
+ */
2017
+ export interface ServerEventResponseAudioDone extends ServerEvent {
2018
+ /** The event type, must be `response.audio.done`. */
2019
+ type: "response.audio.done";
2020
+ /** The ID of the response. */
2021
+ responseId: string;
2022
+ /** The ID of the item. */
2023
+ itemId: string;
2024
+ /** The index of the output item in the response. */
2025
+ outputIndex: number;
2026
+ /** The index of the content part in the item's content array. */
2027
+ contentIndex: number;
2028
+ }
2029
+ export declare function serverEventResponseAudioDoneDeserializer(item: any): ServerEventResponseAudioDone;
2030
+ /** Represents a delta update of blendshape animation frames for a specific output of a response. */
2031
+ export interface ServerEventResponseAnimationBlendshapeDelta extends ServerEvent {
2032
+ type: "response.animation_blendshapes.delta";
2033
+ responseId: string;
2034
+ itemId: string;
2035
+ outputIndex: number;
2036
+ contentIndex: number;
2037
+ frames: number[][] | string;
2038
+ frameIndex: number;
2039
+ }
2040
+ export declare function serverEventResponseAnimationBlendshapeDeltaDeserializer(item: any): ServerEventResponseAnimationBlendshapeDelta;
2041
+ /** Alias for _ServerEventResponseAnimationBlendshapeDeltaFrames */
2042
+ export type _ServerEventResponseAnimationBlendshapeDeltaFrames = number[][] | string;
2043
+ export declare function _serverEventResponseAnimationBlendshapeDeltaFramesDeserializer(item: any): _ServerEventResponseAnimationBlendshapeDeltaFrames;
2044
+ /** Indicates the completion of blendshape animation processing for a specific output of a response. */
2045
+ export interface ServerEventResponseAnimationBlendshapeDone extends ServerEvent {
2046
+ type: "response.animation_blendshapes.done";
2047
+ responseId: string;
2048
+ itemId: string;
2049
+ outputIndex: number;
2050
+ }
2051
+ export declare function serverEventResponseAnimationBlendshapeDoneDeserializer(item: any): ServerEventResponseAnimationBlendshapeDone;
2052
+ /** Represents a word-level audio timestamp delta for a response. */
2053
+ export interface ServerEventResponseAudioTimestampDelta extends ServerEvent {
2054
+ type: "response.audio_timestamp.delta";
2055
+ responseId: string;
2056
+ itemId: string;
2057
+ outputIndex: number;
2058
+ contentIndex: number;
2059
+ audioOffsetInMs: number;
2060
+ audioDurationInMs: number;
2061
+ text: string;
2062
+ timestampType: "word";
2063
+ }
2064
+ export declare function serverEventResponseAudioTimestampDeltaDeserializer(item: any): ServerEventResponseAudioTimestampDelta;
2065
+ /** Indicates completion of audio timestamp delivery for a response. */
2066
+ export interface ServerEventResponseAudioTimestampDone extends ServerEvent {
2067
+ type: "response.audio_timestamp.done";
2068
+ responseId: string;
2069
+ itemId: string;
2070
+ outputIndex: number;
2071
+ contentIndex: number;
2072
+ }
2073
+ export declare function serverEventResponseAudioTimestampDoneDeserializer(item: any): ServerEventResponseAudioTimestampDone;
2074
+ /** Represents a viseme ID delta update for animation based on audio. */
2075
+ export interface ServerEventResponseAnimationVisemeDelta extends ServerEvent {
2076
+ type: "response.animation_viseme.delta";
2077
+ responseId: string;
2078
+ itemId: string;
2079
+ outputIndex: number;
2080
+ contentIndex: number;
2081
+ audioOffsetInMs: number;
2082
+ visemeId: number;
2083
+ }
2084
+ export declare function serverEventResponseAnimationVisemeDeltaDeserializer(item: any): ServerEventResponseAnimationVisemeDelta;
2085
+ /** Indicates completion of viseme animation delivery for a response. */
2086
+ export interface ServerEventResponseAnimationVisemeDone extends ServerEvent {
2087
+ type: "response.animation_viseme.done";
2088
+ responseId: string;
2089
+ itemId: string;
2090
+ outputIndex: number;
2091
+ contentIndex: number;
2092
+ }
2093
+ export declare function serverEventResponseAnimationVisemeDoneDeserializer(item: any): ServerEventResponseAnimationVisemeDone;
2094
+ /** Returned when the text value of an input audio transcription content part is updated. */
2095
+ export interface ServerEventConversationItemInputAudioTranscriptionDelta extends ServerEvent {
2096
+ /** The event type, must be `conversation.item.input_audio_transcription.delta`. */
2097
+ type: "conversation.item.input_audio_transcription.delta";
2098
+ /** The ID of the item. */
2099
+ itemId: string;
2100
+ /** The index of the content part in the item's content array. */
2101
+ contentIndex?: number;
2102
+ /** The text delta. */
2103
+ delta?: string;
2104
+ /** The log probabilities of the transcription. */
2105
+ logprobs?: LogProbProperties[];
2106
+ }
2107
+ export declare function serverEventConversationItemInputAudioTranscriptionDeltaDeserializer(item: any): ServerEventConversationItemInputAudioTranscriptionDelta;
2108
+ export declare function logProbPropertiesArrayDeserializer(result: Array<LogProbProperties>): any[];
2109
+ /** Returned when a conversation item is retrieved with `conversation.item.retrieve`. */
2110
+ export interface ServerEventConversationItemRetrieved extends ServerEvent {
2111
+ /** The event type, must be `conversation.item.retrieved`. */
2112
+ type: "conversation.item.retrieved";
2113
+ item?: ResponseItemUnion;
2114
+ eventId?: string;
2115
+ }
2116
+ export declare function serverEventConversationItemRetrievedDeserializer(item: any): ServerEventConversationItemRetrieved;
2117
+ /** Returned when the model-generated function call arguments are updated. */
2118
+ export interface ServerEventResponseFunctionCallArgumentsDelta extends ServerEvent {
2119
+ /** The event type, must be `response.function_call_arguments.delta`. */
2120
+ type: "response.function_call_arguments.delta";
2121
+ /** The ID of the response. */
2122
+ responseId: string;
2123
+ /** The ID of the function call item. */
2124
+ itemId: string;
2125
+ /** The index of the output item in the response. */
2126
+ outputIndex: number;
2127
+ /** The ID of the function call. */
2128
+ callId: string;
2129
+ /** The arguments delta as a JSON string. */
2130
+ delta: string;
2131
+ }
2132
+ export declare function serverEventResponseFunctionCallArgumentsDeltaDeserializer(item: any): ServerEventResponseFunctionCallArgumentsDelta;
2133
+ /**
2134
+ * Returned when the model-generated function call arguments are done streaming.
2135
+ * Also emitted when a Response is interrupted, incomplete, or cancelled.
2136
+ */
2137
+ export interface ServerEventResponseFunctionCallArgumentsDone extends ServerEvent {
2138
+ /** The event type, must be `response.function_call_arguments.done`. */
2139
+ type: "response.function_call_arguments.done";
2140
+ /** The ID of the response. */
2141
+ responseId: string;
2142
+ /** The ID of the function call item. */
2143
+ itemId: string;
2144
+ /** The index of the output item in the response. */
2145
+ outputIndex: number;
2146
+ /** The ID of the function call. */
2147
+ callId: string;
2148
+ /** The final arguments as a JSON string. */
2149
+ arguments: string;
2150
+ /** The name of the function call. */
2151
+ name: string;
2152
+ }
2153
+ export declare function serverEventResponseFunctionCallArgumentsDoneDeserializer(item: any): ServerEventResponseFunctionCallArgumentsDone;
2154
+ //# sourceMappingURL=models.d.ts.map