@rimelabs/sdk 0.1.0-alpha.5 → 0.1.0-alpha.7
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/CHANGELOG.md +14 -0
- package/LICENSE-PRISM +201 -0
- package/NOTICE-PRISM +9 -0
- package/README.md +50 -123
- package/dist/auth.d.ts +8 -3
- package/dist/auth.js +8 -3
- package/dist/cancellation.d.ts +1 -0
- package/dist/cancellation.js +18 -0
- package/dist/client.d.ts +11 -23
- package/dist/client.js +22 -91
- package/dist/index.d.ts +4 -2
- package/dist/index.js +4 -2
- package/dist/realtime/async.d.ts +27 -0
- package/dist/realtime/async.js +122 -0
- package/dist/realtime/audio.d.ts +13 -0
- package/dist/realtime/audio.js +54 -0
- package/dist/realtime/client.d.ts +12 -0
- package/dist/realtime/client.js +156 -0
- package/dist/realtime/protocol.d.ts +80 -0
- package/dist/realtime/protocol.js +354 -0
- package/dist/realtime/session.d.ts +67 -0
- package/dist/realtime/session.js +730 -0
- package/dist/realtime/transport.d.ts +16 -0
- package/dist/realtime/transport.js +83 -0
- package/dist/realtime/types.d.ts +190 -0
- package/dist/realtime/types.js +10 -0
- package/dist/{audio.js → tts/audio.js} +1 -1
- package/dist/tts/client.d.ts +36 -0
- package/dist/tts/client.js +111 -0
- package/dist/{policy.d.ts → tts/policy.d.ts} +0 -1
- package/dist/{policy.js → tts/policy.js} +1 -19
- package/dist/{sentences.js → tts/sentences.js} +2 -2
- package/dist/{stream.js → tts/stream.js} +3 -2
- package/dist/{transport.d.ts → tts/transport.d.ts} +1 -1
- package/dist/{transport.js → tts/transport.js} +3 -2
- package/docs/realtime.md +220 -0
- package/docs/tts.md +132 -0
- package/package.json +12 -5
- /package/dist/{audio.d.ts → tts/audio.d.ts} +0 -0
- /package/dist/{queue.d.ts → tts/queue.d.ts} +0 -0
- /package/dist/{queue.js → tts/queue.js} +0 -0
- /package/dist/{sentences.d.ts → tts/sentences.d.ts} +0 -0
- /package/dist/{stream.d.ts → tts/stream.d.ts} +0 -0
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/** Decode only the protocol fields the SDK uses. Unknown events and fields stay open. */
|
|
3
|
+
import { RimeStreamError } from "../errors.js";
|
|
4
|
+
/** A request carries its result type and checks it before exposing the result. */
|
|
5
|
+
export class Request {
|
|
6
|
+
kind;
|
|
7
|
+
accepts;
|
|
8
|
+
allowsItemCreated;
|
|
9
|
+
constructor(kind, accepts, allowsItemCreated = false) {
|
|
10
|
+
this.kind = kind;
|
|
11
|
+
this.accepts = accepts;
|
|
12
|
+
this.allowsItemCreated = allowsItemCreated;
|
|
13
|
+
}
|
|
14
|
+
result(event) {
|
|
15
|
+
if (!this.accepts(event))
|
|
16
|
+
throw new RimeStreamError(`Unexpected ${event.kind} acknowledgment for ${this.kind}`);
|
|
17
|
+
return event;
|
|
18
|
+
}
|
|
19
|
+
check(event) {
|
|
20
|
+
this.result(event);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export const requests = {
|
|
24
|
+
update: new Request("session.update", (e) => e.kind === "session.updated"),
|
|
25
|
+
item: new Request("conversation.item.create", (e) => e.kind === "item.created"),
|
|
26
|
+
toolResult: new Request("conversation.item.create", (e) => e.kind === "tool.result.created"),
|
|
27
|
+
create: new Request("response.create", (e) => e.kind === "response.started"),
|
|
28
|
+
text: new Request("response.create", (e) => e.kind === "response.started", true),
|
|
29
|
+
cancel: new Request("response.cancel", (e) => e.kind === "response.ended"),
|
|
30
|
+
clear: new Request("input_audio_buffer.clear", (e) => e.kind === "audio.cleared"),
|
|
31
|
+
truncate: new Request("conversation.item.truncate", (e) => e.kind === "item.truncated"),
|
|
32
|
+
};
|
|
33
|
+
function invalid(field) {
|
|
34
|
+
throw new RimeStreamError(`Invalid realtime field: ${field}`);
|
|
35
|
+
}
|
|
36
|
+
function object(value, field) {
|
|
37
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
38
|
+
return invalid(field);
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
function string(value, field) {
|
|
42
|
+
if (typeof value !== "string")
|
|
43
|
+
return invalid(field);
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
function id(value, field) {
|
|
47
|
+
const result = string(value, field);
|
|
48
|
+
if (!result)
|
|
49
|
+
return invalid(field);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
function optionalString(value, field) {
|
|
53
|
+
return value == null ? null : string(value, field);
|
|
54
|
+
}
|
|
55
|
+
function integer(value, field) {
|
|
56
|
+
if (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0)
|
|
57
|
+
return invalid(field);
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
function duration(value, field) {
|
|
61
|
+
if (value == null)
|
|
62
|
+
return null;
|
|
63
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
|
|
64
|
+
return invalid(field);
|
|
65
|
+
return value;
|
|
66
|
+
}
|
|
67
|
+
function session(value) {
|
|
68
|
+
const view = object(value, "session");
|
|
69
|
+
const waits = view.prsm_tool_waits === undefined
|
|
70
|
+
? {}
|
|
71
|
+
: object(view.prsm_tool_waits, "session.prsm_tool_waits");
|
|
72
|
+
if (view.prsm_tool_waits !== undefined &&
|
|
73
|
+
(!("result_timeout_s" in waits) || !("continuation_timeout_s" in waits)))
|
|
74
|
+
invalid("session.prsm_tool_waits");
|
|
75
|
+
const interrupt = view.prsm_effective_interrupt_response;
|
|
76
|
+
if (interrupt !== undefined && typeof interrupt !== "boolean")
|
|
77
|
+
invalid("session.prsm_effective_interrupt_response");
|
|
78
|
+
return {
|
|
79
|
+
id: id(view.id, "session.id"),
|
|
80
|
+
voice: view.voice === undefined ? "" : string(view.voice, "session.voice"),
|
|
81
|
+
interruptOnSpeech: interrupt ?? null,
|
|
82
|
+
toolResultTimeoutS: duration(waits.result_timeout_s, "result_timeout_s"),
|
|
83
|
+
toolContinuationTimeoutS: duration(waits.continuation_timeout_s, "continuation_timeout_s"),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function fault(value) {
|
|
87
|
+
const error = object(value, "error");
|
|
88
|
+
const owner = error.owner == null ? {} : object(error.owner, "error.owner");
|
|
89
|
+
const scope = error.scope === undefined ? "unknown" : string(error.scope, "error.scope");
|
|
90
|
+
const calls = owner.call_ids ?? [];
|
|
91
|
+
if (!Array.isArray(calls))
|
|
92
|
+
return invalid("error.owner.call_ids");
|
|
93
|
+
return Object.freeze({
|
|
94
|
+
code: error.code === undefined ? "unknown" : string(error.code, "error.code"),
|
|
95
|
+
message: error.message === undefined ? "" : string(error.message, "error.message"),
|
|
96
|
+
scope: scope === "event" ||
|
|
97
|
+
scope === "utterance" ||
|
|
98
|
+
scope === "response" ||
|
|
99
|
+
scope === "tool_roundtrip" ||
|
|
100
|
+
scope === "session"
|
|
101
|
+
? scope
|
|
102
|
+
: "unknown",
|
|
103
|
+
requestId: optionalString(owner.event_id, "error.owner.event_id"),
|
|
104
|
+
responseId: optionalString(owner.response_id, "error.owner.response_id"),
|
|
105
|
+
itemId: optionalString(owner.item_id, "error.owner.item_id"),
|
|
106
|
+
callIds: Object.freeze(calls.map((value) => id(value, "error.owner.call_ids"))),
|
|
107
|
+
correlationId: optionalString(error.correlation_id, "error.correlation_id"),
|
|
108
|
+
parameter: optionalString(error.param, "error.param"),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
function json(value) {
|
|
112
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
113
|
+
return value;
|
|
114
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
115
|
+
return value;
|
|
116
|
+
if (Array.isArray(value))
|
|
117
|
+
return value.map(json);
|
|
118
|
+
const entries = object(value, "arguments");
|
|
119
|
+
return Object.fromEntries(Object.entries(entries).map(([key, value]) => [key, json(value)]));
|
|
120
|
+
}
|
|
121
|
+
function argumentsObject(value) {
|
|
122
|
+
const result = json(JSON.parse(string(value, "arguments")));
|
|
123
|
+
if (!result || typeof result !== "object" || Array.isArray(result))
|
|
124
|
+
return invalid("arguments");
|
|
125
|
+
return result;
|
|
126
|
+
}
|
|
127
|
+
function audio(value) {
|
|
128
|
+
const encoded = string(value, "delta");
|
|
129
|
+
if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(encoded))
|
|
130
|
+
return invalid("audio.delta");
|
|
131
|
+
const data = Buffer.from(encoded, "base64");
|
|
132
|
+
if (data.length % 2)
|
|
133
|
+
return invalid("audio.delta");
|
|
134
|
+
return Object.freeze({
|
|
135
|
+
data,
|
|
136
|
+
format: Object.freeze({
|
|
137
|
+
sampleRate: 24000,
|
|
138
|
+
channels: 1,
|
|
139
|
+
encoding: "pcm_s16le",
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
export function decode(raw, sessionId) {
|
|
144
|
+
try {
|
|
145
|
+
return decodeValue(JSON.parse(raw), sessionId);
|
|
146
|
+
}
|
|
147
|
+
catch (error) {
|
|
148
|
+
if (error instanceof RimeStreamError)
|
|
149
|
+
throw error;
|
|
150
|
+
throw new RimeStreamError("Invalid realtime event");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function decodeValue(value, sessionId) {
|
|
154
|
+
const event = object(value, "event"), kind = string(event.type, "type");
|
|
155
|
+
const ref = (value) => {
|
|
156
|
+
if (sessionId === null)
|
|
157
|
+
throw new RimeStreamError("Event arrived before session.created");
|
|
158
|
+
return Object.freeze({ sessionId, responseId: id(value, "response.id") });
|
|
159
|
+
};
|
|
160
|
+
let payload;
|
|
161
|
+
switch (kind) {
|
|
162
|
+
case "session.created":
|
|
163
|
+
payload = { kind: "session.created", session: session(event.session) };
|
|
164
|
+
break;
|
|
165
|
+
case "session.updated":
|
|
166
|
+
payload = { kind: "session.updated", session: session(event.session) };
|
|
167
|
+
break;
|
|
168
|
+
case "conversation.item.created": {
|
|
169
|
+
const item = object(event.item, "item");
|
|
170
|
+
if (item.type === "function_call_output")
|
|
171
|
+
payload = {
|
|
172
|
+
kind: "tool.result.created",
|
|
173
|
+
callId: id(item.call_id, "item.call_id"),
|
|
174
|
+
};
|
|
175
|
+
else {
|
|
176
|
+
if (item.type !== undefined && item.type !== "message")
|
|
177
|
+
invalid("item.type");
|
|
178
|
+
payload = { kind: "item.created", itemId: id(item.id, "item.id") };
|
|
179
|
+
}
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case "input_audio_buffer.cleared":
|
|
183
|
+
payload = { kind: "audio.cleared" };
|
|
184
|
+
break;
|
|
185
|
+
case "conversation.item.truncated":
|
|
186
|
+
payload = {
|
|
187
|
+
kind: "item.truncated",
|
|
188
|
+
itemId: id(event.item_id, "item_id"),
|
|
189
|
+
contentIndex: integer(event.content_index, "content_index"),
|
|
190
|
+
};
|
|
191
|
+
break;
|
|
192
|
+
case "prsm.typed_input.ready":
|
|
193
|
+
payload = { kind: "input.ready" };
|
|
194
|
+
break;
|
|
195
|
+
case "input_audio_buffer.speech_started":
|
|
196
|
+
payload = {
|
|
197
|
+
kind: "speech.started",
|
|
198
|
+
itemId: id(event.item_id, "item_id"),
|
|
199
|
+
audioStartMs: integer(event.audio_start_ms, "audio_start_ms"),
|
|
200
|
+
};
|
|
201
|
+
break;
|
|
202
|
+
case "input_audio_buffer.speech_stopped":
|
|
203
|
+
payload = {
|
|
204
|
+
kind: "speech.stopped",
|
|
205
|
+
itemId: id(event.item_id, "item_id"),
|
|
206
|
+
audioEndMs: integer(event.audio_end_ms, "audio_end_ms"),
|
|
207
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
case "input_audio_buffer.committed":
|
|
210
|
+
payload = {
|
|
211
|
+
kind: "input.committed",
|
|
212
|
+
itemId: id(event.item_id, "item_id"),
|
|
213
|
+
};
|
|
214
|
+
break;
|
|
215
|
+
case "conversation.item.input_audio_transcription.delta":
|
|
216
|
+
payload = {
|
|
217
|
+
kind: "transcript.delta",
|
|
218
|
+
itemId: id(event.item_id, "item_id"),
|
|
219
|
+
delta: string(event.delta, "delta"),
|
|
220
|
+
};
|
|
221
|
+
break;
|
|
222
|
+
case "conversation.item.input_audio_transcription.completed":
|
|
223
|
+
payload = {
|
|
224
|
+
kind: "transcript.final",
|
|
225
|
+
itemId: id(event.item_id, "item_id"),
|
|
226
|
+
text: string(event.transcript, "transcript"),
|
|
227
|
+
};
|
|
228
|
+
break;
|
|
229
|
+
case "conversation.item.input_audio_transcription.failed": {
|
|
230
|
+
const error = object(event.error, "error"), itemId = id(event.item_id, "item_id");
|
|
231
|
+
payload = {
|
|
232
|
+
kind: "transcript.failed",
|
|
233
|
+
itemId,
|
|
234
|
+
error: fault({
|
|
235
|
+
code: string(error.code, "error.code"),
|
|
236
|
+
message: string(error.message, "error.message"),
|
|
237
|
+
scope: "utterance",
|
|
238
|
+
owner: { item_id: itemId },
|
|
239
|
+
}),
|
|
240
|
+
};
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
case "response.created": {
|
|
244
|
+
const response = object(event.response, "response"), metadata = response.metadata == null
|
|
245
|
+
? {}
|
|
246
|
+
: object(response.metadata, "metadata");
|
|
247
|
+
const cause = metadata.prsm_cause === undefined
|
|
248
|
+
? undefined
|
|
249
|
+
: string(metadata.prsm_cause, "prsm_cause");
|
|
250
|
+
const parent = optionalString(metadata.prsm_parent_response_id, "prsm_parent_response_id");
|
|
251
|
+
payload = {
|
|
252
|
+
kind: "response.started",
|
|
253
|
+
response: ref(response.id),
|
|
254
|
+
cause: cause === undefined
|
|
255
|
+
? "speech"
|
|
256
|
+
: cause === "user_text"
|
|
257
|
+
? "text"
|
|
258
|
+
: cause === "tool_continuation"
|
|
259
|
+
? "tools"
|
|
260
|
+
: cause === "proactive"
|
|
261
|
+
? "proactive"
|
|
262
|
+
: "unknown",
|
|
263
|
+
parent: parent === null ? null : ref(parent),
|
|
264
|
+
inputItemId: optionalString(metadata.prsm_input_item_id, "prsm_input_item_id"),
|
|
265
|
+
};
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
case "response.done": {
|
|
269
|
+
const response = object(event.response, "response"), metadata = response.metadata == null
|
|
270
|
+
? {}
|
|
271
|
+
: object(response.metadata, "metadata");
|
|
272
|
+
const details = response.status_details == null
|
|
273
|
+
? {}
|
|
274
|
+
: object(response.status_details, "status_details");
|
|
275
|
+
const status = string(response.status, "response.status");
|
|
276
|
+
payload = {
|
|
277
|
+
kind: "response.ended",
|
|
278
|
+
response: ref(response.id),
|
|
279
|
+
status: status === "completed" ||
|
|
280
|
+
status === "cancelled" ||
|
|
281
|
+
status === "failed"
|
|
282
|
+
? status
|
|
283
|
+
: "unknown",
|
|
284
|
+
reason: optionalString(details.reason, "reason"),
|
|
285
|
+
drainToken: optionalString(metadata.prsm_drain_token, "prsm_drain_token"),
|
|
286
|
+
};
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
case "response.function_call_arguments.done":
|
|
290
|
+
payload = {
|
|
291
|
+
kind: "tool.call",
|
|
292
|
+
call: Object.freeze({
|
|
293
|
+
...ref(event.response_id),
|
|
294
|
+
callId: id(event.call_id, "call_id"),
|
|
295
|
+
}),
|
|
296
|
+
itemId: id(event.item_id, "item_id"),
|
|
297
|
+
name: string(event.name, "name"),
|
|
298
|
+
arguments: argumentsObject(event.arguments),
|
|
299
|
+
};
|
|
300
|
+
break;
|
|
301
|
+
case "response.output_item.added":
|
|
302
|
+
case "response.text.delta":
|
|
303
|
+
case "response.text.done":
|
|
304
|
+
case "response.audio.delta":
|
|
305
|
+
case "response.audio.done": {
|
|
306
|
+
const item = kind === "response.output_item.added"
|
|
307
|
+
? object(event.item, "item")
|
|
308
|
+
: null;
|
|
309
|
+
if (item && string(item.type, "item.type") !== "message")
|
|
310
|
+
return null;
|
|
311
|
+
const contentIndex = kind === "response.output_item.added" &&
|
|
312
|
+
event.content_index === undefined
|
|
313
|
+
? 0
|
|
314
|
+
: integer(event.content_index, "content_index");
|
|
315
|
+
if (contentIndex !== 0)
|
|
316
|
+
throw new RimeStreamError("Unsupported Prism contract: content_index must be zero");
|
|
317
|
+
const output = Object.freeze({
|
|
318
|
+
response: ref(event.response_id),
|
|
319
|
+
itemId: id(item ? item.id : event.item_id, "item_id"),
|
|
320
|
+
outputIndex: integer(event.output_index, "output_index"),
|
|
321
|
+
contentIndex,
|
|
322
|
+
});
|
|
323
|
+
if (kind === "response.output_item.added")
|
|
324
|
+
payload = { kind: "message.started", output };
|
|
325
|
+
else if (kind === "response.text.delta")
|
|
326
|
+
payload = {
|
|
327
|
+
kind: "text.delta",
|
|
328
|
+
output,
|
|
329
|
+
delta: string(event.delta, "delta"),
|
|
330
|
+
};
|
|
331
|
+
else if (kind === "response.text.done")
|
|
332
|
+
payload = {
|
|
333
|
+
kind: "text.done",
|
|
334
|
+
output,
|
|
335
|
+
text: string(event.text, "text"),
|
|
336
|
+
};
|
|
337
|
+
else if (kind === "response.audio.delta")
|
|
338
|
+
payload = { kind: "audio.delta", output, audio: audio(event.delta) };
|
|
339
|
+
else
|
|
340
|
+
payload = { kind: "audio.done", output };
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
case "error":
|
|
344
|
+
payload = { kind: "error", error: fault(event.error) };
|
|
345
|
+
break;
|
|
346
|
+
default:
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
eventId: event.event_id === undefined ? "" : string(event.event_id, "event_id"),
|
|
351
|
+
requestId: optionalString(event.prsm_request_event_id, "prsm_request_event_id"),
|
|
352
|
+
payload,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { RealtimeConnection } from "./transport.js";
|
|
2
|
+
import * as t from "./types.js";
|
|
3
|
+
import * as p from "./protocol.js";
|
|
4
|
+
/** One conversation. Consume events concurrently with session operations. */
|
|
5
|
+
export declare class RealtimeSession {
|
|
6
|
+
private readonly socket;
|
|
7
|
+
private readonly timeouts;
|
|
8
|
+
private readonly forget;
|
|
9
|
+
private readonly created;
|
|
10
|
+
private sessionId;
|
|
11
|
+
private sessionInfo;
|
|
12
|
+
private readonly lifetime;
|
|
13
|
+
private failure;
|
|
14
|
+
private closed;
|
|
15
|
+
private closing;
|
|
16
|
+
private consuming;
|
|
17
|
+
private readonly queue;
|
|
18
|
+
private readonly queued;
|
|
19
|
+
private readonly ready;
|
|
20
|
+
private readyEpoch;
|
|
21
|
+
private readonly admission;
|
|
22
|
+
private readonly writeLock;
|
|
23
|
+
private readonly audioLock;
|
|
24
|
+
private readonly truncateLock;
|
|
25
|
+
private readonly toolLock;
|
|
26
|
+
private readonly pending;
|
|
27
|
+
private readonly responses;
|
|
28
|
+
private latest;
|
|
29
|
+
private readonly tasks;
|
|
30
|
+
private converter;
|
|
31
|
+
/** @internal Use client.realtime.connect(). */
|
|
32
|
+
constructor(socket: RealtimeConnection, timeouts: Required<t.RealtimeTimeouts>, forget: () => void);
|
|
33
|
+
/** @internal */
|
|
34
|
+
initialize(settings: p.SessionSettings, signal: AbortSignal): Promise<void>;
|
|
35
|
+
get info(): t.SessionInfo;
|
|
36
|
+
get events(): AsyncIterableIterator<t.SessionEvent>;
|
|
37
|
+
private readEvents;
|
|
38
|
+
private id;
|
|
39
|
+
private check;
|
|
40
|
+
private response;
|
|
41
|
+
private track;
|
|
42
|
+
private capacity;
|
|
43
|
+
private operation;
|
|
44
|
+
private locked;
|
|
45
|
+
private send;
|
|
46
|
+
private request;
|
|
47
|
+
private runRequest;
|
|
48
|
+
private abandon;
|
|
49
|
+
private create;
|
|
50
|
+
sendText(value: string, options?: t.RealtimeOperationOptions): Promise<t.ResponseRef>;
|
|
51
|
+
requestReply(options?: t.ReplyOptions): Promise<t.ResponseRef>;
|
|
52
|
+
addMessage(role: "user" | "assistant", value: string, options?: t.RealtimeOperationOptions): Promise<t.ItemRef>;
|
|
53
|
+
submitToolResult(call: t.ToolCallRef, output: string, options?: t.RealtimeOperationOptions): Promise<void>;
|
|
54
|
+
continueReply(parent: t.ResponseRef, options?: t.RealtimeOperationOptions): Promise<t.ResponseRef>;
|
|
55
|
+
cancel(response: t.ResponseRef, options?: t.RealtimeOperationOptions): Promise<void>;
|
|
56
|
+
clearAudio(options?: t.RealtimeOperationOptions): Promise<void>;
|
|
57
|
+
sendAudio(chunk: t.AudioChunk, options?: t.RealtimeOperationOptions): Promise<void>;
|
|
58
|
+
reportPlayback(report: t.PlaybackReport, options?: t.RealtimeOperationOptions): Promise<void>;
|
|
59
|
+
private settle;
|
|
60
|
+
private reject;
|
|
61
|
+
private fail;
|
|
62
|
+
private dispatch;
|
|
63
|
+
private wireResponse;
|
|
64
|
+
private publish;
|
|
65
|
+
close(): Promise<void>;
|
|
66
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
67
|
+
}
|