@livekit/agents-plugin-openai 1.9.2 → 1.9.3
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.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/models.cjs.map +1 -1
- package/dist/models.d.cts +1 -0
- package/dist/models.d.ts +1 -0
- package/dist/models.d.ts.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/realtime/api_proto.cjs +3 -21
- package/dist/realtime/api_proto.cjs.map +1 -1
- package/dist/realtime/api_proto.d.cts +1 -504
- package/dist/realtime/api_proto.d.ts +1 -504
- package/dist/realtime/api_proto.d.ts.map +1 -1
- package/dist/realtime/api_proto.js +1 -12
- package/dist/realtime/api_proto.js.map +1 -1
- package/dist/realtime/gpt_live_model.cjs +7 -851
- package/dist/realtime/gpt_live_model.cjs.map +1 -1
- package/dist/realtime/gpt_live_model.d.cts +6 -178
- package/dist/realtime/gpt_live_model.d.ts +6 -178
- package/dist/realtime/gpt_live_model.d.ts.map +1 -1
- package/dist/realtime/gpt_live_model.js +7 -850
- package/dist/realtime/gpt_live_model.js.map +1 -1
- package/dist/realtime/gpt_live_model.test.cjs +32 -1
- package/dist/realtime/gpt_live_model.test.cjs.map +1 -1
- package/dist/realtime/gpt_live_model.test.js +32 -1
- package/dist/realtime/gpt_live_model.test.js.map +1 -1
- package/dist/realtime/gpt_live_types.cjs +6 -0
- package/dist/realtime/gpt_live_types.cjs.map +1 -1
- package/dist/realtime/gpt_live_types.d.cts +1 -169
- package/dist/realtime/gpt_live_types.d.ts +1 -169
- package/dist/realtime/gpt_live_types.d.ts.map +1 -1
- package/dist/realtime/gpt_live_types.js +1 -0
- package/dist/realtime/gpt_live_types.js.map +1 -1
- package/dist/realtime/index.cjs +8 -1
- package/dist/realtime/index.cjs.map +1 -1
- package/dist/realtime/index.d.cts +5 -0
- package/dist/realtime/index.d.ts +5 -0
- package/dist/realtime/index.d.ts.map +1 -1
- package/dist/realtime/index.js +6 -1
- package/dist/realtime/index.js.map +1 -1
- package/dist/realtime/realtime_model.cjs +3 -1890
- package/dist/realtime/realtime_model.cjs.map +1 -1
- package/dist/realtime/realtime_model.d.cts +1 -236
- package/dist/realtime/realtime_model.d.ts +1 -236
- package/dist/realtime/realtime_model.d.ts.map +1 -1
- package/dist/realtime/realtime_model.js +1 -1886
- package/dist/realtime/realtime_model.js.map +1 -1
- package/dist/realtime/realtime_model.test.cjs +11 -1141
- package/dist/realtime/realtime_model.test.cjs.map +1 -1
- package/dist/realtime/realtime_model.test.js +16 -1147
- package/dist/realtime/realtime_model.test.js.map +1 -1
- package/package.json +5 -6
- package/src/models.ts +2 -0
- package/src/realtime/api_proto.ts +2 -715
- package/src/realtime/gpt_live_model.test.ts +42 -1
- package/src/realtime/gpt_live_model.ts +17 -1030
- package/src/realtime/gpt_live_types.ts +1 -136
- package/src/realtime/index.ts +7 -0
- package/src/realtime/realtime_model.test.ts +17 -1454
- package/src/realtime/realtime_model.ts +2 -2408
|
@@ -1,505 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const NUM_CHANNELS = 1;
|
|
3
|
-
export declare const IN_FRAME_SIZE = 2400;
|
|
4
|
-
export declare const OUT_FRAME_SIZE = 1200;
|
|
5
|
-
export declare const BASE_URL = "wss://api.openai.com/v1";
|
|
6
|
-
export type Model = 'gpt-4o-realtime-preview-2024-10-01' | string;
|
|
7
|
-
/**
|
|
8
|
-
* Models that support the `reasoning` configuration on the Realtime API.
|
|
9
|
-
* Currently only the `gpt-realtime-2` family supports it.
|
|
10
|
-
*
|
|
11
|
-
* Ref: https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/accept
|
|
12
|
-
*/
|
|
13
|
-
export type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
14
|
-
export interface Reasoning {
|
|
15
|
-
effort?: ReasoningEffort;
|
|
16
|
-
}
|
|
17
|
-
export type Voice = 'alloy' | 'shimmer' | 'echo' | 'ash' | 'ballad' | 'coral' | 'sage' | 'verse' | string;
|
|
18
|
-
/** @deprecated Use LegacyAudioFormat for Beta API string format or AudioFormat for GA API object format */
|
|
19
|
-
export type LegacyAudioFormat = 'pcm16';
|
|
20
|
-
export type Role = 'system' | 'assistant' | 'user' | 'tool';
|
|
21
|
-
export type GenerationFinishedReason = 'stop' | 'max_tokens' | 'content_filter' | 'interrupt';
|
|
22
|
-
export type InputTranscriptionModel = 'whisper-1' | string;
|
|
23
|
-
export type Modality = 'text' | 'audio';
|
|
24
|
-
export type ToolChoice = 'auto' | 'none' | 'required' | string;
|
|
25
|
-
export type State = 'initializing' | 'listening' | 'thinking' | 'speaking' | string;
|
|
26
|
-
export type ResponseStatus = 'in_progress' | 'completed' | 'incomplete' | 'cancelled' | 'failed' | string;
|
|
27
|
-
export type ClientEventType = 'session.update' | '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';
|
|
28
|
-
export type ServerEventType = 'error' | 'session.created' | 'session.updated' | 'conversation.created' | 'input_audio_buffer.committed' | 'input_audio_buffer.cleared' | 'input_audio_buffer.speech_started' | 'input_audio_buffer.speech_stopped' | 'conversation.item.added' | 'conversation.item.created' | 'conversation.item.input_audio_transcription.delta' | '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.output_text.delta' | 'response.output_text.done' | 'response.text.delta' | 'response.text.done' | 'response.output_audio_transcript.delta' | 'response.output_audio_transcript.done' | 'response.audio_transcript.delta' | 'response.audio_transcript.done' | 'response.output_audio.delta' | 'response.output_audio.done' | 'response.audio.delta' | 'response.audio.done' | 'response.function_call_arguments.delta' | 'response.function_call_arguments.done' | 'rate_limits.updated';
|
|
29
|
-
export type AudioBase64Bytes = string;
|
|
30
|
-
export interface Tool {
|
|
31
|
-
type: 'function';
|
|
32
|
-
name: string;
|
|
33
|
-
description?: string;
|
|
34
|
-
parameters: {
|
|
35
|
-
type: 'object';
|
|
36
|
-
properties: {
|
|
37
|
-
[prop: string]: {
|
|
38
|
-
[prop: string]: any;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
required: string[];
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
export type TurnDetectionType = {
|
|
45
|
-
type: 'semantic_vad';
|
|
46
|
-
eagerness?: 'auto' | 'low' | 'medium' | 'high';
|
|
47
|
-
create_response?: boolean;
|
|
48
|
-
interrupt_response?: boolean;
|
|
49
|
-
} | {
|
|
50
|
-
type: 'server_vad';
|
|
51
|
-
threshold?: number;
|
|
52
|
-
prefix_padding_ms?: number;
|
|
53
|
-
silence_duration_ms?: number;
|
|
54
|
-
create_response?: boolean;
|
|
55
|
-
interrupt_response?: boolean;
|
|
56
|
-
};
|
|
57
|
-
export type InputAudioTranscription = {
|
|
58
|
-
model: InputTranscriptionModel;
|
|
59
|
-
language?: string;
|
|
60
|
-
languages?: string[];
|
|
61
|
-
keywords?: string[];
|
|
62
|
-
prompt?: string;
|
|
63
|
-
};
|
|
64
|
-
export type NoiseReductionType = 'near_field' | 'far_field';
|
|
65
|
-
export interface NoiseReduction {
|
|
66
|
-
type: NoiseReductionType;
|
|
67
|
-
}
|
|
68
|
-
export interface AudioFormat {
|
|
69
|
-
type: 'audio/pcm';
|
|
70
|
-
rate: number;
|
|
71
|
-
}
|
|
72
|
-
export interface RealtimeAudioConfigInput {
|
|
73
|
-
format?: AudioFormat;
|
|
74
|
-
noise_reduction?: NoiseReduction | null;
|
|
75
|
-
transcription?: InputAudioTranscription | null;
|
|
76
|
-
turn_detection?: TurnDetectionType | null;
|
|
77
|
-
}
|
|
78
|
-
export interface RealtimeAudioConfigOutput {
|
|
79
|
-
format?: AudioFormat;
|
|
80
|
-
speed?: number;
|
|
81
|
-
voice?: Voice;
|
|
82
|
-
}
|
|
83
|
-
export interface RealtimeAudioConfig {
|
|
84
|
-
input?: RealtimeAudioConfigInput;
|
|
85
|
-
output?: RealtimeAudioConfigOutput;
|
|
86
|
-
}
|
|
87
|
-
export interface InputTextContent {
|
|
88
|
-
type: 'input_text';
|
|
89
|
-
text: string;
|
|
90
|
-
}
|
|
91
|
-
export interface InputAudioContent {
|
|
92
|
-
type: 'input_audio';
|
|
93
|
-
audio: AudioBase64Bytes;
|
|
94
|
-
}
|
|
95
|
-
export interface InputImageContent {
|
|
96
|
-
type: 'input_image';
|
|
97
|
-
image_url: string;
|
|
98
|
-
}
|
|
99
|
-
export interface TextContent {
|
|
100
|
-
type: 'text';
|
|
101
|
-
text: string;
|
|
102
|
-
}
|
|
103
|
-
export interface OutputTextContent {
|
|
104
|
-
type: 'output_text';
|
|
105
|
-
text: string;
|
|
106
|
-
}
|
|
107
|
-
export interface AudioContent {
|
|
108
|
-
type: 'audio';
|
|
109
|
-
audio: AudioBase64Bytes;
|
|
110
|
-
transcript: string;
|
|
111
|
-
}
|
|
112
|
-
export type Content = InputTextContent | InputAudioContent | InputImageContent | TextContent | OutputTextContent | AudioContent;
|
|
113
|
-
export type ContentPart = {
|
|
114
|
-
type: 'text' | 'audio' | 'output_text' | 'output_audio';
|
|
115
|
-
audio?: AudioBase64Bytes;
|
|
116
|
-
transcript?: string;
|
|
117
|
-
text?: string;
|
|
118
|
-
};
|
|
119
|
-
export interface BaseItem {
|
|
120
|
-
id: string;
|
|
121
|
-
object: 'realtime.item';
|
|
122
|
-
type: string;
|
|
123
|
-
}
|
|
124
|
-
export interface SystemItem extends BaseItem {
|
|
125
|
-
type: 'message';
|
|
126
|
-
role: 'system';
|
|
127
|
-
content: InputTextContent;
|
|
128
|
-
}
|
|
129
|
-
export interface UserItem extends BaseItem {
|
|
130
|
-
type: 'message';
|
|
131
|
-
role: 'user';
|
|
132
|
-
content: (InputTextContent | InputAudioContent | InputImageContent)[];
|
|
133
|
-
}
|
|
134
|
-
export interface AssistantItem extends BaseItem {
|
|
135
|
-
type: 'message';
|
|
136
|
-
role: 'assistant';
|
|
137
|
-
content: (TextContent | OutputTextContent | AudioContent)[];
|
|
138
|
-
}
|
|
139
|
-
export interface FunctionCallItem extends BaseItem {
|
|
140
|
-
type: 'function_call';
|
|
141
|
-
call_id: string;
|
|
142
|
-
name: string;
|
|
143
|
-
arguments: string;
|
|
144
|
-
}
|
|
145
|
-
export interface FunctionCallOutputItem extends BaseItem {
|
|
146
|
-
type: 'function_call_output';
|
|
147
|
-
call_id: string;
|
|
148
|
-
output: string;
|
|
149
|
-
}
|
|
150
|
-
export type ItemResource = SystemItem | UserItem | AssistantItem | FunctionCallItem | FunctionCallOutputItem;
|
|
151
|
-
export interface SessionResource {
|
|
152
|
-
id: string;
|
|
153
|
-
object: 'realtime.session';
|
|
154
|
-
model: string;
|
|
155
|
-
modalities: Modality[];
|
|
156
|
-
instructions: string;
|
|
157
|
-
voice: Voice;
|
|
158
|
-
input_audio_format: LegacyAudioFormat;
|
|
159
|
-
output_audio_format: LegacyAudioFormat;
|
|
160
|
-
input_audio_transcription: InputAudioTranscription | null;
|
|
161
|
-
turn_detection: TurnDetectionType | null;
|
|
162
|
-
tools: Tool[];
|
|
163
|
-
tool_choice: ToolChoice;
|
|
164
|
-
temperature: number;
|
|
165
|
-
max_response_output_tokens: number | 'inf';
|
|
166
|
-
expires_at: number;
|
|
167
|
-
}
|
|
168
|
-
export interface ConversationResource {
|
|
169
|
-
id: string;
|
|
170
|
-
object: 'realtime.conversation';
|
|
171
|
-
}
|
|
172
|
-
export type ResponseStatusDetails = string | {
|
|
173
|
-
type: 'incomplete';
|
|
174
|
-
reason: 'max_output_tokens' | 'content_filter' | string;
|
|
175
|
-
} | {
|
|
176
|
-
type: 'failed';
|
|
177
|
-
error?: {
|
|
178
|
-
code: 'server_error' | 'rate_limit_exceeded' | string;
|
|
179
|
-
message: string;
|
|
180
|
-
};
|
|
181
|
-
} | {
|
|
182
|
-
type: 'cancelled';
|
|
183
|
-
reason: 'turn_detected' | 'client_cancelled' | string;
|
|
184
|
-
};
|
|
185
|
-
export interface ModelUsage {
|
|
186
|
-
total_tokens: number;
|
|
187
|
-
input_tokens: number;
|
|
188
|
-
output_tokens: number;
|
|
189
|
-
input_token_details: {
|
|
190
|
-
text_tokens: number;
|
|
191
|
-
audio_tokens: number;
|
|
192
|
-
cached_tokens: number;
|
|
193
|
-
cached_tokens_details: {
|
|
194
|
-
text_tokens: number;
|
|
195
|
-
audio_tokens: number;
|
|
196
|
-
image_tokens: number;
|
|
197
|
-
};
|
|
198
|
-
};
|
|
199
|
-
output_token_details: {
|
|
200
|
-
text_tokens: number;
|
|
201
|
-
audio_tokens: number;
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
export interface ResponseResource {
|
|
205
|
-
id: string;
|
|
206
|
-
object: 'realtime.response';
|
|
207
|
-
status: ResponseStatus;
|
|
208
|
-
status_details: ResponseStatusDetails;
|
|
209
|
-
output: ItemResource[];
|
|
210
|
-
usage?: ModelUsage;
|
|
211
|
-
metadata?: Record<string, string>;
|
|
212
|
-
}
|
|
213
|
-
interface BaseClientEvent {
|
|
214
|
-
event_id?: string;
|
|
215
|
-
type: ClientEventType;
|
|
216
|
-
}
|
|
217
|
-
export interface SessionUpdateEvent extends BaseClientEvent {
|
|
218
|
-
type: 'session.update';
|
|
219
|
-
session: Partial<{
|
|
220
|
-
type?: 'realtime' | 'transcription';
|
|
221
|
-
output_modalities?: Modality[];
|
|
222
|
-
audio?: RealtimeAudioConfig;
|
|
223
|
-
max_output_tokens?: number | 'inf';
|
|
224
|
-
tracing?: TracingConfig | null;
|
|
225
|
-
reasoning?: Reasoning | null;
|
|
226
|
-
model: Model;
|
|
227
|
-
instructions: string;
|
|
228
|
-
tools: Tool[];
|
|
229
|
-
tool_choice: ToolChoice;
|
|
230
|
-
modalities: Modality[];
|
|
231
|
-
voice: Voice;
|
|
232
|
-
input_audio_format: LegacyAudioFormat;
|
|
233
|
-
output_audio_format: LegacyAudioFormat;
|
|
234
|
-
input_audio_transcription: InputAudioTranscription | null;
|
|
235
|
-
turn_detection: TurnDetectionType | null;
|
|
236
|
-
temperature: number;
|
|
237
|
-
max_response_output_tokens?: number | 'inf';
|
|
238
|
-
speed?: number;
|
|
239
|
-
}>;
|
|
240
|
-
}
|
|
241
|
-
export interface TracingConfig {
|
|
242
|
-
enabled?: boolean;
|
|
243
|
-
}
|
|
244
|
-
export interface InputAudioBufferAppendEvent extends BaseClientEvent {
|
|
245
|
-
type: 'input_audio_buffer.append';
|
|
246
|
-
audio: AudioBase64Bytes;
|
|
247
|
-
}
|
|
248
|
-
export interface InputAudioBufferCommitEvent extends BaseClientEvent {
|
|
249
|
-
type: 'input_audio_buffer.commit';
|
|
250
|
-
}
|
|
251
|
-
export interface InputAudioBufferClearEvent extends BaseClientEvent {
|
|
252
|
-
type: 'input_audio_buffer.clear';
|
|
253
|
-
}
|
|
254
|
-
export interface UserItemCreate {
|
|
255
|
-
id: string;
|
|
256
|
-
type: 'message';
|
|
257
|
-
role: 'user';
|
|
258
|
-
content: (InputTextContent | InputAudioContent | InputImageContent)[];
|
|
259
|
-
}
|
|
260
|
-
export interface AssistantItemCreate {
|
|
261
|
-
id: string;
|
|
262
|
-
type: 'message';
|
|
263
|
-
role: 'assistant';
|
|
264
|
-
content: TextContent[];
|
|
265
|
-
}
|
|
266
|
-
export interface SystemItemCreate {
|
|
267
|
-
id: string;
|
|
268
|
-
type: 'message';
|
|
269
|
-
role: 'system';
|
|
270
|
-
content: InputTextContent[];
|
|
271
|
-
}
|
|
272
|
-
export interface FunctionCallOutputItemCreate {
|
|
273
|
-
id: string;
|
|
274
|
-
type: 'function_call_output';
|
|
275
|
-
call_id: string;
|
|
276
|
-
output: string;
|
|
277
|
-
}
|
|
278
|
-
export type ConversationItemCreateContent = UserItemCreate | AssistantItemCreate | SystemItemCreate | FunctionCallOutputItemCreate;
|
|
279
|
-
export interface ConversationItemCreateEvent extends BaseClientEvent {
|
|
280
|
-
type: 'conversation.item.create';
|
|
281
|
-
previous_item_id?: string;
|
|
282
|
-
item: ConversationItemCreateContent;
|
|
283
|
-
}
|
|
284
|
-
export interface ConversationItemTruncateEvent extends BaseClientEvent {
|
|
285
|
-
type: 'conversation.item.truncate';
|
|
286
|
-
item_id: string;
|
|
287
|
-
content_index: number;
|
|
288
|
-
audio_end_ms: number;
|
|
289
|
-
}
|
|
290
|
-
export interface ConversationItemDeleteEvent extends BaseClientEvent {
|
|
291
|
-
type: 'conversation.item.delete';
|
|
292
|
-
item_id: string;
|
|
293
|
-
}
|
|
294
|
-
export interface ResponseCreateEvent extends BaseClientEvent {
|
|
295
|
-
type: 'response.create';
|
|
296
|
-
response?: Partial<{
|
|
297
|
-
modalities: Modality[];
|
|
298
|
-
instructions: string;
|
|
299
|
-
voice: Voice;
|
|
300
|
-
output_audio_format: LegacyAudioFormat;
|
|
301
|
-
tools?: Tool[];
|
|
302
|
-
tool_choice: ToolChoice;
|
|
303
|
-
temperature: number;
|
|
304
|
-
max_output_tokens: number | 'inf';
|
|
305
|
-
metadata?: Record<string, string>;
|
|
306
|
-
}>;
|
|
307
|
-
}
|
|
308
|
-
export interface ResponseCancelEvent extends BaseClientEvent {
|
|
309
|
-
type: 'response.cancel';
|
|
310
|
-
response_id?: string;
|
|
311
|
-
}
|
|
312
|
-
export type ClientEvent = SessionUpdateEvent | InputAudioBufferAppendEvent | InputAudioBufferCommitEvent | InputAudioBufferClearEvent | ConversationItemCreateEvent | ConversationItemTruncateEvent | ConversationItemDeleteEvent | ResponseCreateEvent | ResponseCancelEvent;
|
|
313
|
-
interface BaseServerEvent {
|
|
314
|
-
event_id: string;
|
|
315
|
-
type: ServerEventType;
|
|
316
|
-
}
|
|
317
|
-
export interface ErrorEvent extends BaseServerEvent {
|
|
318
|
-
type: 'error';
|
|
319
|
-
error: {
|
|
320
|
-
type: 'invalid_request_error' | 'server_error' | string;
|
|
321
|
-
code?: string;
|
|
322
|
-
message: string;
|
|
323
|
-
param: string;
|
|
324
|
-
event_id: string;
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
export interface SessionCreatedEvent extends BaseServerEvent {
|
|
328
|
-
type: 'session.created';
|
|
329
|
-
session: SessionResource;
|
|
330
|
-
}
|
|
331
|
-
export interface SessionUpdatedEvent extends BaseServerEvent {
|
|
332
|
-
type: 'session.updated';
|
|
333
|
-
session: SessionResource;
|
|
334
|
-
}
|
|
335
|
-
export interface ConversationCreatedEvent extends BaseServerEvent {
|
|
336
|
-
type: 'conversation.created';
|
|
337
|
-
conversation: ConversationResource;
|
|
338
|
-
}
|
|
339
|
-
export interface InputAudioBufferCommittedEvent extends BaseServerEvent {
|
|
340
|
-
type: 'input_audio_buffer.committed';
|
|
341
|
-
item_id: string;
|
|
342
|
-
}
|
|
343
|
-
export interface InputAudioBufferClearedEvent extends BaseServerEvent {
|
|
344
|
-
type: 'input_audio_buffer.cleared';
|
|
345
|
-
}
|
|
346
|
-
export interface InputAudioBufferSpeechStartedEvent extends BaseServerEvent {
|
|
347
|
-
type: 'input_audio_buffer.speech_started';
|
|
348
|
-
audio_start_ms: number;
|
|
349
|
-
item_id: string;
|
|
350
|
-
}
|
|
351
|
-
export interface InputAudioBufferSpeechStoppedEvent extends BaseServerEvent {
|
|
352
|
-
type: 'input_audio_buffer.speech_stopped';
|
|
353
|
-
audio_end_ms: number;
|
|
354
|
-
item_id: string;
|
|
355
|
-
}
|
|
356
|
-
export interface ConversationItemCreatedEvent extends BaseServerEvent {
|
|
357
|
-
type: 'conversation.item.created';
|
|
358
|
-
previous_item_id: string;
|
|
359
|
-
item: ItemResource;
|
|
360
|
-
}
|
|
361
|
-
export interface ConversationItemAddedEvent extends BaseServerEvent {
|
|
362
|
-
type: 'conversation.item.added';
|
|
363
|
-
previous_item_id: string;
|
|
364
|
-
item: ItemResource;
|
|
365
|
-
}
|
|
366
|
-
export interface ConversationItemInputAudioTranscriptionDeltaEvent extends BaseServerEvent {
|
|
367
|
-
type: 'conversation.item.input_audio_transcription.delta';
|
|
368
|
-
item_id: string;
|
|
369
|
-
content_index?: number;
|
|
370
|
-
delta?: string;
|
|
371
|
-
}
|
|
372
|
-
export interface ConversationItemInputAudioTranscriptionCompletedEvent extends BaseServerEvent {
|
|
373
|
-
type: 'conversation.item.input_audio_transcription.completed';
|
|
374
|
-
item_id: string;
|
|
375
|
-
content_index: number;
|
|
376
|
-
transcript: string;
|
|
377
|
-
status?: 'in_progress' | 'completed' | string;
|
|
378
|
-
}
|
|
379
|
-
export interface ConversationItemInputAudioTranscriptionFailedEvent extends BaseServerEvent {
|
|
380
|
-
type: 'conversation.item.input_audio_transcription.failed';
|
|
381
|
-
item_id: string;
|
|
382
|
-
content_index: number;
|
|
383
|
-
error: {
|
|
384
|
-
type: string;
|
|
385
|
-
code?: string;
|
|
386
|
-
message: string;
|
|
387
|
-
param: null;
|
|
388
|
-
};
|
|
389
|
-
}
|
|
390
|
-
export interface ConversationItemTruncatedEvent extends BaseServerEvent {
|
|
391
|
-
type: 'conversation.item.truncated';
|
|
392
|
-
item_id: string;
|
|
393
|
-
content_index: number;
|
|
394
|
-
audio_end_ms: number;
|
|
395
|
-
}
|
|
396
|
-
export interface ConversationItemDeletedEvent extends BaseServerEvent {
|
|
397
|
-
type: 'conversation.item.deleted';
|
|
398
|
-
item_id: string;
|
|
399
|
-
}
|
|
400
|
-
export interface ResponseCreatedEvent extends BaseServerEvent {
|
|
401
|
-
type: 'response.created';
|
|
402
|
-
response: ResponseResource;
|
|
403
|
-
}
|
|
404
|
-
export interface ResponseDoneEvent extends BaseServerEvent {
|
|
405
|
-
type: 'response.done';
|
|
406
|
-
response: ResponseResource;
|
|
407
|
-
}
|
|
408
|
-
export interface ResponseOutputItemAddedEvent extends BaseServerEvent {
|
|
409
|
-
type: 'response.output_item.added';
|
|
410
|
-
response_id: string;
|
|
411
|
-
output_index: number;
|
|
412
|
-
item: ItemResource;
|
|
413
|
-
}
|
|
414
|
-
export interface ResponseOutputItemDoneEvent extends BaseServerEvent {
|
|
415
|
-
type: 'response.output_item.done';
|
|
416
|
-
response_id: string;
|
|
417
|
-
output_index: number;
|
|
418
|
-
item: ItemResource;
|
|
419
|
-
}
|
|
420
|
-
export interface ResponseContentPartAddedEvent extends BaseServerEvent {
|
|
421
|
-
type: 'response.content_part.added';
|
|
422
|
-
response_id: string;
|
|
423
|
-
item_id: string;
|
|
424
|
-
output_index: number;
|
|
425
|
-
content_index: number;
|
|
426
|
-
part: ContentPart;
|
|
427
|
-
}
|
|
428
|
-
export interface ResponseContentPartDoneEvent extends BaseServerEvent {
|
|
429
|
-
type: 'response.content_part.done';
|
|
430
|
-
response_id: string;
|
|
431
|
-
item_id: string;
|
|
432
|
-
output_index: number;
|
|
433
|
-
content_index: number;
|
|
434
|
-
part: ContentPart;
|
|
435
|
-
}
|
|
436
|
-
export interface ResponseTextDeltaEvent extends BaseServerEvent {
|
|
437
|
-
type: 'response.text.delta';
|
|
438
|
-
response_id: string;
|
|
439
|
-
item_id: string;
|
|
440
|
-
output_index: number;
|
|
441
|
-
content_index: number;
|
|
442
|
-
delta: string;
|
|
443
|
-
}
|
|
444
|
-
export interface ResponseTextDoneEvent extends BaseServerEvent {
|
|
445
|
-
type: 'response.text.done';
|
|
446
|
-
response_id: string;
|
|
447
|
-
item_id: string;
|
|
448
|
-
output_index: number;
|
|
449
|
-
content_index: number;
|
|
450
|
-
text: string;
|
|
451
|
-
}
|
|
452
|
-
export interface ResponseAudioTranscriptDeltaEvent extends BaseServerEvent {
|
|
453
|
-
type: 'response.audio_transcript.delta';
|
|
454
|
-
response_id: string;
|
|
455
|
-
item_id: string;
|
|
456
|
-
output_index: number;
|
|
457
|
-
content_index: number;
|
|
458
|
-
delta: string;
|
|
459
|
-
start_time?: number;
|
|
460
|
-
}
|
|
461
|
-
export interface ResponseAudioTranscriptDoneEvent extends BaseServerEvent {
|
|
462
|
-
type: 'response.audio_transcript.done';
|
|
463
|
-
response_id: string;
|
|
464
|
-
output_index: number;
|
|
465
|
-
content_index: number;
|
|
466
|
-
transcript: string;
|
|
467
|
-
}
|
|
468
|
-
export interface ResponseAudioDeltaEvent extends BaseServerEvent {
|
|
469
|
-
type: 'response.audio.delta';
|
|
470
|
-
response_id: string;
|
|
471
|
-
item_id: string;
|
|
472
|
-
output_index: number;
|
|
473
|
-
content_index: number;
|
|
474
|
-
delta: AudioBase64Bytes;
|
|
475
|
-
}
|
|
476
|
-
export interface ResponseAudioDoneEvent extends BaseServerEvent {
|
|
477
|
-
type: 'response.audio.done';
|
|
478
|
-
response_id: string;
|
|
479
|
-
output_index: number;
|
|
480
|
-
content_index: number;
|
|
481
|
-
}
|
|
482
|
-
export interface ResponseFunctionCallArgumentsDeltaEvent extends BaseServerEvent {
|
|
483
|
-
type: 'response.function_call_arguments.delta';
|
|
484
|
-
response_id: string;
|
|
485
|
-
output_index: number;
|
|
486
|
-
delta: string;
|
|
487
|
-
}
|
|
488
|
-
export interface ResponseFunctionCallArgumentsDoneEvent extends BaseServerEvent {
|
|
489
|
-
type: 'response.function_call_arguments.done';
|
|
490
|
-
response_id: string;
|
|
491
|
-
output_index: number;
|
|
492
|
-
arguments: string;
|
|
493
|
-
}
|
|
494
|
-
export interface RateLimitsUpdatedEvent extends BaseServerEvent {
|
|
495
|
-
type: 'rate_limits.updated';
|
|
496
|
-
rate_limits: {
|
|
497
|
-
name: 'requests' | 'tokens' | 'input_tokens' | 'output_tokens' | string;
|
|
498
|
-
limit: number;
|
|
499
|
-
remaining: number;
|
|
500
|
-
reset_seconds: number;
|
|
501
|
-
}[];
|
|
502
|
-
}
|
|
503
|
-
export type ServerEvent = ErrorEvent | SessionCreatedEvent | SessionUpdatedEvent | ConversationCreatedEvent | InputAudioBufferCommittedEvent | InputAudioBufferClearedEvent | InputAudioBufferSpeechStartedEvent | InputAudioBufferSpeechStoppedEvent | ConversationItemCreatedEvent | ConversationItemAddedEvent | ConversationItemInputAudioTranscriptionDeltaEvent | ConversationItemInputAudioTranscriptionCompletedEvent | ConversationItemInputAudioTranscriptionFailedEvent | ConversationItemTruncatedEvent | ConversationItemDeletedEvent | ResponseCreatedEvent | ResponseDoneEvent | ResponseOutputItemAddedEvent | ResponseOutputItemDoneEvent | ResponseContentPartAddedEvent | ResponseContentPartDoneEvent | ResponseTextDeltaEvent | ResponseTextDoneEvent | ResponseAudioTranscriptDeltaEvent | ResponseAudioTranscriptDoneEvent | ResponseAudioDeltaEvent | ResponseAudioDoneEvent | ResponseFunctionCallArgumentsDeltaEvent | ResponseFunctionCallArgumentsDoneEvent | RateLimitsUpdatedEvent;
|
|
504
|
-
export {};
|
|
1
|
+
export * from '@livekit/agents/llm/openai_realtime/api_proto';
|
|
505
2
|
//# sourceMappingURL=api_proto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_proto.d.ts","sourceRoot":"","sources":["../../src/realtime/api_proto.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,WAAW,QAAQ,CAAC;AACjC,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,cAAc,OAAO,CAAC;AAEnC,eAAO,MAAM,QAAQ,4BAA4B,CAAC;AAElD,MAAM,MAAM,KAAK,GAAG,oCAAoC,GAAG,MAAM,CAAC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAE9E,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,eAAe,CAAC;CAC1B;AACD,MAAM,MAAM,KAAK,GACb,OAAO,GACP,SAAS,GACT,MAAM,GACN,KAAK,GACL,QAAQ,GACR,OAAO,GACP,MAAM,GACN,OAAO,GACP,MAAM,CAAC;AAEX,2GAA2G;AAC3G,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC;AACxC,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,WAAW,GAAG,MAAM,GA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AE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sCAAuC,SAAQ,eAAe;IAC7E,IAAI,EAAE,uCAAuC,CAAC;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D,IAAI,EAAE,qBAAqB,CAAC;IAC5B,WAAW,EAAE;QACX,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,eAAe,GAAG,MAAM,CAAC;QACxE,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;CACL;AAED,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,8BAA8B,GAC9B,4BAA4B,GAC5B,kCAAkC,GAClC,kCAAkC,GAClC,4BAA4B,GAC5B,0BAA0B,GAC1B,iDAAiD,GACjD,qDAAqD,GACrD,kDAAkD,GAClD,8BAA8B,GAC9B,4BAA4B,GAC5B,oBAAoB,GACpB,iBAAiB,GACjB,4BAA4B,GAC5B,2BAA2B,GAC3B,6BAA6B,GAC7B,4BAA4B,GAC5B,sBAAsB,GACtB,qBAAqB,GACrB,iCAAiC,GACjC,gCAAgC,GAChC,uBAAuB,GACvB,sBAAsB,GACtB,uCAAuC,GACvC,sCAAsC,GACtC,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"api_proto.d.ts","sourceRoot":"","sources":["../../src/realtime/api_proto.ts"],"names":[],"mappings":"AAIA,cAAc,+CAA+C,CAAC"}
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const NUM_CHANNELS = 1;
|
|
3
|
-
const IN_FRAME_SIZE = 2400;
|
|
4
|
-
const OUT_FRAME_SIZE = 1200;
|
|
5
|
-
const BASE_URL = "wss://api.openai.com/v1";
|
|
6
|
-
export {
|
|
7
|
-
BASE_URL,
|
|
8
|
-
IN_FRAME_SIZE,
|
|
9
|
-
NUM_CHANNELS,
|
|
10
|
-
OUT_FRAME_SIZE,
|
|
11
|
-
SAMPLE_RATE
|
|
12
|
-
};
|
|
1
|
+
export * from "@livekit/agents/llm/openai_realtime/api_proto";
|
|
13
2
|
//# sourceMappingURL=api_proto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/realtime/api_proto.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2024 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport const SAMPLE_RATE = 24000;\nexport const NUM_CHANNELS = 1;\nexport const IN_FRAME_SIZE = 2400; // 100ms\nexport const OUT_FRAME_SIZE = 1200; // 50ms\n\nexport const BASE_URL = 'wss://api.openai.com/v1';\n\nexport type Model = 'gpt-4o-realtime-preview-2024-10-01' | string; // Open-ended, for future models\n\n/**\n * Models that support the `reasoning` configuration on the Realtime API.\n * Currently only the `gpt-realtime-2` family supports it.\n *\n * Ref: https://developers.openai.com/api/reference/resources/realtime/subresources/calls/methods/accept\n */\nexport type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';\n\nexport interface Reasoning {\n effort?: ReasoningEffort;\n}\nexport type Voice =\n | 'alloy'\n | 'shimmer'\n | 'echo'\n | 'ash'\n | 'ballad'\n | 'coral'\n | 'sage'\n | 'verse'\n | string;\n\n/** @deprecated Use LegacyAudioFormat for Beta API string format or AudioFormat for GA API object format */\nexport type LegacyAudioFormat = 'pcm16'; // TODO: 'g711-ulaw' | 'g711-alaw' (Beta format)\nexport type Role = 'system' | 'assistant' | 'user' | 'tool';\nexport type GenerationFinishedReason = 'stop' | 'max_tokens' | 'content_filter' | 'interrupt';\nexport type InputTranscriptionModel = 'whisper-1' | string; // Open-ended, for future models\nexport type Modality = 'text' | 'audio';\nexport type ToolChoice = 'auto' | 'none' | 'required' | string;\nexport type State = 'initializing' | 'listening' | 'thinking' | 'speaking' | string;\nexport type ResponseStatus =\n | 'in_progress'\n | 'completed'\n | 'incomplete'\n | 'cancelled'\n | 'failed'\n | string;\nexport type ClientEventType =\n | 'session.update'\n | 'input_audio_buffer.append'\n | 'input_audio_buffer.commit'\n | 'input_audio_buffer.clear'\n | 'conversation.item.create'\n | 'conversation.item.truncate'\n | 'conversation.item.delete'\n | 'response.create'\n | 'response.cancel';\n\nexport type ServerEventType =\n | 'error'\n | 'session.created'\n | 'session.updated'\n | 'conversation.created'\n | 'input_audio_buffer.committed'\n | 'input_audio_buffer.cleared'\n | 'input_audio_buffer.speech_started'\n | 'input_audio_buffer.speech_stopped'\n | 'conversation.item.added' // GA: renamed from conversation.item.created\n | 'conversation.item.created' // Beta: kept for backward compatibility\n | 'conversation.item.input_audio_transcription.delta'\n | 'conversation.item.input_audio_transcription.completed'\n | 'conversation.item.input_audio_transcription.failed'\n | 'conversation.item.truncated'\n | 'conversation.item.deleted'\n | 'response.created'\n | 'response.done'\n | 'response.output_item.added'\n | 'response.output_item.done'\n | 'response.content_part.added'\n | 'response.content_part.done'\n | 'response.output_text.delta' // GA: renamed from response.text.delta\n | 'response.output_text.done' // GA: renamed from response.text.done\n | 'response.text.delta' // Beta: kept for backward compatibility\n | 'response.text.done' // Beta: kept for backward compatibility\n | 'response.output_audio_transcript.delta' // GA: renamed from response.audio_transcript.delta\n | 'response.output_audio_transcript.done' // GA: renamed from response.audio_transcript.done\n | 'response.audio_transcript.delta' // Beta: kept for backward compatibility\n | 'response.audio_transcript.done' // Beta: kept for backward compatibility\n | 'response.output_audio.delta' // GA: renamed from response.audio.delta\n | 'response.output_audio.done' // GA: renamed from response.audio.done\n | 'response.audio.delta' // Beta: kept for backward compatibility\n | 'response.audio.done' // Beta: kept for backward compatibility\n | 'response.function_call_arguments.delta'\n | 'response.function_call_arguments.done'\n | 'rate_limits.updated';\n\nexport type AudioBase64Bytes = string;\n\nexport interface Tool {\n type: 'function';\n name: string;\n description?: string;\n parameters: {\n type: 'object';\n properties: {\n [prop: string]: {\n [prop: string]: any;\n };\n };\n required: string[];\n };\n}\n\nexport type TurnDetectionType =\n | {\n type: 'semantic_vad';\n eagerness?: 'auto' | 'low' | 'medium' | 'high'; // default: auto\n create_response?: boolean; // default: true\n interrupt_response?: boolean; // default: true\n }\n | {\n type: 'server_vad';\n threshold?: number; // 0.0 to 1.0, default: 0.5\n prefix_padding_ms?: number; // default: 300\n silence_duration_ms?: number; // default: 200\n create_response?: boolean; // default: true\n interrupt_response?: boolean; // default: true\n };\n\nexport type InputAudioTranscription = {\n model: InputTranscriptionModel;\n language?: string;\n languages?: string[];\n keywords?: string[];\n prompt?: string;\n};\n\nexport type NoiseReductionType = 'near_field' | 'far_field';\n\nexport interface NoiseReduction {\n type: NoiseReductionType;\n}\n\nexport interface AudioFormat {\n type: 'audio/pcm';\n rate: number;\n}\n\nexport interface RealtimeAudioConfigInput {\n format?: AudioFormat;\n noise_reduction?: NoiseReduction | null;\n transcription?: InputAudioTranscription | null;\n turn_detection?: TurnDetectionType | null;\n}\n\nexport interface RealtimeAudioConfigOutput {\n format?: AudioFormat;\n speed?: number;\n voice?: Voice;\n}\n\nexport interface RealtimeAudioConfig {\n input?: RealtimeAudioConfigInput;\n output?: RealtimeAudioConfigOutput;\n}\n\nexport interface InputTextContent {\n type: 'input_text';\n text: string;\n}\n\nexport interface InputAudioContent {\n type: 'input_audio';\n audio: AudioBase64Bytes;\n}\n\nexport interface InputImageContent {\n type: 'input_image';\n image_url: string;\n}\n\nexport interface TextContent {\n type: 'text';\n text: string;\n}\n\nexport interface OutputTextContent {\n type: 'output_text';\n text: string;\n}\n\nexport interface AudioContent {\n type: 'audio';\n audio: AudioBase64Bytes;\n transcript: string;\n}\n\nexport type Content =\n | InputTextContent\n | InputAudioContent\n | InputImageContent\n | TextContent\n | OutputTextContent\n | AudioContent;\nexport type ContentPart = {\n type: 'text' | 'audio' | 'output_text' | 'output_audio'; // GA: output_text/output_audio\n audio?: AudioBase64Bytes;\n transcript?: string;\n text?: string; // GA: text field for output_text\n};\n\nexport interface BaseItem {\n id: string;\n object: 'realtime.item';\n type: string;\n}\n\nexport interface SystemItem extends BaseItem {\n type: 'message';\n role: 'system';\n content: InputTextContent;\n}\n\nexport interface UserItem extends BaseItem {\n type: 'message';\n role: 'user';\n content: (InputTextContent | InputAudioContent | InputImageContent)[];\n}\n\nexport interface AssistantItem extends BaseItem {\n type: 'message';\n role: 'assistant';\n content: (TextContent | OutputTextContent | AudioContent)[];\n}\n\nexport interface FunctionCallItem extends BaseItem {\n type: 'function_call';\n call_id: string;\n name: string;\n arguments: string;\n}\n\nexport interface FunctionCallOutputItem extends BaseItem {\n type: 'function_call_output';\n call_id: string;\n output: string;\n}\n\nexport type ItemResource =\n | SystemItem\n | UserItem\n | AssistantItem\n | FunctionCallItem\n | FunctionCallOutputItem;\n\n// Session Resource\nexport interface SessionResource {\n id: string;\n object: 'realtime.session';\n model: string;\n modalities: Modality[]; // default: [\"text\", \"audio\"]\n instructions: string;\n voice: Voice; // default: \"alloy\"\n input_audio_format: LegacyAudioFormat; // default: \"pcm16\"\n output_audio_format: LegacyAudioFormat; // default: \"pcm16\"\n input_audio_transcription: InputAudioTranscription | null;\n turn_detection: TurnDetectionType | null;\n tools: Tool[];\n tool_choice: ToolChoice; // default: \"auto\"\n temperature: number; // default: 0.8\n max_response_output_tokens: number | 'inf';\n expires_at: number;\n}\n\n// Conversation Resource\nexport interface ConversationResource {\n id: string;\n object: 'realtime.conversation';\n}\n\nexport type ResponseStatusDetails =\n | string\n | {\n type: 'incomplete';\n reason: 'max_output_tokens' | 'content_filter' | string;\n }\n | {\n type: 'failed';\n error?: {\n code: 'server_error' | 'rate_limit_exceeded' | string;\n message: string;\n };\n }\n | {\n type: 'cancelled';\n reason: 'turn_detected' | 'client_cancelled' | string;\n };\n\nexport interface ModelUsage {\n total_tokens: number;\n input_tokens: number;\n output_tokens: number;\n input_token_details: {\n text_tokens: number;\n audio_tokens: number;\n cached_tokens: number;\n cached_tokens_details: {\n text_tokens: number;\n audio_tokens: number;\n image_tokens: number;\n };\n };\n output_token_details: {\n text_tokens: number;\n audio_tokens: number;\n };\n}\n\nexport interface ResponseResource {\n id: string;\n object: 'realtime.response';\n status: ResponseStatus;\n status_details: ResponseStatusDetails;\n output: ItemResource[];\n usage?: ModelUsage;\n metadata?: Record<string, string>;\n}\n\n// Client Events\ninterface BaseClientEvent {\n event_id?: string;\n type: ClientEventType;\n}\n\nexport interface SessionUpdateEvent extends BaseClientEvent {\n type: 'session.update';\n session: Partial<{\n // GA fields\n type?: 'realtime' | 'transcription'; // GA: session type\n output_modalities?: Modality[]; // GA: renamed from modalities\n audio?: RealtimeAudioConfig; // GA: nested audio config\n max_output_tokens?: number | 'inf'; // GA: renamed from max_response_output_tokens\n tracing?: TracingConfig | null; // GA: tracing config\n reasoning?: Reasoning | null; // GA: reasoning config (gpt-realtime-2 only)\n // Common fields\n model: Model;\n instructions: string;\n tools: Tool[];\n tool_choice: ToolChoice;\n // Beta fields (kept for backward compatibility)\n modalities: Modality[];\n voice: Voice;\n input_audio_format: LegacyAudioFormat;\n output_audio_format: LegacyAudioFormat;\n input_audio_transcription: InputAudioTranscription | null;\n turn_detection: TurnDetectionType | null;\n temperature: number;\n max_response_output_tokens?: number | 'inf';\n speed?: number;\n }>;\n}\n\nexport interface TracingConfig {\n enabled?: boolean;\n}\n\nexport interface InputAudioBufferAppendEvent extends BaseClientEvent {\n type: 'input_audio_buffer.append';\n audio: AudioBase64Bytes;\n}\n\nexport interface InputAudioBufferCommitEvent extends BaseClientEvent {\n type: 'input_audio_buffer.commit';\n}\n\nexport interface InputAudioBufferClearEvent extends BaseClientEvent {\n type: 'input_audio_buffer.clear';\n}\n\nexport interface UserItemCreate {\n id: string;\n type: 'message';\n role: 'user';\n content: (InputTextContent | InputAudioContent | InputImageContent)[];\n}\n\nexport interface AssistantItemCreate {\n id: string;\n type: 'message';\n role: 'assistant';\n content: TextContent[];\n}\n\nexport interface SystemItemCreate {\n id: string;\n type: 'message';\n role: 'system';\n content: InputTextContent[];\n}\n\nexport interface FunctionCallOutputItemCreate {\n id: string;\n type: 'function_call_output';\n call_id: string;\n output: string;\n}\n\nexport type ConversationItemCreateContent =\n | UserItemCreate\n | AssistantItemCreate\n | SystemItemCreate\n | FunctionCallOutputItemCreate;\n\nexport interface ConversationItemCreateEvent extends BaseClientEvent {\n type: 'conversation.item.create';\n previous_item_id?: string;\n item: ConversationItemCreateContent;\n}\n\nexport interface ConversationItemTruncateEvent extends BaseClientEvent {\n type: 'conversation.item.truncate';\n item_id: string;\n content_index: number;\n audio_end_ms: number;\n}\n\nexport interface ConversationItemDeleteEvent extends BaseClientEvent {\n type: 'conversation.item.delete';\n item_id: string;\n}\n\nexport interface ResponseCreateEvent extends BaseClientEvent {\n type: 'response.create';\n response?: Partial<{\n modalities: Modality[];\n instructions: string;\n voice: Voice;\n output_audio_format: LegacyAudioFormat;\n tools?: Tool[];\n tool_choice: ToolChoice;\n temperature: number;\n max_output_tokens: number | 'inf';\n metadata?: Record<string, string>;\n }>;\n}\n\nexport interface ResponseCancelEvent extends BaseClientEvent {\n type: 'response.cancel';\n response_id?: string;\n}\n\nexport type ClientEvent =\n | SessionUpdateEvent\n | InputAudioBufferAppendEvent\n | InputAudioBufferCommitEvent\n | InputAudioBufferClearEvent\n | ConversationItemCreateEvent\n | ConversationItemTruncateEvent\n | ConversationItemDeleteEvent\n | ResponseCreateEvent\n | ResponseCancelEvent;\n\ninterface BaseServerEvent {\n event_id: string;\n type: ServerEventType;\n}\n\nexport interface ErrorEvent extends BaseServerEvent {\n type: 'error';\n error: {\n type: 'invalid_request_error' | 'server_error' | string;\n code?: string;\n message: string;\n param: string;\n event_id: string;\n };\n}\n\nexport interface SessionCreatedEvent extends BaseServerEvent {\n type: 'session.created';\n session: SessionResource;\n}\n\nexport interface SessionUpdatedEvent extends BaseServerEvent {\n type: 'session.updated';\n session: SessionResource;\n}\n\nexport interface ConversationCreatedEvent extends BaseServerEvent {\n type: 'conversation.created';\n conversation: ConversationResource;\n}\n\nexport interface InputAudioBufferCommittedEvent extends BaseServerEvent {\n type: 'input_audio_buffer.committed';\n item_id: string;\n}\n\nexport interface InputAudioBufferClearedEvent extends BaseServerEvent {\n type: 'input_audio_buffer.cleared';\n}\n\nexport interface InputAudioBufferSpeechStartedEvent extends BaseServerEvent {\n type: 'input_audio_buffer.speech_started';\n audio_start_ms: number;\n item_id: string;\n}\n\nexport interface InputAudioBufferSpeechStoppedEvent extends BaseServerEvent {\n type: 'input_audio_buffer.speech_stopped';\n audio_end_ms: number;\n item_id: string;\n}\n\nexport interface ConversationItemCreatedEvent extends BaseServerEvent {\n type: 'conversation.item.created';\n previous_item_id: string;\n item: ItemResource;\n}\n\nexport interface ConversationItemAddedEvent extends BaseServerEvent {\n type: 'conversation.item.added';\n previous_item_id: string;\n item: ItemResource;\n}\n\nexport interface ConversationItemInputAudioTranscriptionDeltaEvent extends BaseServerEvent {\n type: 'conversation.item.input_audio_transcription.delta';\n item_id: string;\n content_index?: number;\n delta?: string;\n}\n\nexport interface ConversationItemInputAudioTranscriptionCompletedEvent extends BaseServerEvent {\n type: 'conversation.item.input_audio_transcription.completed';\n item_id: string;\n content_index: number;\n transcript: string;\n status?: 'in_progress' | 'completed' | string;\n}\n\nexport interface ConversationItemInputAudioTranscriptionFailedEvent extends BaseServerEvent {\n type: 'conversation.item.input_audio_transcription.failed';\n item_id: string;\n content_index: number;\n error: {\n type: string;\n code?: string;\n message: string;\n param: null;\n };\n}\n\nexport interface ConversationItemTruncatedEvent extends BaseServerEvent {\n type: 'conversation.item.truncated';\n item_id: string;\n content_index: number;\n audio_end_ms: number;\n}\n\nexport interface ConversationItemDeletedEvent extends BaseServerEvent {\n type: 'conversation.item.deleted';\n item_id: string;\n}\n\nexport interface ResponseCreatedEvent extends BaseServerEvent {\n type: 'response.created';\n response: ResponseResource;\n}\n\nexport interface ResponseDoneEvent extends BaseServerEvent {\n type: 'response.done';\n response: ResponseResource;\n}\n\nexport interface ResponseOutputItemAddedEvent extends BaseServerEvent {\n type: 'response.output_item.added';\n response_id: string;\n output_index: number;\n item: ItemResource;\n}\n\nexport interface ResponseOutputItemDoneEvent extends BaseServerEvent {\n type: 'response.output_item.done';\n response_id: string;\n output_index: number;\n item: ItemResource;\n}\n\nexport interface ResponseContentPartAddedEvent extends BaseServerEvent {\n type: 'response.content_part.added';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n part: ContentPart;\n}\n\nexport interface ResponseContentPartDoneEvent extends BaseServerEvent {\n type: 'response.content_part.done';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n part: ContentPart;\n}\n\nexport interface ResponseTextDeltaEvent extends BaseServerEvent {\n type: 'response.text.delta';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n delta: string;\n}\n\nexport interface ResponseTextDoneEvent extends BaseServerEvent {\n type: 'response.text.done';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n text: string;\n}\n\nexport interface ResponseAudioTranscriptDeltaEvent extends BaseServerEvent {\n type: 'response.audio_transcript.delta';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n delta: string;\n // Start time of this transcript segment in seconds (relative to audio output).\n start_time?: number;\n}\n\nexport interface ResponseAudioTranscriptDoneEvent extends BaseServerEvent {\n type: 'response.audio_transcript.done';\n response_id: string;\n output_index: number;\n content_index: number;\n transcript: string;\n}\n\nexport interface ResponseAudioDeltaEvent extends BaseServerEvent {\n type: 'response.audio.delta';\n response_id: string;\n item_id: string;\n output_index: number;\n content_index: number;\n delta: AudioBase64Bytes;\n}\n\nexport interface ResponseAudioDoneEvent extends BaseServerEvent {\n type: 'response.audio.done';\n response_id: string;\n output_index: number;\n content_index: number;\n}\n\nexport interface ResponseFunctionCallArgumentsDeltaEvent extends BaseServerEvent {\n type: 'response.function_call_arguments.delta';\n response_id: string;\n output_index: number;\n delta: string;\n}\n\nexport interface ResponseFunctionCallArgumentsDoneEvent extends BaseServerEvent {\n type: 'response.function_call_arguments.done';\n response_id: string;\n output_index: number;\n arguments: string;\n}\n\nexport interface RateLimitsUpdatedEvent extends BaseServerEvent {\n type: 'rate_limits.updated';\n rate_limits: {\n name: 'requests' | 'tokens' | 'input_tokens' | 'output_tokens' | string;\n limit: number;\n remaining: number;\n reset_seconds: number;\n }[];\n}\n\nexport type ServerEvent =\n | ErrorEvent\n | SessionCreatedEvent\n | SessionUpdatedEvent\n | ConversationCreatedEvent\n | InputAudioBufferCommittedEvent\n | InputAudioBufferClearedEvent\n | InputAudioBufferSpeechStartedEvent\n | InputAudioBufferSpeechStoppedEvent\n | ConversationItemCreatedEvent\n | ConversationItemAddedEvent // GA: renamed from conversation.item.created\n | ConversationItemInputAudioTranscriptionDeltaEvent\n | ConversationItemInputAudioTranscriptionCompletedEvent\n | ConversationItemInputAudioTranscriptionFailedEvent\n | ConversationItemTruncatedEvent\n | ConversationItemDeletedEvent\n | ResponseCreatedEvent\n | ResponseDoneEvent\n | ResponseOutputItemAddedEvent\n | ResponseOutputItemDoneEvent\n | ResponseContentPartAddedEvent\n | ResponseContentPartDoneEvent\n | ResponseTextDeltaEvent\n | ResponseTextDoneEvent\n | ResponseAudioTranscriptDeltaEvent\n | ResponseAudioTranscriptDoneEvent\n | ResponseAudioDeltaEvent\n | ResponseAudioDoneEvent\n | ResponseFunctionCallArgumentsDeltaEvent\n | ResponseFunctionCallArgumentsDoneEvent\n | RateLimitsUpdatedEvent;\n"],"mappings":"AAIO,MAAM,cAAc;AACpB,MAAM,eAAe;AACrB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AAEvB,MAAM,WAAW;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/realtime/api_proto.ts"],"sourcesContent":["// SPDX-FileCopyrightText: 2026 LiveKit, Inc.\n//\n// SPDX-License-Identifier: Apache-2.0\n\nexport * from '@livekit/agents/llm/openai_realtime/api_proto';\n"],"mappings":"AAIA,cAAc;","names":[]}
|