realtime-avatar 0.35.0 → 0.37.0
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/README.md +60 -0
- package/dist/{chunk-ARJEAQQT.js → chunk-FFMZERDZ.js} +1 -1
- package/dist/{chunk-WHYDSORD.js → chunk-RBK6EHVH.js} +784 -227
- package/dist/express.d.ts +2 -2
- package/dist/express.js +2 -2
- package/dist/hono.d.ts +2 -2
- package/dist/hono.js +2 -2
- package/dist/index.d.ts +18 -6
- package/dist/index.js +1 -1
- package/dist/nextjs.d.ts +2 -2
- package/dist/nextjs.js +2 -2
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/dist/tanstack-start.d.ts +2 -2
- package/dist/tanstack-start.js +2 -2
- package/dist/{types-CpnLuiJU.d.ts → types-DVL5VX3N.d.ts} +365 -63
- package/dist/{types-CUvcV0Wq.d.ts → types-RQo4LwZ3.d.ts} +1 -1
- package/package.json +1 -1
package/dist/express.d.ts
CHANGED
package/dist/express.js
CHANGED
package/dist/hono.d.ts
CHANGED
package/dist/hono.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as CreateLive2dAvatarInput, R as RegisteredAvatar, c as AvatarUpdate, d as AvatarSourceSwap, e as ClipLibraryDeclaration, f as ClipLibraryUpdate, L as LoopRedirect, g as ClipLibrary, h as AssetKind, i as Asset, j as ListSessionsOptions, U as UsageSessionPage, k as UsageSession, l as ListRecordingsQuery, m as ListRecordingsResponse, n as RecordingArtifact, o as RecordingAccessResponse, p as CreateRenderInput, q as CreditBalance, T as TranscriptPayload, V as VoiceWebhookRequest } from './types-
|
|
2
|
-
export {
|
|
1
|
+
import { a as CallPolicy, C as CallMode, S as StartCallResult, E as EndCallOptions, A as Avatar, b as CreateLive2dAvatarInput, R as RegisteredAvatar, c as AvatarUpdate, d as AvatarSourceSwap, e as ClipLibraryDeclaration, f as ClipLibraryUpdate, L as LoopRedirect, g as ClipLibrary, h as AssetKind, i as Asset, j as ListSessionsOptions, U as UsageSessionPage, k as UsageSession, l as ListRecordingsQuery, m as ListRecordingsResponse, n as RecordingArtifact, o as RecordingAccessResponse, p as CreateRenderInput, q as CreditBalance, r as operations, s as CreateSpeechInput, t as SpeechResult, u as CreateSpeechStreamRequest, v as SpeechStreamEvent, T as TranscriptPayload, V as VoiceWebhookRequest } from './types-DVL5VX3N.js';
|
|
2
|
+
export { w as AvatarClip, x as CallConnection, y as CallQueued, z as ClipDeclaration, B as ClipLibraryPlan, D as ClipSource, F as ContextMessage, G as EndCallReason, H as ExternalLlm, I as RecordingArtifactStatus, J as RecordingMode, K as RenderShot, M as SpeechAlignedText, N as VideoPolicy, O as VoiceWebhook, P as VoiceWebhookErrorCode, Q as createSpeechRequestSchema, W as createSpeechStreamRequestSchema, X as isQueued, Y as listRecordingsResponseSchema, Z as recordingAccessResponseSchema, _ as recordingArtifactSchema, $ as recordingModeSchema, a0 as speechAlignedTextSchema, a1 as speechStreamEventSchema } from './types-DVL5VX3N.js';
|
|
3
3
|
import { ConnectionHistoryResponse } from './connection-history.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
@@ -179,9 +179,9 @@ interface StartCallOptions extends CallPolicy {
|
|
|
179
179
|
/**
|
|
180
180
|
* The server-side client.
|
|
181
181
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
182
|
+
* Owns authentication, retry policy and the camelCase → snake_case translation, while
|
|
183
|
+
* keeping connection payloads intact for relay. Streaming speech uses a maintained SSE
|
|
184
|
+
* parser and the same generated boundary contracts as completed requests.
|
|
185
185
|
*
|
|
186
186
|
* This class must only ever run on a server. A browser holding the key could start unlimited
|
|
187
187
|
* calls on your account; the constructor refuses to build in a browser-like runtime so that
|
|
@@ -470,6 +470,18 @@ declare class RealtimeAvatar {
|
|
|
470
470
|
/** Read one session's bounded LiveKit connection history. Requires `usage:read`. */
|
|
471
471
|
getConnectionHistory(sessionId: string): Promise<ConnectionHistoryResponse>;
|
|
472
472
|
creditBalance(): Promise<CreditBalance>;
|
|
473
|
+
/** Completed speech audio, without a call or LiveKit. Never automatically retried. */
|
|
474
|
+
createSpeech(voiceId: operations["createSpeech"]["parameters"]["path"]["voiceId"], input: CreateSpeechInput, options?: {
|
|
475
|
+
signal?: AbortSignal;
|
|
476
|
+
}): Promise<SpeechResult>;
|
|
477
|
+
/**
|
|
478
|
+
* Incremental mono PCM and absolute alignment, without a call or LiveKit. The first next()
|
|
479
|
+
* starts the paid request; break/return or signal abort cancels it. Never retried. A failed
|
|
480
|
+
* terminal is yielded, not thrown; malformed/truncated transport throws RealtimeAvatarError.
|
|
481
|
+
*/
|
|
482
|
+
createSpeechStream(voiceId: operations["createSpeechStream"]["parameters"]["path"]["voiceId"], input: CreateSpeechStreamRequest, options?: {
|
|
483
|
+
signal?: AbortSignal;
|
|
484
|
+
}): AsyncGenerator<SpeechStreamEvent, void, unknown>;
|
|
473
485
|
}
|
|
474
486
|
|
|
475
487
|
/** Base for everything this SDK throws, so `catch (e) { if (e instanceof RealtimeAvatarError) }` works. */
|
|
@@ -949,4 +961,4 @@ declare const proxyEndRequestSchema: z.ZodObject<{
|
|
|
949
961
|
}>>>;
|
|
950
962
|
}, z.core.$strict>;
|
|
951
963
|
|
|
952
|
-
export { Asset, AssetKind, Avatar, AvatarSourceSwap, AvatarUpdate, CallMode, CallPolicy, ClipLibrary, ClipLibraryDeclaration, ClipLibraryUpdate, CreateLive2dAvatarInput, CreateRenderInput, CreditBalance, DEFAULT_FISH_TTS_MODEL, EndCallOptions, type ExternalSpeechSegment, type ExternalTurnContext, type ExternalUtterance, FISH_DELIVERY_MODELS, type FishDelivery, type FishTtsModel, ListRecordingsQuery, ListRecordingsResponse, type ListRendersQuery, type ListRendersResponse, ListSessionsOptions, LoopRedirect, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, type RealtimeAvatarOptions, RealtimeAvatarWebhookError, RecordingAccessResponse, RecordingArtifact, RegisteredAvatar, type Render, type RenderAccessResponse, type RenderFailureCode, type RenderPlayback, type RenderStatus, type ShotTiming, type StartCallOptions, StartCallResult, TranscriptPayload, UsageSession, UsageSessionPage, VoiceWebhookRequest, type WebhookVerificationErrorCode, capacityBusyResponseSchema, clipLibraryDeclarationSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, renderAccessResponseSchema, renderSchema, verifyTranscript, verifyVoiceWebhook };
|
|
964
|
+
export { Asset, AssetKind, Avatar, AvatarSourceSwap, AvatarUpdate, CallMode, CallPolicy, ClipLibrary, ClipLibraryDeclaration, ClipLibraryUpdate, CreateLive2dAvatarInput, CreateRenderInput, CreateSpeechInput, CreateSpeechStreamRequest, CreditBalance, DEFAULT_FISH_TTS_MODEL, EndCallOptions, type ExternalSpeechSegment, type ExternalTurnContext, type ExternalUtterance, FISH_DELIVERY_MODELS, type FishDelivery, type FishTtsModel, ListRecordingsQuery, ListRecordingsResponse, type ListRendersQuery, type ListRendersResponse, ListSessionsOptions, LoopRedirect, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, type RealtimeAvatarOptions, RealtimeAvatarWebhookError, RecordingAccessResponse, RecordingArtifact, RegisteredAvatar, type Render, type RenderAccessResponse, type RenderFailureCode, type RenderPlayback, type RenderStatus, type ShotTiming, SpeechResult, SpeechStreamEvent, type StartCallOptions, StartCallResult, TranscriptPayload, UsageSession, UsageSessionPage, VoiceWebhookRequest, type WebhookVerificationErrorCode, capacityBusyResponseSchema, clipLibraryDeclarationSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, renderAccessResponseSchema, renderSchema, verifyTranscript, verifyVoiceWebhook };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './chunk-6KQS7CTR.js';
|
|
2
|
-
export { DEFAULT_FISH_TTS_MODEL, FISH_DELIVERY_MODELS, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarWebhookError, capacityBusyResponseSchema, clipLibraryDeclarationSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, isQueued, listRecordingsResponseSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, renderAccessResponseSchema, renderSchema, verifyTranscript, verifyVoiceWebhook } from './chunk-
|
|
2
|
+
export { DEFAULT_FISH_TTS_MODEL, FISH_DELIVERY_MODELS, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarWebhookError, capacityBusyResponseSchema, clipLibraryDeclarationSchema, createSpeechRequestSchema, createSpeechStreamRequestSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, isQueued, listRecordingsResponseSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, renderAccessResponseSchema, renderSchema, speechAlignedTextSchema, speechStreamEventSchema, verifyTranscript, verifyVoiceWebhook } from './chunk-RBK6EHVH.js';
|
|
3
3
|
import './chunk-MCIXU6XP.js';
|
package/dist/nextjs.d.ts
CHANGED
package/dist/nextjs.js
CHANGED
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { DEFAULT_FISH_TTS_MODEL, ExternalSpeechSegment, ExternalTurnContext, ExternalUtterance, FISH_DELIVERY_MODELS, FishDelivery, FishTtsModel, ListRendersQuery, ListRendersResponse, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarOptions, RealtimeAvatarWebhookError, Render, RenderAccessResponse, RenderFailureCode, RenderPlayback, RenderStatus, ShotTiming, StartCallOptions, WebhookVerificationErrorCode, capacityBusyResponseSchema, clipLibraryDeclarationSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, renderAccessResponseSchema, renderSchema, verifyTranscript, verifyVoiceWebhook } from './index.js';
|
|
2
|
-
export { i as Asset, h as AssetKind, A as Avatar,
|
|
2
|
+
export { i as Asset, h as AssetKind, A as Avatar, w as AvatarClip, d as AvatarSourceSwap, c as AvatarUpdate, x as CallConnection, C as CallMode, a as CallPolicy, y as CallQueued, z as ClipDeclaration, g as ClipLibrary, e as ClipLibraryDeclaration, B as ClipLibraryPlan, f as ClipLibraryUpdate, D as ClipSource, F as ContextMessage, b as CreateLive2dAvatarInput, p as CreateRenderInput, s as CreateSpeechInput, u as CreateSpeechStreamRequest, q as CreditBalance, E as EndCallOptions, G as EndCallReason, H as ExternalLlm, l as ListRecordingsQuery, m as ListRecordingsResponse, j as ListSessionsOptions, L as LoopRedirect, o as RecordingAccessResponse, n as RecordingArtifact, I as RecordingArtifactStatus, J as RecordingMode, R as RegisteredAvatar, K as RenderShot, M as SpeechAlignedText, t as SpeechResult, v as SpeechStreamEvent, S as StartCallResult, T as TranscriptPayload, k as UsageSession, U as UsageSessionPage, N as VideoPolicy, O as VoiceWebhook, P as VoiceWebhookErrorCode, V as VoiceWebhookRequest, Q as createSpeechRequestSchema, W as createSpeechStreamRequestSchema, X as isQueued, Y as listRecordingsResponseSchema, Z as recordingAccessResponseSchema, _ as recordingArtifactSchema, $ as recordingModeSchema, a0 as speechAlignedTextSchema, a1 as speechStreamEventSchema } from './types-DVL5VX3N.js';
|
|
3
3
|
import './connection-history.js';
|
|
4
4
|
import 'zod';
|
package/dist/server.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './chunk-6KQS7CTR.js';
|
|
2
|
-
export { DEFAULT_FISH_TTS_MODEL, FISH_DELIVERY_MODELS, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarWebhookError, capacityBusyResponseSchema, clipLibraryDeclarationSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, isQueued, listRecordingsResponseSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, renderAccessResponseSchema, renderSchema, verifyTranscript, verifyVoiceWebhook } from './chunk-
|
|
2
|
+
export { DEFAULT_FISH_TTS_MODEL, FISH_DELIVERY_MODELS, RealtimeAvatar, RealtimeAvatarError, RealtimeAvatarHttpError, RealtimeAvatarWebhookError, capacityBusyResponseSchema, clipLibraryDeclarationSchema, createSpeechRequestSchema, createSpeechStreamRequestSchema, externalSpeechSegmentSchema, externalTurnContextSchema, externalUtteranceSchema, fishTtsModelSchema, isQueued, listRecordingsResponseSchema, listRendersResponseSchema, liveKitSessionGrantSchema, proxyConnectRequestSchema, proxyEndRequestSchema, recordingAccessResponseSchema, recordingArtifactSchema, recordingModeSchema, renderAccessResponseSchema, renderSchema, speechAlignedTextSchema, speechStreamEventSchema, verifyTranscript, verifyVoiceWebhook } from './chunk-RBK6EHVH.js';
|
|
3
3
|
import './chunk-MCIXU6XP.js';
|
package/dist/tanstack-start.d.ts
CHANGED
package/dist/tanstack-start.js
CHANGED
|
@@ -1,67 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
declare const createLive2dAvatarInputSchema: z.ZodObject<{
|
|
4
|
-
displayName: z.ZodString;
|
|
5
|
-
settings: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
6
|
-
metadata: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
7
|
-
voice: z.ZodObject<{
|
|
8
|
-
provider: z.ZodEnum<{
|
|
9
|
-
cartesia: "cartesia";
|
|
10
|
-
fish: "fish";
|
|
11
|
-
}>;
|
|
12
|
-
voice_id: z.ZodString;
|
|
13
|
-
model: z.ZodOptional<z.ZodString>;
|
|
14
|
-
speed: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
|
|
15
|
-
emotion: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
16
|
-
language: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
17
|
-
}, z.core.$strict>;
|
|
18
|
-
}, z.core.$strict>;
|
|
19
|
-
declare const avatarResponseSchema: z.ZodObject<{
|
|
20
|
-
id: z.ZodString;
|
|
21
|
-
tenantId: z.ZodString;
|
|
22
|
-
displayName: z.ZodString;
|
|
23
|
-
renderer: z.ZodEnum<{
|
|
24
|
-
video: "video";
|
|
25
|
-
live2d: "live2d";
|
|
26
|
-
}>;
|
|
27
|
-
sourceKind: z.ZodEnum<{
|
|
28
|
-
video: "video";
|
|
29
|
-
image: "image";
|
|
30
|
-
}>;
|
|
31
|
-
modelId: z.ZodEnum<{
|
|
32
|
-
"realtime-avatar-live-v1": "realtime-avatar-live-v1";
|
|
33
|
-
"realtime-avatar-video-v1": "realtime-avatar-video-v1";
|
|
34
|
-
}>;
|
|
35
|
-
sourceAssetId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
36
|
-
status: z.ZodEnum<{
|
|
37
|
-
ready: "ready";
|
|
38
|
-
failed: "failed";
|
|
39
|
-
draft: "draft";
|
|
40
|
-
preprocessing: "preprocessing";
|
|
41
|
-
disabled: "disabled";
|
|
42
|
-
deleted: "deleted";
|
|
43
|
-
}>;
|
|
44
|
-
error: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
45
|
-
idleVideoStatus: z.ZodEnum<{
|
|
46
|
-
ready: "ready";
|
|
47
|
-
failed: "failed";
|
|
48
|
-
none: "none";
|
|
49
|
-
queued: "queued";
|
|
50
|
-
generating: "generating";
|
|
51
|
-
}>;
|
|
52
|
-
defaultVoiceId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
53
|
-
llm: z.ZodUnion<readonly [z.ZodObject<{
|
|
54
|
-
provider: z.ZodEnum<{
|
|
55
|
-
local: "local";
|
|
56
|
-
gemini: "gemini";
|
|
57
|
-
openai: "openai";
|
|
58
|
-
}>;
|
|
59
|
-
model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
60
|
-
}, z.core.$strict>, z.ZodNull]>;
|
|
61
|
-
createdAt: z.ZodString;
|
|
62
|
-
updatedAt: z.ZodString;
|
|
63
|
-
}, z.core.$strict>;
|
|
64
|
-
|
|
65
3
|
interface components {
|
|
66
4
|
schemas: {
|
|
67
5
|
LiveKitSessionRequest: {
|
|
@@ -1172,6 +1110,105 @@ interface components {
|
|
|
1172
1110
|
/** @description BCP-47 tag such as en-AU. Shapes how numbers, dates and units are read; it does not change the voice. */
|
|
1173
1111
|
language?: string;
|
|
1174
1112
|
};
|
|
1113
|
+
CreateSpeechStreamRequest: {
|
|
1114
|
+
/** @description What to say, at most 2,000 characters after trimming. Billed per UTF-8 byte: plain English is one byte per character, accented letters and other scripts use 2 to 4. Text in [square brackets] may be performed as a delivery cue rather than spoken. */
|
|
1115
|
+
text: string;
|
|
1116
|
+
/** @description Speaking rate, 0.5 to 2. Omit for the voice's natural pace. */
|
|
1117
|
+
speed?: number;
|
|
1118
|
+
/** @description BCP-47 tag such as en-AU. Shapes how numbers, dates and units are read; it does not change the voice. */
|
|
1119
|
+
language?: string;
|
|
1120
|
+
};
|
|
1121
|
+
SpeechStreamEvent: {
|
|
1122
|
+
/** Format: uuid */
|
|
1123
|
+
requestId: string;
|
|
1124
|
+
/** @constant */
|
|
1125
|
+
type: "started";
|
|
1126
|
+
/** @constant */
|
|
1127
|
+
encoding: "pcm_s16le";
|
|
1128
|
+
/** @constant */
|
|
1129
|
+
sampleRate: 24000;
|
|
1130
|
+
/** @constant */
|
|
1131
|
+
channels: 1;
|
|
1132
|
+
} | {
|
|
1133
|
+
/** Format: uuid */
|
|
1134
|
+
requestId: string;
|
|
1135
|
+
/** @constant */
|
|
1136
|
+
type: "audio";
|
|
1137
|
+
sequence: number;
|
|
1138
|
+
sampleOffset: number;
|
|
1139
|
+
/** Format: base64 */
|
|
1140
|
+
audioBase64: string;
|
|
1141
|
+
} | {
|
|
1142
|
+
/** Format: uuid */
|
|
1143
|
+
requestId: string;
|
|
1144
|
+
/** @constant */
|
|
1145
|
+
type: "alignment";
|
|
1146
|
+
chunkSeq: number;
|
|
1147
|
+
segments: {
|
|
1148
|
+
text: string;
|
|
1149
|
+
start: number;
|
|
1150
|
+
end: number;
|
|
1151
|
+
}[];
|
|
1152
|
+
} | {
|
|
1153
|
+
/** Format: uuid */
|
|
1154
|
+
requestId: string;
|
|
1155
|
+
/** @constant */
|
|
1156
|
+
type: "completed";
|
|
1157
|
+
totalSamples: number;
|
|
1158
|
+
billedCredits: number;
|
|
1159
|
+
billedBytes: number;
|
|
1160
|
+
} | {
|
|
1161
|
+
/** Format: uuid */
|
|
1162
|
+
requestId: string;
|
|
1163
|
+
/** @constant */
|
|
1164
|
+
type: "failed";
|
|
1165
|
+
error: {
|
|
1166
|
+
/** @description Human-readable message. Not a stable contract — switch on `code` or `status`. */
|
|
1167
|
+
error: string;
|
|
1168
|
+
/** @description Repeats the HTTP status in the body. Always present. */
|
|
1169
|
+
status: number;
|
|
1170
|
+
/** @description Machine-readable discriminator. ALWAYS present: a failure that names its own — billing, clip-library and loop refusals, `insufficient_scope` — carries that, and everything else carries the status's default (`unauthorized`, `not_found`, `rate_limited`, …). Switch on this rather than on `error`, whose wording is not a contract. The set is open and grows with the API; the codes a given endpoint can return are documented with that endpoint at https://realtimeavatar.ai/docs/api-reference. */
|
|
1171
|
+
code: string;
|
|
1172
|
+
/**
|
|
1173
|
+
* Format: uri
|
|
1174
|
+
* @description Where to read how to resolve a failure of this class — the authentication guide for 401/403, the API reference otherwise. Always present.
|
|
1175
|
+
*/
|
|
1176
|
+
documentation: string;
|
|
1177
|
+
/** @description Set when the failure is worth retrying as-is. */
|
|
1178
|
+
retryable?: boolean;
|
|
1179
|
+
/**
|
|
1180
|
+
* Format: uuid
|
|
1181
|
+
* @description Server-generated correlation ID, also returned in X-Request-ID on correlated failures. Quote this when contacting support. Detailed diagnostics require separate operational access.
|
|
1182
|
+
*/
|
|
1183
|
+
requestId?: string;
|
|
1184
|
+
/**
|
|
1185
|
+
* @description Present on `403 insufficient_scope` — the one scope this operation needed and the key did not carry. Repeated in the `WWW-Authenticate` challenge as `scope=`.
|
|
1186
|
+
* @enum {string}
|
|
1187
|
+
*/
|
|
1188
|
+
requiredScope?: "*" | "api_keys:write" | "credits:read" | "avatars:read" | "avatars:write" | "realtime:write" | "usage:read" | "recordings:read" | "usage:write" | "speech:write" | "renders:read" | "renders:write";
|
|
1189
|
+
/** @description Present alongside `requiredScope` — the scopes the presented key does carry. */
|
|
1190
|
+
grantedScopes?: ("*" | "api_keys:write" | "credits:read" | "avatars:read" | "avatars:write" | "realtime:write" | "usage:read" | "recordings:read" | "usage:write" | "speech:write" | "renders:read" | "renders:write")[];
|
|
1191
|
+
/** @description Present on 402 — where to send the user to top up. */
|
|
1192
|
+
billingUrl?: string;
|
|
1193
|
+
/** @description On concurrency_limit_reached: the workspace's concurrent session limit. */
|
|
1194
|
+
maxConcurrentSessions?: number;
|
|
1195
|
+
/** @description Legacy concurrency count: occupied reservations, including active, connecting and starting sessions. Not the number of active conversations. */
|
|
1196
|
+
liveSessions?: number;
|
|
1197
|
+
/** @description On concurrency_limit_reached: counted reservations with started media, observed at refusal. */
|
|
1198
|
+
activeSessions?: number;
|
|
1199
|
+
/** @description On concurrency_limit_reached: counted reservations with an attached session that has not started media. */
|
|
1200
|
+
connectingSessions?: number;
|
|
1201
|
+
/** @description On concurrency_limit_reached: counted in-flight starts with no attached session yet. */
|
|
1202
|
+
pendingSessions?: number;
|
|
1203
|
+
} & {
|
|
1204
|
+
[key: string]: unknown;
|
|
1205
|
+
};
|
|
1206
|
+
};
|
|
1207
|
+
SpeechAlignedText: {
|
|
1208
|
+
text: string;
|
|
1209
|
+
start: number;
|
|
1210
|
+
end: number;
|
|
1211
|
+
};
|
|
1175
1212
|
CreditBalance: {
|
|
1176
1213
|
tenantId: string;
|
|
1177
1214
|
balanceCreditMicros: number;
|
|
@@ -2239,6 +2276,96 @@ interface operations {
|
|
|
2239
2276
|
};
|
|
2240
2277
|
};
|
|
2241
2278
|
};
|
|
2279
|
+
createSpeechStream: {
|
|
2280
|
+
parameters: {
|
|
2281
|
+
query?: never;
|
|
2282
|
+
header?: never;
|
|
2283
|
+
path: {
|
|
2284
|
+
voiceId: string;
|
|
2285
|
+
};
|
|
2286
|
+
cookie?: never;
|
|
2287
|
+
};
|
|
2288
|
+
requestBody: {
|
|
2289
|
+
content: {
|
|
2290
|
+
"application/json": components["schemas"]["CreateSpeechStreamRequest"];
|
|
2291
|
+
};
|
|
2292
|
+
};
|
|
2293
|
+
responses: {
|
|
2294
|
+
/** @description SSE frames whose JSON data follows SpeechStreamEvent. Terminal completed confirms billing; failed is an explicit failure, including after partial audio. */
|
|
2295
|
+
200: {
|
|
2296
|
+
headers: {
|
|
2297
|
+
[name: string]: unknown;
|
|
2298
|
+
};
|
|
2299
|
+
content: {
|
|
2300
|
+
"text/event-stream": components["schemas"]["SpeechStreamEvent"];
|
|
2301
|
+
};
|
|
2302
|
+
};
|
|
2303
|
+
/** @description Missing, malformed, revoked, or expired key. */
|
|
2304
|
+
401: {
|
|
2305
|
+
headers: {
|
|
2306
|
+
[name: string]: unknown;
|
|
2307
|
+
};
|
|
2308
|
+
content: {
|
|
2309
|
+
"application/json": components["schemas"]["Error"];
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2312
|
+
/** @description Insufficient scope, inactive workspace, or speech_requires_purchase. */
|
|
2313
|
+
403: {
|
|
2314
|
+
headers: {
|
|
2315
|
+
[name: string]: unknown;
|
|
2316
|
+
};
|
|
2317
|
+
content: {
|
|
2318
|
+
"application/json": components["schemas"]["Error"];
|
|
2319
|
+
};
|
|
2320
|
+
};
|
|
2321
|
+
/** @description voice_not_found in this workspace. */
|
|
2322
|
+
404: {
|
|
2323
|
+
headers: {
|
|
2324
|
+
[name: string]: unknown;
|
|
2325
|
+
};
|
|
2326
|
+
content: {
|
|
2327
|
+
"application/json": components["schemas"]["Error"];
|
|
2328
|
+
};
|
|
2329
|
+
};
|
|
2330
|
+
/** @description voice_not_ready. */
|
|
2331
|
+
409: {
|
|
2332
|
+
headers: {
|
|
2333
|
+
[name: string]: unknown;
|
|
2334
|
+
};
|
|
2335
|
+
content: {
|
|
2336
|
+
"application/json": components["schemas"]["Error"];
|
|
2337
|
+
};
|
|
2338
|
+
};
|
|
2339
|
+
/** @description Invalid request or voice_unavailable. */
|
|
2340
|
+
422: {
|
|
2341
|
+
headers: {
|
|
2342
|
+
[name: string]: unknown;
|
|
2343
|
+
};
|
|
2344
|
+
content: {
|
|
2345
|
+
"application/json": components["schemas"]["Error"];
|
|
2346
|
+
};
|
|
2347
|
+
};
|
|
2348
|
+
/** @description rate_limited or speech_busy; honour Retry-After. */
|
|
2349
|
+
429: {
|
|
2350
|
+
headers: {
|
|
2351
|
+
"Retry-After"?: number;
|
|
2352
|
+
[name: string]: unknown;
|
|
2353
|
+
};
|
|
2354
|
+
content: {
|
|
2355
|
+
"application/json": components["schemas"]["Error"];
|
|
2356
|
+
};
|
|
2357
|
+
};
|
|
2358
|
+
/** @description Error. Route-dependent: 400 (a field this route cannot honour — see `portraitUrl` on `UpdateAvatarRequest`), 402 (insufficient credits or spend limit), 404 (no such avatar, voice, or key for this tenant — the message often reads "does not belong to this tenant", which is a missing id and not a permission failure), 408 (the request was cancelled), 409 (the resource is not in a state that accepts this write — a stale `expectedRevision`, a render already in flight, or a mint that asked for a clip library still building), 411 (`POST /v1/assets/remote` only — the origin serving `remoteUrl` sent no `content-length`, so the platform will not stream it), 422 (strict schema rejection, or a motion description the safety screen refused), 429 (rate limited), 502 (upstream render failed), 503 (a dependency this route needs is unavailable — retryable, and nothing was written), 504 (the upstream request budget expired), 500 (unhandled). Switch on `code` where present, else `status`. */
|
|
2359
|
+
default: {
|
|
2360
|
+
headers: {
|
|
2361
|
+
[name: string]: unknown;
|
|
2362
|
+
};
|
|
2363
|
+
content: {
|
|
2364
|
+
"application/json": components["schemas"]["Error"];
|
|
2365
|
+
};
|
|
2366
|
+
};
|
|
2367
|
+
};
|
|
2368
|
+
};
|
|
2242
2369
|
listAvatars: {
|
|
2243
2370
|
parameters: {
|
|
2244
2371
|
query?: never;
|
|
@@ -3710,6 +3837,68 @@ interface operations {
|
|
|
3710
3837
|
};
|
|
3711
3838
|
}
|
|
3712
3839
|
|
|
3840
|
+
declare const createLive2dAvatarInputSchema: z.ZodObject<{
|
|
3841
|
+
displayName: z.ZodString;
|
|
3842
|
+
settings: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
3843
|
+
metadata: z.ZodOptional<z.ZodCustom<Record<string, unknown>, Record<string, unknown>>>;
|
|
3844
|
+
voice: z.ZodObject<{
|
|
3845
|
+
provider: z.ZodEnum<{
|
|
3846
|
+
cartesia: "cartesia";
|
|
3847
|
+
fish: "fish";
|
|
3848
|
+
}>;
|
|
3849
|
+
voice_id: z.ZodString;
|
|
3850
|
+
model: z.ZodOptional<z.ZodString>;
|
|
3851
|
+
speed: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodNull]>>;
|
|
3852
|
+
emotion: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
3853
|
+
language: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
3854
|
+
}, z.core.$strict>;
|
|
3855
|
+
}, z.core.$strict>;
|
|
3856
|
+
declare const avatarResponseSchema: z.ZodObject<{
|
|
3857
|
+
id: z.ZodString;
|
|
3858
|
+
tenantId: z.ZodString;
|
|
3859
|
+
displayName: z.ZodString;
|
|
3860
|
+
renderer: z.ZodEnum<{
|
|
3861
|
+
video: "video";
|
|
3862
|
+
live2d: "live2d";
|
|
3863
|
+
}>;
|
|
3864
|
+
sourceKind: z.ZodEnum<{
|
|
3865
|
+
video: "video";
|
|
3866
|
+
image: "image";
|
|
3867
|
+
}>;
|
|
3868
|
+
modelId: z.ZodEnum<{
|
|
3869
|
+
"realtime-avatar-live-v1": "realtime-avatar-live-v1";
|
|
3870
|
+
"realtime-avatar-video-v1": "realtime-avatar-video-v1";
|
|
3871
|
+
}>;
|
|
3872
|
+
sourceAssetId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
3873
|
+
status: z.ZodEnum<{
|
|
3874
|
+
ready: "ready";
|
|
3875
|
+
failed: "failed";
|
|
3876
|
+
draft: "draft";
|
|
3877
|
+
preprocessing: "preprocessing";
|
|
3878
|
+
disabled: "disabled";
|
|
3879
|
+
deleted: "deleted";
|
|
3880
|
+
}>;
|
|
3881
|
+
error: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
3882
|
+
idleVideoStatus: z.ZodEnum<{
|
|
3883
|
+
ready: "ready";
|
|
3884
|
+
failed: "failed";
|
|
3885
|
+
none: "none";
|
|
3886
|
+
queued: "queued";
|
|
3887
|
+
generating: "generating";
|
|
3888
|
+
}>;
|
|
3889
|
+
defaultVoiceId: z.ZodUnion<readonly [z.ZodString, z.ZodNull]>;
|
|
3890
|
+
llm: z.ZodUnion<readonly [z.ZodObject<{
|
|
3891
|
+
provider: z.ZodEnum<{
|
|
3892
|
+
local: "local";
|
|
3893
|
+
gemini: "gemini";
|
|
3894
|
+
openai: "openai";
|
|
3895
|
+
}>;
|
|
3896
|
+
model: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull]>>;
|
|
3897
|
+
}, z.core.$strict>, z.ZodNull]>;
|
|
3898
|
+
createdAt: z.ZodString;
|
|
3899
|
+
updatedAt: z.ZodString;
|
|
3900
|
+
}, z.core.$strict>;
|
|
3901
|
+
|
|
3713
3902
|
declare const listUsageSessionsResponseSchema: z.ZodObject<{
|
|
3714
3903
|
data: z.ZodArray<z.ZodObject<{
|
|
3715
3904
|
sessionId: z.ZodString;
|
|
@@ -4083,6 +4272,112 @@ declare const externalLlmOptionsSchema: z.ZodObject<{
|
|
|
4083
4272
|
}, z.core.$strict>;
|
|
4084
4273
|
declare function externalLlmToWire(input: z.input<typeof externalLlmOptionsSchema>): z.output<typeof externalLlmWireSchema>;
|
|
4085
4274
|
|
|
4275
|
+
declare const speechAlignedTextSchema: z.ZodObject<{
|
|
4276
|
+
text: z.ZodString;
|
|
4277
|
+
start: z.ZodNumber;
|
|
4278
|
+
end: z.ZodNumber;
|
|
4279
|
+
}, z.core.$strict>;
|
|
4280
|
+
declare const createSpeechRequestSchema: z.ZodObject<{
|
|
4281
|
+
text: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
4282
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
4283
|
+
language: z.ZodOptional<z.ZodString>;
|
|
4284
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
4285
|
+
mp3: "mp3";
|
|
4286
|
+
wav: "wav";
|
|
4287
|
+
}>>;
|
|
4288
|
+
}, z.core.$strict>;
|
|
4289
|
+
type CreateSpeechInput = z.input<typeof createSpeechRequestSchema>;
|
|
4290
|
+
declare const createSpeechStreamRequestSchema: z.ZodObject<{
|
|
4291
|
+
text: z.ZodPipe<z.ZodString, z.ZodString>;
|
|
4292
|
+
speed: z.ZodOptional<z.ZodNumber>;
|
|
4293
|
+
language: z.ZodOptional<z.ZodString>;
|
|
4294
|
+
}, z.core.$strict>;
|
|
4295
|
+
type CreateSpeechStreamRequest = z.infer<typeof createSpeechStreamRequestSchema>;
|
|
4296
|
+
type SpeechAlignedText = z.infer<typeof speechAlignedTextSchema>;
|
|
4297
|
+
declare const speechStreamEventSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
4298
|
+
requestId: z.ZodUUID;
|
|
4299
|
+
type: z.ZodLiteral<"started">;
|
|
4300
|
+
encoding: z.ZodLiteral<"pcm_s16le">;
|
|
4301
|
+
sampleRate: z.ZodLiteral<24000>;
|
|
4302
|
+
channels: z.ZodLiteral<1>;
|
|
4303
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4304
|
+
requestId: z.ZodUUID;
|
|
4305
|
+
type: z.ZodLiteral<"audio">;
|
|
4306
|
+
sequence: z.ZodInt;
|
|
4307
|
+
sampleOffset: z.ZodInt;
|
|
4308
|
+
audioBase64: z.ZodBase64;
|
|
4309
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4310
|
+
requestId: z.ZodUUID;
|
|
4311
|
+
type: z.ZodLiteral<"alignment">;
|
|
4312
|
+
chunkSeq: z.ZodInt;
|
|
4313
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
4314
|
+
text: z.ZodString;
|
|
4315
|
+
start: z.ZodNumber;
|
|
4316
|
+
end: z.ZodNumber;
|
|
4317
|
+
}, z.core.$strict>>;
|
|
4318
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4319
|
+
requestId: z.ZodUUID;
|
|
4320
|
+
type: z.ZodLiteral<"completed">;
|
|
4321
|
+
totalSamples: z.ZodInt;
|
|
4322
|
+
billedCredits: z.ZodNumber;
|
|
4323
|
+
billedBytes: z.ZodInt;
|
|
4324
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
4325
|
+
requestId: z.ZodUUID;
|
|
4326
|
+
type: z.ZodLiteral<"failed">;
|
|
4327
|
+
error: z.ZodObject<{
|
|
4328
|
+
error: z.ZodString;
|
|
4329
|
+
status: z.ZodInt;
|
|
4330
|
+
code: z.ZodString;
|
|
4331
|
+
documentation: z.ZodURL;
|
|
4332
|
+
retryable: z.ZodOptional<z.ZodBoolean>;
|
|
4333
|
+
requestId: z.ZodOptional<z.ZodUUID>;
|
|
4334
|
+
requiredScope: z.ZodOptional<z.ZodEnum<{
|
|
4335
|
+
"*": "*";
|
|
4336
|
+
"api_keys:write": "api_keys:write";
|
|
4337
|
+
"credits:read": "credits:read";
|
|
4338
|
+
"avatars:read": "avatars:read";
|
|
4339
|
+
"avatars:write": "avatars:write";
|
|
4340
|
+
"realtime:write": "realtime:write";
|
|
4341
|
+
"usage:read": "usage:read";
|
|
4342
|
+
"recordings:read": "recordings:read";
|
|
4343
|
+
"usage:write": "usage:write";
|
|
4344
|
+
"speech:write": "speech:write";
|
|
4345
|
+
"renders:read": "renders:read";
|
|
4346
|
+
"renders:write": "renders:write";
|
|
4347
|
+
}>>;
|
|
4348
|
+
grantedScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
4349
|
+
"*": "*";
|
|
4350
|
+
"api_keys:write": "api_keys:write";
|
|
4351
|
+
"credits:read": "credits:read";
|
|
4352
|
+
"avatars:read": "avatars:read";
|
|
4353
|
+
"avatars:write": "avatars:write";
|
|
4354
|
+
"realtime:write": "realtime:write";
|
|
4355
|
+
"usage:read": "usage:read";
|
|
4356
|
+
"recordings:read": "recordings:read";
|
|
4357
|
+
"usage:write": "usage:write";
|
|
4358
|
+
"speech:write": "speech:write";
|
|
4359
|
+
"renders:read": "renders:read";
|
|
4360
|
+
"renders:write": "renders:write";
|
|
4361
|
+
}>>>;
|
|
4362
|
+
billingUrl: z.ZodOptional<z.ZodString>;
|
|
4363
|
+
maxConcurrentSessions: z.ZodOptional<z.ZodInt>;
|
|
4364
|
+
liveSessions: z.ZodOptional<z.ZodInt>;
|
|
4365
|
+
activeSessions: z.ZodOptional<z.ZodInt>;
|
|
4366
|
+
connectingSessions: z.ZodOptional<z.ZodInt>;
|
|
4367
|
+
pendingSessions: z.ZodOptional<z.ZodInt>;
|
|
4368
|
+
}, z.core.$loose>;
|
|
4369
|
+
}, z.core.$strict>]>;
|
|
4370
|
+
type SpeechStreamEvent = z.infer<typeof speechStreamEventSchema>;
|
|
4371
|
+
declare const speechContentTypeSchema: z.ZodEnum<{
|
|
4372
|
+
"audio/mpeg": "audio/mpeg";
|
|
4373
|
+
"audio/wav": "audio/wav";
|
|
4374
|
+
}>;
|
|
4375
|
+
type SpeechContentType = z.infer<typeof speechContentTypeSchema>;
|
|
4376
|
+
declare function readSpeechHeaders(headers: Headers): {
|
|
4377
|
+
billedCredits: number | null;
|
|
4378
|
+
billedBytes: number | null;
|
|
4379
|
+
};
|
|
4380
|
+
|
|
4086
4381
|
/**
|
|
4087
4382
|
* The public shapes. Everything an integrator touches is here, in one file, on purpose:
|
|
4088
4383
|
* an agent reading this repo should be able to learn the whole surface without following
|
|
@@ -4113,6 +4408,13 @@ declare function externalLlmToWire(input: z.input<typeof externalLlmOptionsSchem
|
|
|
4113
4408
|
* Verified by mutation: renaming `participant_token` in the generated file fails the typecheck.
|
|
4114
4409
|
*/
|
|
4115
4410
|
|
|
4411
|
+
/** DERIVATION: binary bytes are SDK-owned; media types and billing derive from createSpeech's operation. */
|
|
4412
|
+
type SpeechResult = ReturnType<typeof readSpeechHeaders> & {
|
|
4413
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
4414
|
+
contentType: SpeechContentType;
|
|
4415
|
+
requestId: string | null;
|
|
4416
|
+
};
|
|
4417
|
+
|
|
4116
4418
|
/**
|
|
4117
4419
|
* The wire shapes, from the published contract at https://realtimeavatar.ai/openapi.json.
|
|
4118
4420
|
*
|
|
@@ -4580,4 +4882,4 @@ interface TranscriptPayload {
|
|
|
4580
4882
|
client_metadata: Record<string, string>;
|
|
4581
4883
|
}
|
|
4582
4884
|
|
|
4583
|
-
export { type Avatar as A, type
|
|
4885
|
+
export { recordingModeSchema as $, type Avatar as A, type ClipLibraryPlan as B, type CallMode as C, type ClipSource as D, type EndCallOptions as E, type ContextMessage as F, type EndCallReason as G, type ExternalLlm as H, type RecordingArtifactStatus as I, type RecordingMode as J, type RenderShot as K, type LoopRedirect as L, type SpeechAlignedText as M, type VideoPolicy as N, type VoiceWebhook as O, type VoiceWebhookErrorCode as P, createSpeechRequestSchema as Q, type RegisteredAvatar as R, type StartCallResult as S, type TranscriptPayload as T, type UsageSessionPage as U, type VoiceWebhookRequest as V, createSpeechStreamRequestSchema as W, isQueued as X, listRecordingsResponseSchema as Y, recordingAccessResponseSchema as Z, recordingArtifactSchema as _, type CallPolicy as a, speechAlignedTextSchema as a0, speechStreamEventSchema as a1, type CreateLive2dAvatarInput as b, type AvatarUpdate as c, type AvatarSourceSwap as d, type ClipLibraryDeclaration as e, type ClipLibraryUpdate as f, type ClipLibrary as g, type AssetKind as h, type Asset as i, type ListSessionsOptions as j, type UsageSession as k, type ListRecordingsQuery as l, type ListRecordingsResponse as m, type RecordingArtifact as n, type RecordingAccessResponse as o, type CreateRenderInput as p, type CreditBalance as q, type operations as r, type CreateSpeechInput as s, type SpeechResult as t, type CreateSpeechStreamRequest as u, type SpeechStreamEvent as v, type AvatarClip as w, type CallConnection as x, type CallQueued as y, type ClipDeclaration as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CallMode, a as CallPolicy } from './types-
|
|
1
|
+
import { C as CallMode, a as CallPolicy } from './types-DVL5VX3N.js';
|
|
2
2
|
|
|
3
3
|
/** The three things a caller can ask the proxy to do. Gate on these, not on URLs. */
|
|
4
4
|
type ProxyOperation = "connect" | "end" | "avatars" | "credits";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "realtime-avatar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Realtime Avatar SDK. `realtime-avatar` and the route adapters hold your API key and are server-only; `realtime-avatar/react`, `/browser` and `/tools` never can — importing a server entry into a browser build throws at bundle time.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "The Influence Company",
|