153
153
* @property {ItemType[] } output
154
154
* @property {UsageType|null } usage
155
155
*/
156
+ /**
157
+ * RealtimeClient Settings
158
+ * @typedef {Object } RealtimeClientSettings
159
+ * @property {string } [url] - The URL for the realtime client
160
+ * @property {string } [apiKey] - The API key
161
+ * @property {string } [model] - The model name to use
162
+ * @property {boolean } [dangerouslyAllowAPIKeyInBrowser] - Whether to allow API key in browser
163
+ * @property {boolean } [debug] - Enable debug mode
164
+ */
156
165
/**
157
166
* RealtimeClient Class
158
167
* @class
159
168
*/
160
169
export class RealtimeClient extends RealtimeEventHandler {
161
170
/**
162
171
* Create a new RealtimeClient instance
163
- * @param {{url?: string, apiKey?: string, dangerouslyAllowAPIKeyInBrowser?: boolean, debug?: boolean} } [settings]
172
+ * @param {RealtimeClientSettings } [settings]
164
173
*/
165
- constructor ( { url, apiKey, dangerouslyAllowAPIKeyInBrowser, debug } ?: {
166
- url ?: string ;
167
- apiKey ?: string ;
168
- dangerouslyAllowAPIKeyInBrowser ?: boolean ;
169
- debug ?: boolean ;
170
- } ) ;
174
+ constructor ( { url, apiKey, model, dangerouslyAllowAPIKeyInBrowser, debug, } ?: RealtimeClientSettings ) ;
171
175
defaultSessionConfig : {
172
176
modalities : string [ ] ;
173
177
instructions : string ;
@@ -181,6 +185,7 @@ export class RealtimeClient extends RealtimeEventHandler {
181
185
temperature : number ;
182
186
max_response_output_tokens : number ;
183
187
} ;
188
+ realtimeModel : string ;
184
189
sessionConfig : { } ;
185
190
transcriptionModels : {
186
191
model : string ;
@@ -336,8 +341,7 @@ export type SessionResourceType = {
336
341
model ?: string ;
337
342
modalities ?: string [ ] ;
338
343
instructions ?: string ;
339
- voice ?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "sage" | "shimmer" | "verse" ;
340
-
344
+ voice ?: "alloy" | "ash" | "ballad" | "coral" | "echo" | "sage" | "shimmer" | "verse" ;
341
345
input_audio_format ?: AudioFormatType ;
342
346
output_audio_format ?: AudioFormatType ;
343
347
input_audio_transcription ?: AudioTranscriptionType | null ;
@@ -454,7 +458,32 @@ export type ResponseResourceType = {
454
458
output : ItemType [ ] ;
455
459
usage : UsageType | null ;
456
460
} ;
461
+ /**
462
+ * RealtimeClient Settings
463
+ */
464
+ export type RealtimeClientSettings = {
465
+ /**
466
+ * - The URL for the realtime client
467
+ */
468
+ url ?: string ;
469
+ /**
470
+ * - The API key
471
+ */
472
+ apiKey ?: string ;
473
+ /**
474
+ * - The model name to use
475
+ */
476
+ model ?: string ;
477
+ /**
478
+ * - Whether to allow API key in browser
479
+ */
480
+ dangerouslyAllowAPIKeyInBrowser ?: boolean ;
481
+ /**
482
+ * - Enable debug mode
483
+ */
484
+ debug ?: boolean ;
485
+ } ;
457
486
import { RealtimeEventHandler } from './event_handler.js' ;
458
487
import { RealtimeAPI } from './api.js' ;
459
488
import { RealtimeConversation } from './conversation.js' ;
460
- //# sourceMappingURL=client.d.ts.map
489
+ //# sourceMappingURL=client.d.ts.map
0 commit comments