agora-agents 2.8.1 → 2.10.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/agentkit/Agent.js +3 -3
- package/dist/cjs/agentkit/AgentSession.js +1 -0
- package/dist/cjs/agentkit/index.d.ts +8 -10
- package/dist/cjs/agentkit/index.js +10 -4
- package/dist/cjs/agentkit/preview/client.d.ts +7 -5
- package/dist/cjs/agentkit/preview/client.js +23 -15
- package/dist/cjs/agentkit/preview/index.d.ts +5 -3
- package/dist/cjs/agentkit/preview/index.js +9 -2
- package/dist/cjs/agentkit/preview/vendors.d.ts +9 -74
- package/dist/cjs/agentkit/preview/vendors.js +16 -85
- package/dist/cjs/agentkit/types.d.ts +10 -4
- package/dist/cjs/agentkit/vendors/base.d.ts +15 -4
- package/dist/cjs/agentkit/vendors/base.js +16 -5
- package/dist/cjs/agentkit/vendors/cn.js +2 -2
- package/dist/cjs/agentkit/vendors/llm.js +2 -2
- package/dist/cjs/agentkit/vendors/mllm.d.ts +97 -10
- package/dist/cjs/agentkit/vendors/mllm.js +122 -14
- package/dist/cjs/agentkit/vendors/stt.d.ts +41 -0
- package/dist/cjs/agentkit/vendors/stt.js +18 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +27 -0
- package/dist/cjs/agentkit/vendors/tts.js +16 -1
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +11 -5
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +3 -1
- package/dist/cjs/api/types/AnamAvatarParams.d.ts +42 -0
- package/dist/cjs/api/types/AnamAvatarParams.js +18 -0
- package/dist/cjs/api/types/Asr.d.ts +4 -1
- package/dist/cjs/api/types/LlmTool.d.ts +7 -0
- package/dist/cjs/api/types/McpServer.d.ts +24 -0
- package/dist/cjs/api/types/McpServer.js +3 -0
- package/dist/cjs/api/types/Mllm.d.ts +14 -0
- package/dist/cjs/api/types/SmallestAiAsr.d.ts +11 -0
- package/dist/cjs/api/types/SmallestAiAsr.js +3 -0
- package/dist/cjs/api/types/SmallestAiAsrParams.d.ts +49 -0
- package/dist/cjs/api/types/SmallestAiAsrParams.js +3 -0
- package/dist/cjs/api/types/SmallestAiTts.d.ts +9 -0
- package/dist/cjs/api/types/SmallestAiTts.js +3 -0
- package/dist/cjs/api/types/SmallestAiTtsParams.d.ts +31 -0
- package/dist/cjs/api/types/SmallestAiTtsParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +4 -1
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +10 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/agentkit/Agent.mjs +2 -2
- package/dist/esm/agentkit/AgentSession.mjs +2 -1
- package/dist/esm/agentkit/index.d.mts +8 -10
- package/dist/esm/agentkit/index.mjs +3 -4
- package/dist/esm/agentkit/preview/client.d.mts +7 -5
- package/dist/esm/agentkit/preview/client.mjs +22 -15
- package/dist/esm/agentkit/preview/index.d.mts +5 -3
- package/dist/esm/agentkit/preview/index.mjs +3 -2
- package/dist/esm/agentkit/preview/vendors.d.mts +9 -74
- package/dist/esm/agentkit/preview/vendors.mjs +6 -82
- package/dist/esm/agentkit/types.d.mts +10 -4
- package/dist/esm/agentkit/vendors/base.d.mts +15 -4
- package/dist/esm/agentkit/vendors/base.mjs +16 -5
- package/dist/esm/agentkit/vendors/cn.mjs +2 -2
- package/dist/esm/agentkit/vendors/llm.mjs +2 -2
- package/dist/esm/agentkit/vendors/mllm.d.mts +97 -10
- package/dist/esm/agentkit/vendors/mllm.mjs +119 -13
- package/dist/esm/agentkit/vendors/stt.d.mts +41 -0
- package/dist/esm/agentkit/vendors/stt.mjs +16 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +27 -0
- package/dist/esm/agentkit/vendors/tts.mjs +14 -0
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +11 -5
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +3 -1
- package/dist/esm/api/types/AnamAvatarParams.d.mts +42 -0
- package/dist/esm/api/types/AnamAvatarParams.mjs +15 -0
- package/dist/esm/api/types/Asr.d.mts +4 -1
- package/dist/esm/api/types/LlmTool.d.mts +7 -0
- package/dist/esm/api/types/McpServer.d.mts +24 -0
- package/dist/esm/api/types/McpServer.mjs +2 -0
- package/dist/esm/api/types/Mllm.d.mts +14 -0
- package/dist/esm/api/types/SmallestAiAsr.d.mts +11 -0
- package/dist/esm/api/types/SmallestAiAsr.mjs +2 -0
- package/dist/esm/api/types/SmallestAiAsrParams.d.mts +49 -0
- package/dist/esm/api/types/SmallestAiAsrParams.mjs +2 -0
- package/dist/esm/api/types/SmallestAiTts.d.mts +9 -0
- package/dist/esm/api/types/SmallestAiTts.mjs +2 -0
- package/dist/esm/api/types/SmallestAiTtsParams.d.mts +31 -0
- package/dist/esm/api/types/SmallestAiTtsParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +4 -1
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -6,11 +6,94 @@
|
|
|
6
6
|
* sets `mllm.enable: true`.
|
|
7
7
|
*/
|
|
8
8
|
import type { MllmConfig, MllmTurnDetectionConfig } from "../types.mjs";
|
|
9
|
-
import { BaseCNMLLM, BaseMLLM } from "./base.mjs";
|
|
9
|
+
import { BaseCNMLLM, BaseMLLM, type BaseMllmOptions } from "./base.mjs";
|
|
10
|
+
export declare const GeminiLiveModels: {
|
|
11
|
+
/** Public ID for the low-latency voice model. */
|
|
12
|
+
readonly Live38: "models/gemini-3.8-live";
|
|
13
|
+
/** Public ID for the reasoning voice model. */
|
|
14
|
+
readonly Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking";
|
|
15
|
+
};
|
|
16
|
+
/** The model Gemini Live sends by default. */
|
|
17
|
+
export declare const GEMINI_MLLM_DEFAULT_MODEL: string;
|
|
18
|
+
/** Default Gemini Developer API endpoint for Gemini 3.8 models. */
|
|
19
|
+
export declare const GEMINI_MLLM_URL = "https://generativelanguage.googleapis.com";
|
|
20
|
+
/** @deprecated Use {@link GEMINI_MLLM_URL}. */
|
|
21
|
+
export declare const GEMINI_PREVIEW_MLLM_URL: string;
|
|
22
|
+
/** A Gemini Live model. Known models autocomplete while future model IDs remain accepted. */
|
|
23
|
+
export type GeminiLiveModel = (typeof GeminiLiveModels)[keyof typeof GeminiLiveModels] | (string & {});
|
|
24
|
+
/** Reasoning budgets accepted by Gemini Extended Thinking. */
|
|
25
|
+
export declare const GeminiThinkingLevels: readonly ["low", "medium", "high"];
|
|
26
|
+
export type GeminiThinkingLevel = (typeof GeminiThinkingLevels)[number];
|
|
27
|
+
/** Known Gemini output voices; future voice names remain accepted. */
|
|
28
|
+
export type GeminiLiveVoice = "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede" | "Leda" | "Orus" | "Zephyr" | (string & {});
|
|
29
|
+
/** @deprecated Use {@link GeminiLiveVoice}. */
|
|
30
|
+
export type GeminiPreviewVoice = GeminiLiveVoice;
|
|
31
|
+
export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
|
|
32
|
+
export declare function isOpenAIGPTLiveConfig(config: unknown): boolean;
|
|
33
|
+
/** GPT Live v3 options. */
|
|
34
|
+
export interface OpenAIGPTLiveOptions extends BaseMllmOptions {
|
|
35
|
+
apiKey: string;
|
|
36
|
+
/** Full WebSocket URL, used verbatim except OpenAI's legacy /v1/live route. */
|
|
37
|
+
url?: string;
|
|
38
|
+
/** @deprecated Use prompt. Serialized as prompt; an explicit prompt wins. */
|
|
39
|
+
instructions?: string;
|
|
40
|
+
greeting?: string;
|
|
41
|
+
failureMessage?: string;
|
|
42
|
+
inputModalities?: string[];
|
|
43
|
+
outputModalities?: string[];
|
|
44
|
+
messages?: Record<string, unknown>[];
|
|
45
|
+
/** Additional provider fields; explicit options take precedence. */
|
|
46
|
+
params?: Record<string, unknown>;
|
|
47
|
+
/** @deprecated Unsupported in v3; setting this raises an error. */
|
|
48
|
+
inputAudioTranscription?: Record<string, unknown>;
|
|
49
|
+
/** @deprecated Ignored with a warning; v3 performs endpointing internally. */
|
|
50
|
+
turnDetection?: MllmTurnDetectionConfig;
|
|
51
|
+
/** Defaults to gpt-live-1. */
|
|
52
|
+
model?: string;
|
|
53
|
+
/** Output voice; provider default marin. Custom voice objects require PR #1522; use params after rollout. */
|
|
54
|
+
voice?: string;
|
|
55
|
+
/** Session instructions. */
|
|
56
|
+
prompt?: string;
|
|
57
|
+
/** Host when url is omitted; default wss://api.openai.com. */
|
|
58
|
+
baseUrl?: string;
|
|
59
|
+
/** WebSocket path; default /v1/live/sessions. */
|
|
60
|
+
path?: string;
|
|
61
|
+
/** Optional OpenAI-Alpha selector for preview contracts. Omitted by default. */
|
|
62
|
+
alphaSelector?: string;
|
|
63
|
+
/** Extra provider request headers as a JSON string; protocol headers win. */
|
|
64
|
+
headers?: string;
|
|
65
|
+
/** Assistant silence boundary in ms; provider default 600. Zero disables inference. */
|
|
66
|
+
outputIdleEndMs?: number;
|
|
67
|
+
/** Caller silence boundary in ms; provider default 1500. */
|
|
68
|
+
inputIdleEndMs?: number;
|
|
69
|
+
/** Speech amplitude threshold on the 16-bit scale; provider default 50. */
|
|
70
|
+
outputSilencePeak?: number;
|
|
71
|
+
/** Graph PCM sample rate; provider default 24000. */
|
|
72
|
+
outputSampleRate?: number;
|
|
73
|
+
/** Initial audio cushion; provider default 0. Negative disables pacing. */
|
|
74
|
+
outputBufferMs?: number;
|
|
75
|
+
/** Mic append batching in ms. Join default 0; extension class default 100. */
|
|
76
|
+
inputBatchMs?: number;
|
|
77
|
+
/** Advertise graph tools; provider default false. Does not control delegate built-ins. */
|
|
78
|
+
toolEnabled?: boolean;
|
|
79
|
+
/** Tool delegation mode; provider default responses. Fixed for the session. */
|
|
80
|
+
delegation?: "client" | "responses";
|
|
81
|
+
/** Tool delegate model; provider default gpt-5.6-sol. */
|
|
82
|
+
responsesModel?: string;
|
|
83
|
+
/** Interrupt playback on caller speech; provider default false. */
|
|
84
|
+
interruptOnUserTurn?: boolean;
|
|
85
|
+
/** Unmodelled v3 session fields. Cannot override model, delegation, audio, instructions or input. */
|
|
86
|
+
sessionParams?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
export declare class OpenAIGPTLive extends BaseMLLM {
|
|
89
|
+
private readonly options;
|
|
90
|
+
constructor(options: OpenAIGPTLiveOptions);
|
|
91
|
+
toConfig(): MllmConfig;
|
|
92
|
+
}
|
|
10
93
|
/**
|
|
11
94
|
* Constructor options for OpenAI Realtime API.
|
|
12
95
|
*/
|
|
13
|
-
export interface OpenAIRealtimeOptions {
|
|
96
|
+
export interface OpenAIRealtimeOptions extends BaseMllmOptions {
|
|
14
97
|
/** OpenAI API key */
|
|
15
98
|
apiKey: string;
|
|
16
99
|
/** Model name (e.g., 'gpt-4o-realtime-preview') */
|
|
@@ -66,7 +149,7 @@ export interface AzureOpenAIRealtimeParams {
|
|
|
66
149
|
voice?: string;
|
|
67
150
|
}
|
|
68
151
|
/** Constructor options for Azure OpenAI Realtime API. */
|
|
69
|
-
export interface AzureOpenAIRealtimeOptions {
|
|
152
|
+
export interface AzureOpenAIRealtimeOptions extends BaseMllmOptions {
|
|
70
153
|
/** Azure OpenAI API key */
|
|
71
154
|
apiKey: string;
|
|
72
155
|
/** Azure OpenAI Realtime WebSocket URL, including deployment routing when required */
|
|
@@ -112,17 +195,21 @@ export declare class AzureOpenAIRealtime extends BaseMLLM {
|
|
|
112
195
|
/**
|
|
113
196
|
* Constructor options for Google Gemini Live (direct API, non-Vertex AI).
|
|
114
197
|
*/
|
|
115
|
-
export interface GeminiLiveOptions {
|
|
198
|
+
export interface GeminiLiveOptions extends BaseMllmOptions {
|
|
116
199
|
/** Google API key */
|
|
117
200
|
apiKey: string;
|
|
118
201
|
/** Model name (e.g., 'gemini-live-2.5-flash') */
|
|
119
|
-
model
|
|
120
|
-
/**
|
|
202
|
+
model?: GeminiLiveModel;
|
|
203
|
+
/** Sent only for models/gemini-3.8-live-extended-thinking. */
|
|
204
|
+
thinkingLevel?: GeminiThinkingLevel;
|
|
205
|
+
/** Languages for Gemini 3.8, sent as params.language_codes. */
|
|
206
|
+
languageCodes?: readonly string[];
|
|
207
|
+
/** Endpoint override; Gemini 3.8 defaults to the Developer API host. */
|
|
121
208
|
url?: string;
|
|
122
209
|
/** System instructions for the model */
|
|
123
210
|
instructions?: string;
|
|
124
211
|
/** Voice name (e.g., 'Aoede', 'Charon') */
|
|
125
|
-
voice?:
|
|
212
|
+
voice?: GeminiLiveVoice;
|
|
126
213
|
affectiveDialog?: boolean;
|
|
127
214
|
proactiveAudio?: boolean;
|
|
128
215
|
transcribeAgent?: boolean;
|
|
@@ -167,7 +254,7 @@ export declare class GeminiLive extends BaseMLLM {
|
|
|
167
254
|
/**
|
|
168
255
|
* Constructor options for Google Gemini Live (Vertex AI).
|
|
169
256
|
*/
|
|
170
|
-
export interface VertexAIOptions {
|
|
257
|
+
export interface VertexAIOptions extends BaseMllmOptions {
|
|
171
258
|
/** Model name (e.g., 'gemini-live-2.5-flash-preview-native-audio-09-2025') */
|
|
172
259
|
model: string;
|
|
173
260
|
/** WebSocket URL for real-time communication */
|
|
@@ -228,7 +315,7 @@ export declare class VertexAI extends BaseMLLM {
|
|
|
228
315
|
/**
|
|
229
316
|
* Constructor options for xAI Grok Realtime API.
|
|
230
317
|
*/
|
|
231
|
-
export interface XaiGrokOptions {
|
|
318
|
+
export interface XaiGrokOptions extends BaseMllmOptions {
|
|
232
319
|
/** xAI API key */
|
|
233
320
|
apiKey: string;
|
|
234
321
|
/** WebSocket URL for real-time communication (defaults to xAI Realtime API) */
|
|
@@ -279,7 +366,7 @@ export declare class XaiGrok extends BaseMLLM {
|
|
|
279
366
|
toConfig(): MllmConfig;
|
|
280
367
|
}
|
|
281
368
|
/** Constructor options for Alibaba Cloud Qwen Omni Realtime. */
|
|
282
|
-
export interface QwenOmniOptions {
|
|
369
|
+
export interface QwenOmniOptions extends BaseMllmOptions {
|
|
283
370
|
/** Alibaba Cloud DashScope API key */
|
|
284
371
|
apiKey: string;
|
|
285
372
|
/** Qwen Omni model identifier */
|
|
@@ -16,6 +16,94 @@ function requireObject(value, field, vendor) {
|
|
|
16
16
|
throw new Error(`${vendor} requires ${field}`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
// =============================================================================
|
|
20
|
+
// Google Gemini Live (MLLM)
|
|
21
|
+
// =============================================================================
|
|
22
|
+
export const GeminiLiveModels = {
|
|
23
|
+
/** Public ID for the low-latency voice model. */
|
|
24
|
+
Live38: "models/gemini-3.8-live",
|
|
25
|
+
/** Public ID for the reasoning voice model. */
|
|
26
|
+
Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking",
|
|
27
|
+
};
|
|
28
|
+
/** The model Gemini Live sends by default. */
|
|
29
|
+
export const GEMINI_MLLM_DEFAULT_MODEL = GeminiLiveModels.Live38;
|
|
30
|
+
/** Default Gemini Developer API endpoint for Gemini 3.8 models. */
|
|
31
|
+
export const GEMINI_MLLM_URL = "https://generativelanguage.googleapis.com";
|
|
32
|
+
/** @deprecated Use {@link GEMINI_MLLM_URL}. */
|
|
33
|
+
export const GEMINI_PREVIEW_MLLM_URL = GEMINI_MLLM_URL;
|
|
34
|
+
/** Reasoning budgets accepted by Gemini Extended Thinking. */
|
|
35
|
+
export const GeminiThinkingLevels = ["low", "medium", "high"];
|
|
36
|
+
// =============================================================================
|
|
37
|
+
// OpenAI GPT Live (MLLM)
|
|
38
|
+
// =============================================================================
|
|
39
|
+
export const OPENAI_GPT_LIVE_VENDOR = "openai_gpt_live";
|
|
40
|
+
export function isOpenAIGPTLiveConfig(config) {
|
|
41
|
+
return (config === null || config === void 0 ? void 0 : config.vendor) === OPENAI_GPT_LIVE_VENDOR;
|
|
42
|
+
}
|
|
43
|
+
export class OpenAIGPTLive extends BaseMLLM {
|
|
44
|
+
constructor(options) {
|
|
45
|
+
super(options);
|
|
46
|
+
this.options = options;
|
|
47
|
+
if (!options.apiKey)
|
|
48
|
+
throw new Error("OpenAIGPTLive requires apiKey");
|
|
49
|
+
}
|
|
50
|
+
toConfig() {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
const o = this.options;
|
|
53
|
+
const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: "gpt-live-1" }, o.params), (o.instructions !== undefined && { prompt: o.instructions })), (o.model !== undefined && { model: o.model })), (o.voice !== undefined && { voice: o.voice })), (o.prompt !== undefined && { prompt: o.prompt })), (o.baseUrl !== undefined && { base_url: o.baseUrl })), (o.path !== undefined && { path: o.path })), (o.alphaSelector !== undefined && { alpha_selector: o.alphaSelector })), (o.headers !== undefined && { headers: o.headers })), (o.outputIdleEndMs !== undefined && { output_idle_end_ms: o.outputIdleEndMs })), (o.inputIdleEndMs !== undefined && { input_idle_end_ms: o.inputIdleEndMs })), (o.outputSilencePeak !== undefined && { output_silence_peak: o.outputSilencePeak })), (o.outputSampleRate !== undefined && { output_sample_rate: o.outputSampleRate })), (o.outputBufferMs !== undefined && { output_buffer_ms: o.outputBufferMs })), (o.inputBatchMs !== undefined && { input_batch_ms: o.inputBatchMs })), (o.toolEnabled !== undefined && { tool_enabled: o.toolEnabled })), (o.delegation !== undefined && { delegation: o.delegation })), (o.responsesModel !== undefined && { responses_model: o.responsesModel })), (o.interruptOnUserTurn !== undefined && { interrupt_on_user_turn: o.interruptOnUserTurn })), (o.sessionParams !== undefined && { session_params: o.sessionParams }));
|
|
54
|
+
if (o.inputAudioTranscription !== undefined || "input_audio_transcription" in params) {
|
|
55
|
+
throw new Error("GPT Live v3 does not support input_audio_transcription");
|
|
56
|
+
}
|
|
57
|
+
if (o.turnDetection !== undefined || "turn_detection" in params) {
|
|
58
|
+
console.warn("GPT Live v3 ignores turn_detection; endpointing is internal");
|
|
59
|
+
delete params.turn_detection;
|
|
60
|
+
}
|
|
61
|
+
if (params.delegation !== undefined && params.delegation !== "client" && params.delegation !== "responses") {
|
|
62
|
+
throw new Error("GPT Live delegation must be client or responses");
|
|
63
|
+
}
|
|
64
|
+
if (params.headers !== undefined) {
|
|
65
|
+
let headers;
|
|
66
|
+
try {
|
|
67
|
+
headers = JSON.parse(String(params.headers));
|
|
68
|
+
}
|
|
69
|
+
catch (_c) {
|
|
70
|
+
throw new Error("GPT Live headers must be a JSON object string");
|
|
71
|
+
}
|
|
72
|
+
if (headers === null || typeof headers !== "object" || Array.isArray(headers)) {
|
|
73
|
+
throw new Error("GPT Live headers must be a JSON object string");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const session = params.session_params === undefined ? {} : params.session_params;
|
|
77
|
+
if (session === null || typeof session !== "object" || Array.isArray(session)) {
|
|
78
|
+
throw new Error("GPT Live session_params must be an object");
|
|
79
|
+
}
|
|
80
|
+
for (const key of ["model", "delegation", "audio", "instructions", "input"]) {
|
|
81
|
+
if (key in session)
|
|
82
|
+
throw new Error(`GPT Live session_params cannot override ${key}`);
|
|
83
|
+
}
|
|
84
|
+
let url = o.url ||
|
|
85
|
+
`${String((_a = params.base_url) !== null && _a !== void 0 ? _a : "wss://api.openai.com").replace(/\/+$/, "")}/${String((_b = params.path) !== null && _b !== void 0 ? _b : "/v1/live/sessions").replace(/^\/+/, "")}`;
|
|
86
|
+
if (!/^wss?:\/\/[^/]/i.test(url)) {
|
|
87
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
88
|
+
}
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = new URL(url);
|
|
92
|
+
}
|
|
93
|
+
catch (_d) {
|
|
94
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
95
|
+
}
|
|
96
|
+
if ((parsed.protocol !== "ws:" && parsed.protocol !== "wss:") || !parsed.hostname) {
|
|
97
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
98
|
+
}
|
|
99
|
+
if (parsed.hostname === "api.openai.com" && parsed.pathname === "/v1/live") {
|
|
100
|
+
parsed.pathname = "/v1/live/sessions";
|
|
101
|
+
url = parsed.toString();
|
|
102
|
+
}
|
|
103
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: OPENAI_GPT_LIVE_VENDOR, api_key: o.apiKey, url,
|
|
104
|
+
params }, (o.greeting !== undefined && { greeting_message: o.greeting })), (o.failureMessage !== undefined && { failure_message: o.failureMessage })), (o.inputModalities !== undefined && { input_modalities: o.inputModalities })), (o.outputModalities !== undefined && { output_modalities: o.outputModalities })), (o.messages !== undefined && { messages: o.messages })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
19
107
|
/**
|
|
20
108
|
* OpenAI Realtime API MLLM vendor.
|
|
21
109
|
*
|
|
@@ -31,7 +119,7 @@ function requireObject(value, field, vendor) {
|
|
|
31
119
|
*/
|
|
32
120
|
export class OpenAIRealtime extends BaseMLLM {
|
|
33
121
|
constructor(options) {
|
|
34
|
-
super();
|
|
122
|
+
super(options);
|
|
35
123
|
this.options = options;
|
|
36
124
|
}
|
|
37
125
|
toConfig() {
|
|
@@ -46,7 +134,7 @@ export class OpenAIRealtime extends BaseMLLM {
|
|
|
46
134
|
voice !== undefined ||
|
|
47
135
|
instructions !== undefined ||
|
|
48
136
|
inputAudioTranscription !== undefined;
|
|
49
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "openai", api_key: apiKey, url: url || "wss://api.openai.com/v1/realtime" }, (hasParams && { params: mergedParams })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
|
|
137
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "openai", api_key: apiKey, url: url || "wss://api.openai.com/v1/realtime" }, (hasParams && { params: mergedParams })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
50
138
|
}
|
|
51
139
|
}
|
|
52
140
|
/**
|
|
@@ -65,7 +153,7 @@ export class OpenAIRealtime extends BaseMLLM {
|
|
|
65
153
|
*/
|
|
66
154
|
export class AzureOpenAIRealtime extends BaseMLLM {
|
|
67
155
|
constructor(options) {
|
|
68
|
-
super();
|
|
156
|
+
super(options);
|
|
69
157
|
requireString(options.apiKey, "apiKey", "AzureOpenAIRealtime");
|
|
70
158
|
requireString(options.url, "url", "AzureOpenAIRealtime");
|
|
71
159
|
requireObject(options.turnDetection, "turnDetection", "AzureOpenAIRealtime");
|
|
@@ -75,7 +163,7 @@ export class AzureOpenAIRealtime extends BaseMLLM {
|
|
|
75
163
|
const { apiKey, url, model, voice, instructions, maxHistory, greetingMessage, outputModalities, messages, params, turnDetection, } = this.options;
|
|
76
164
|
const mergedParams = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, ((params === null || params === void 0 ? void 0 : params.model) !== undefined && { model: params.model })), ((params === null || params === void 0 ? void 0 : params.voice) !== undefined && { voice: params.voice })), ((params === null || params === void 0 ? void 0 : params.instructions) !== undefined && { instructions: params.instructions })), (model !== undefined && { model })), (voice !== undefined && { voice })), (instructions !== undefined && { instructions }));
|
|
77
165
|
const hasParams = Object.keys(mergedParams).length > 0;
|
|
78
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "azure", api_key: apiKey, url }, (hasParams && { params: mergedParams })), (maxHistory !== undefined && { max_history: maxHistory })), (greetingMessage && { greeting_message: greetingMessage })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), { turn_detection: turnDetection });
|
|
166
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "azure", api_key: apiKey, url }, (hasParams && { params: mergedParams })), (maxHistory !== undefined && { max_history: maxHistory })), (greetingMessage && { greeting_message: greetingMessage })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), { turn_detection: turnDetection }), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
79
167
|
}
|
|
80
168
|
}
|
|
81
169
|
/**
|
|
@@ -96,12 +184,30 @@ export class AzureOpenAIRealtime extends BaseMLLM {
|
|
|
96
184
|
*/
|
|
97
185
|
export class GeminiLive extends BaseMLLM {
|
|
98
186
|
constructor(options) {
|
|
99
|
-
super();
|
|
100
|
-
|
|
187
|
+
super(options);
|
|
188
|
+
if (!options.apiKey.trim()) {
|
|
189
|
+
throw new Error("GeminiLive requires apiKey");
|
|
190
|
+
}
|
|
191
|
+
if (options.thinkingLevel !== undefined && !GeminiThinkingLevels.includes(options.thinkingLevel)) {
|
|
192
|
+
throw new Error("GeminiLive thinkingLevel must be low, medium, or high");
|
|
193
|
+
}
|
|
194
|
+
this.options = Object.assign(Object.assign({}, options), { apiKey: options.apiKey.trim() });
|
|
101
195
|
}
|
|
102
196
|
toConfig() {
|
|
103
197
|
const { apiKey, model, url, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
104
|
-
|
|
198
|
+
const selectedModel = (model === null || model === void 0 ? void 0 : model.trim()) || GEMINI_MLLM_DEFAULT_MODEL;
|
|
199
|
+
const isGemini38 = selectedModel === GeminiLiveModels.Live38 || selectedModel === GeminiLiveModels.Live38ExtendedThinking;
|
|
200
|
+
const isExtendedThinking = selectedModel === GeminiLiveModels.Live38ExtendedThinking;
|
|
201
|
+
const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model: selectedModel }), (instructions && { instructions })), ((voice || isGemini38) && { voice: voice || "Puck" })), (isExtendedThinking &&
|
|
202
|
+
this.options.thinkingLevel !== undefined && {
|
|
203
|
+
thinking_level: this.options.thinkingLevel,
|
|
204
|
+
})), (isGemini38 && this.options.languageCodes && { language_codes: [...this.options.languageCodes] })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions }));
|
|
205
|
+
if (isGemini38) {
|
|
206
|
+
delete params.api_key;
|
|
207
|
+
if (!isExtendedThinking)
|
|
208
|
+
delete params.thinking_level;
|
|
209
|
+
}
|
|
210
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "gemini", api_key: apiKey, url: url !== null && url !== void 0 ? url : (isGemini38 ? GEMINI_MLLM_URL : ""), params }, (messages && { messages })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
105
211
|
}
|
|
106
212
|
}
|
|
107
213
|
/**
|
|
@@ -124,12 +230,12 @@ export class GeminiLive extends BaseMLLM {
|
|
|
124
230
|
*/
|
|
125
231
|
export class VertexAI extends BaseMLLM {
|
|
126
232
|
constructor(options) {
|
|
127
|
-
super();
|
|
233
|
+
super(options);
|
|
128
234
|
this.options = options;
|
|
129
235
|
}
|
|
130
236
|
toConfig() {
|
|
131
237
|
const { model, url, projectId, location, adcCredentialsString, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
132
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "vertexai", url: url !== null && url !== void 0 ? url : "", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model, project_id: projectId, location, adc_credentials_string: adcCredentialsString }), (instructions && { instructions })), (voice && { voice })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions })) }, (messages && { messages })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
|
|
238
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "vertexai", url: url !== null && url !== void 0 ? url : "", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model, project_id: projectId, location, adc_credentials_string: adcCredentialsString }), (instructions && { instructions })), (voice && { voice })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions })) }, (messages && { messages })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
133
239
|
}
|
|
134
240
|
}
|
|
135
241
|
/**
|
|
@@ -153,7 +259,7 @@ export class VertexAI extends BaseMLLM {
|
|
|
153
259
|
*/
|
|
154
260
|
export class XaiGrok extends BaseMLLM {
|
|
155
261
|
constructor(options) {
|
|
156
|
-
super();
|
|
262
|
+
super(options);
|
|
157
263
|
this.options = options;
|
|
158
264
|
if (!options.apiKey) {
|
|
159
265
|
throw new Error("XaiGrok requires apiKey");
|
|
@@ -161,7 +267,7 @@ export class XaiGrok extends BaseMLLM {
|
|
|
161
267
|
}
|
|
162
268
|
toConfig() {
|
|
163
269
|
const { apiKey, url = "wss://api.x.ai/v1/realtime", voice, language, sampleRate, greetingMessage, failureMessage, inputModalities, outputModalities, messages, params, turnDetection, } = this.options;
|
|
164
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "xai", api_key: apiKey, url }, (messages && { messages })), { params: Object.assign(Object.assign(Object.assign(Object.assign({}, params), (voice && { voice })), (language && { language })), (sampleRate !== undefined && { sample_rate: sampleRate })) }), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (greetingMessage && { greeting_message: greetingMessage })), (failureMessage && { failure_message: failureMessage })), (turnDetection && { turn_detection: turnDetection }));
|
|
270
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "xai", api_key: apiKey, url }, (messages && { messages })), { params: Object.assign(Object.assign(Object.assign(Object.assign({}, params), (voice && { voice })), (language && { language })), (sampleRate !== undefined && { sample_rate: sampleRate })) }), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (greetingMessage && { greeting_message: greetingMessage })), (failureMessage && { failure_message: failureMessage })), (turnDetection && { turn_detection: turnDetection })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
165
271
|
}
|
|
166
272
|
}
|
|
167
273
|
/**
|
|
@@ -179,7 +285,7 @@ export class XaiGrok extends BaseMLLM {
|
|
|
179
285
|
*/
|
|
180
286
|
export class QwenOmni extends BaseCNMLLM {
|
|
181
287
|
constructor(options) {
|
|
182
|
-
super();
|
|
288
|
+
super(options);
|
|
183
289
|
requireString(options.apiKey, "apiKey", "QwenOmni");
|
|
184
290
|
requireString(options.model, "model", "QwenOmni");
|
|
185
291
|
requireString(options.url, "url", "QwenOmni");
|
|
@@ -187,6 +293,6 @@ export class QwenOmni extends BaseCNMLLM {
|
|
|
187
293
|
}
|
|
188
294
|
toConfig() {
|
|
189
295
|
const { apiKey, model, url, voice, instructions, greetingMessage, failureMessage, inputModalities, outputModalities, messages, params, turnDetection, } = this.options;
|
|
190
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "qwen_omni", api_key: apiKey, url, params: Object.assign(Object.assign(Object.assign(Object.assign({}, params), { model }), (voice !== undefined && { voice })), (instructions !== undefined && { instructions })) }, (greetingMessage && { greeting_message: greetingMessage })), (failureMessage && { failure_message: failureMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (turnDetection && { turn_detection: turnDetection }));
|
|
296
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "qwen_omni", api_key: apiKey, url, params: Object.assign(Object.assign(Object.assign(Object.assign({}, params), { model }), (voice !== undefined && { voice })), (instructions !== undefined && { instructions })) }, (greetingMessage && { greeting_message: greetingMessage })), (failureMessage && { failure_message: failureMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (turnDetection && { turn_detection: turnDetection })), (this.mcpServers !== undefined && { mcp_servers: this.mcpServers })), (this.tools !== undefined && { tools: this.tools }));
|
|
191
297
|
}
|
|
192
298
|
}
|
|
@@ -369,4 +369,45 @@ export declare class XAiSTT extends BaseSTT {
|
|
|
369
369
|
constructor(options: XAiSTTOptions);
|
|
370
370
|
toConfig(): SttConfig;
|
|
371
371
|
}
|
|
372
|
+
/** Constructor options for Smallest AI STT. */
|
|
373
|
+
export interface SmallestAISTTOptions {
|
|
374
|
+
/** Smallest AI API key. */
|
|
375
|
+
apiKey: string;
|
|
376
|
+
/** Language code for speech recognition. */
|
|
377
|
+
language?: string;
|
|
378
|
+
/** WebSocket endpoint for the Smallest AI streaming STT API. */
|
|
379
|
+
url?: string;
|
|
380
|
+
/** Input audio sample rate in Hz. */
|
|
381
|
+
sampleRate?: number;
|
|
382
|
+
/** Input audio encoding. */
|
|
383
|
+
encoding?: string;
|
|
384
|
+
/** Boolean options are serialized as `"true"` or `"false"` for the Smallest AI wire protocol. */
|
|
385
|
+
wordTimestamps?: boolean;
|
|
386
|
+
sentenceTimestamps?: boolean;
|
|
387
|
+
diarize?: boolean;
|
|
388
|
+
vadEvents?: boolean;
|
|
389
|
+
endpointing?: boolean;
|
|
390
|
+
/** End-of-utterance timeout in milliseconds. */
|
|
391
|
+
eouTimeoutMs?: number;
|
|
392
|
+
format?: boolean;
|
|
393
|
+
finalizeOnWords?: boolean;
|
|
394
|
+
/** Maximum number of words per result. */
|
|
395
|
+
maxWords?: string;
|
|
396
|
+
punctuate?: boolean;
|
|
397
|
+
capitalize?: boolean;
|
|
398
|
+
itnNormalize?: boolean;
|
|
399
|
+
fullTranscript?: boolean;
|
|
400
|
+
/** Comma-separated keyword boosts in `keyword:weight` format. */
|
|
401
|
+
keywords?: string;
|
|
402
|
+
redactPii?: boolean;
|
|
403
|
+
redactPci?: boolean;
|
|
404
|
+
/** Additional Smallest AI parameters. Explicit options take precedence. */
|
|
405
|
+
additionalParams?: Partial<import("../types.mjs").SmallestAiAsrParams>;
|
|
406
|
+
}
|
|
407
|
+
/** Smallest AI streaming STT vendor. */
|
|
408
|
+
export declare class SmallestAISTT extends BaseSTT {
|
|
409
|
+
private readonly options;
|
|
410
|
+
constructor(options: SmallestAISTTOptions);
|
|
411
|
+
toConfig(): SttConfig;
|
|
412
|
+
}
|
|
372
413
|
export {};
|
|
@@ -315,3 +315,19 @@ export class XAiSTT extends BaseSTT {
|
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
+
/** Smallest AI streaming STT vendor. */
|
|
319
|
+
export class SmallestAISTT extends BaseSTT {
|
|
320
|
+
constructor(options) {
|
|
321
|
+
super();
|
|
322
|
+
this.options = options;
|
|
323
|
+
if (!options.apiKey)
|
|
324
|
+
throw new Error("SmallestAISTT requires apiKey");
|
|
325
|
+
}
|
|
326
|
+
toConfig() {
|
|
327
|
+
const o = this.options;
|
|
328
|
+
return {
|
|
329
|
+
vendor: "smallestai",
|
|
330
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, o.additionalParams), { api_key: o.apiKey }), (o.language !== undefined && { language: o.language })), (o.url !== undefined && { url: o.url })), (o.sampleRate !== undefined && { sample_rate: o.sampleRate })), (o.encoding !== undefined && { encoding: o.encoding })), (o.wordTimestamps !== undefined && { word_timestamps: String(o.wordTimestamps) })), (o.sentenceTimestamps !== undefined && { sentence_timestamps: String(o.sentenceTimestamps) })), (o.diarize !== undefined && { diarize: String(o.diarize) })), (o.vadEvents !== undefined && { vad_events: String(o.vadEvents) })), (o.endpointing !== undefined && { endpointing: String(o.endpointing) })), (o.eouTimeoutMs !== undefined && { eou_timeout_ms: o.eouTimeoutMs })), (o.format !== undefined && { format: String(o.format) })), (o.finalizeOnWords !== undefined && { finalize_on_words: String(o.finalizeOnWords) })), (o.maxWords !== undefined && { max_words: o.maxWords })), (o.punctuate !== undefined && { punctuate: String(o.punctuate) })), (o.capitalize !== undefined && { capitalize: String(o.capitalize) })), (o.itnNormalize !== undefined && { itn_normalize: String(o.itnNormalize) })), (o.fullTranscript !== undefined && { full_transcript: String(o.fullTranscript) })), (o.keywords !== undefined && { keywords: o.keywords })), (o.redactPii !== undefined && { redact_pii: String(o.redactPii) })), (o.redactPci !== undefined && { redact_pci: String(o.redactPci) })),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
}
|
|
@@ -652,4 +652,31 @@ export declare class XAiTTS extends BaseTTS {
|
|
|
652
652
|
constructor(options: XAiTTSOptions);
|
|
653
653
|
toConfig(): TtsConfig;
|
|
654
654
|
}
|
|
655
|
+
/** Constructor options for Smallest AI TTS. */
|
|
656
|
+
export interface SmallestAITTSOptions {
|
|
657
|
+
/** Smallest AI API key. */
|
|
658
|
+
apiKey: string;
|
|
659
|
+
/** HTTP endpoint for the Smallest AI streaming TTS API. */
|
|
660
|
+
url?: string;
|
|
661
|
+
model?: string;
|
|
662
|
+
voiceId?: string;
|
|
663
|
+
sampleRate?: number;
|
|
664
|
+
speed?: number;
|
|
665
|
+
language?: string;
|
|
666
|
+
numberPronunciationLanguage?: string;
|
|
667
|
+
mathNotation?: boolean;
|
|
668
|
+
pronunciationDicts?: string[];
|
|
669
|
+
sessionId?: string;
|
|
670
|
+
requestId?: string;
|
|
671
|
+
/** Additional Smallest AI parameters. Explicit options take precedence. */
|
|
672
|
+
additionalParams?: Partial<import("../types.mjs").SmallestAiTtsParams>;
|
|
673
|
+
/** Skip patterns for bracketed content. */
|
|
674
|
+
skipPatterns?: number[];
|
|
675
|
+
}
|
|
676
|
+
/** Smallest AI streaming TTS vendor. */
|
|
677
|
+
export declare class SmallestAITTS extends BaseTTS {
|
|
678
|
+
private readonly options;
|
|
679
|
+
constructor(options: SmallestAITTSOptions);
|
|
680
|
+
toConfig(): TtsConfig;
|
|
681
|
+
}
|
|
655
682
|
export {};
|
|
@@ -437,3 +437,17 @@ export class XAiTTS extends BaseTTS {
|
|
|
437
437
|
return Object.assign({ vendor: "xai", params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (voiceId !== undefined && { voice_id: voiceId })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
+
/** Smallest AI streaming TTS vendor. */
|
|
441
|
+
export class SmallestAITTS extends BaseTTS {
|
|
442
|
+
constructor(options) {
|
|
443
|
+
super();
|
|
444
|
+
this.options = options;
|
|
445
|
+
requireString(options.apiKey, "apiKey", "SmallestAITTS");
|
|
446
|
+
}
|
|
447
|
+
toConfig() {
|
|
448
|
+
const o = this.options;
|
|
449
|
+
return Object.assign({ vendor: "smallestai", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, o.additionalParams), { api_key: o.apiKey }), (o.url !== undefined && { url: o.url })), (o.model !== undefined && { model: o.model })), (o.voiceId !== undefined && { voice_id: o.voiceId })), (o.sampleRate !== undefined && { sample_rate: o.sampleRate })), (o.speed !== undefined && { speed: o.speed })), (o.language !== undefined && { language: o.language })), (o.numberPronunciationLanguage !== undefined && {
|
|
450
|
+
number_pronunciation_language: o.numberPronunciationLanguage,
|
|
451
|
+
})), (o.mathNotation !== undefined && { math_notation: o.mathNotation })), (o.pronunciationDicts !== undefined && { pronunciation_dicts: o.pronunciationDicts })), (o.sessionId !== undefined && { session_id: o.sessionId })), (o.requestId !== undefined && { request_id: o.requestId })) }, (o.skipPatterns !== undefined && { skip_patterns: o.skipPatterns }));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
@@ -194,6 +194,8 @@ export declare namespace StartAgentsRequest {
|
|
|
194
194
|
/**
|
|
195
195
|
* LiveAvatar (Beta) — formerly HeyGen */
|
|
196
196
|
readonly Liveavatar: "liveavatar";
|
|
197
|
+
/**
|
|
198
|
+
* Anam Avatar (Beta) */
|
|
197
199
|
readonly Anam: "anam";
|
|
198
200
|
/**
|
|
199
201
|
* Generic avatar (Beta) */
|
|
@@ -608,7 +610,7 @@ export declare namespace StartAgentsRequest {
|
|
|
608
610
|
/**
|
|
609
611
|
* Filler word content mode:
|
|
610
612
|
* - `static`: Static filler words. Uses a predefined list of filler words.
|
|
611
|
-
* - `generated`: LLM-generated filler words based on
|
|
613
|
+
* - `generated`: LLM-generated filler words based on recent conversation context.
|
|
612
614
|
*/
|
|
613
615
|
mode?: Content.Mode;
|
|
614
616
|
/** Static filler word configuration. Required when `mode` is `static`. */
|
|
@@ -620,7 +622,7 @@ export declare namespace StartAgentsRequest {
|
|
|
620
622
|
/**
|
|
621
623
|
* Filler word content mode:
|
|
622
624
|
* - `static`: Static filler words. Uses a predefined list of filler words.
|
|
623
|
-
* - `generated`: LLM-generated filler words based on
|
|
625
|
+
* - `generated`: LLM-generated filler words based on recent conversation context.
|
|
624
626
|
*/
|
|
625
627
|
const Mode: {
|
|
626
628
|
readonly Static: "static";
|
|
@@ -656,16 +658,20 @@ export declare namespace StartAgentsRequest {
|
|
|
656
658
|
* Optional configuration for generated filler words. When omitted, the service uses its default generator settings.
|
|
657
659
|
*/
|
|
658
660
|
interface GeneratedConfig {
|
|
659
|
-
/** OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM
|
|
661
|
+
/** OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM. */
|
|
660
662
|
llm_provider?: GeneratedConfig.LlmProvider;
|
|
661
|
-
/** System prompt used to generate a short filler phrase based on
|
|
663
|
+
/** System prompt used to generate a short filler phrase based on recent conversation context. The generated text should be conversational and must not answer the user's question. */
|
|
662
664
|
prompt?: string;
|
|
663
665
|
/** Fallback strategy when generated filler text is not ready, fails, or returns empty text. Phase 1 only supports `static`. */
|
|
664
666
|
fallback_strategy?: "static";
|
|
667
|
+
/** Maximum number of recent conversation messages used to generate a filler word. */
|
|
668
|
+
context_message_limit?: number;
|
|
669
|
+
/** Maximum number of characters from conversation history used to generate a filler word. */
|
|
670
|
+
history_character_limit?: number;
|
|
665
671
|
}
|
|
666
672
|
namespace GeneratedConfig {
|
|
667
673
|
/**
|
|
668
|
-
* OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM
|
|
674
|
+
* OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM.
|
|
669
675
|
*/
|
|
670
676
|
interface LlmProvider {
|
|
671
677
|
/** URL of the OpenAI-compatible chat completions endpoint. If the URL does not end with `/chat/completions`, the engine appends it automatically. */
|
|
@@ -39,6 +39,8 @@ export var StartAgentsRequest;
|
|
|
39
39
|
/**
|
|
40
40
|
* LiveAvatar (Beta) — formerly HeyGen */
|
|
41
41
|
Liveavatar: "liveavatar",
|
|
42
|
+
/**
|
|
43
|
+
* Anam Avatar (Beta) */
|
|
42
44
|
Anam: "anam",
|
|
43
45
|
/**
|
|
44
46
|
* Generic avatar (Beta) */
|
|
@@ -187,7 +189,7 @@ export var StartAgentsRequest;
|
|
|
187
189
|
/**
|
|
188
190
|
* Filler word content mode:
|
|
189
191
|
* - `static`: Static filler words. Uses a predefined list of filler words.
|
|
190
|
-
* - `generated`: LLM-generated filler words based on
|
|
192
|
+
* - `generated`: LLM-generated filler words based on recent conversation context.
|
|
191
193
|
*/
|
|
192
194
|
Content.Mode = {
|
|
193
195
|
Static: "static",
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Anam Avatar configuration parameters.
|
|
3
|
+
*/
|
|
4
|
+
export interface AnamAvatarParams {
|
|
5
|
+
/** Anam API key. */
|
|
6
|
+
api_key: string;
|
|
7
|
+
/** The unique identifier for the Anam avatar you want to use. */
|
|
8
|
+
avatar_id: string;
|
|
9
|
+
/** The unique identifier for the avatar's RTC connection. This must be different from other participants in the channel. */
|
|
10
|
+
agora_uid: string;
|
|
11
|
+
/** The RTC token that authorizes the avatar to join the video channel. */
|
|
12
|
+
agora_token: string;
|
|
13
|
+
/** The audio sample rate in Hz. */
|
|
14
|
+
sample_rate?: number;
|
|
15
|
+
/** The video quality level. */
|
|
16
|
+
quality?: AnamAvatarParams.Quality;
|
|
17
|
+
/** The video encoding format. */
|
|
18
|
+
video_encoding?: AnamAvatarParams.VideoEncoding;
|
|
19
|
+
/** Anam avatar model, such as `cara_mk4` for Cara 4 portrait mode. */
|
|
20
|
+
avatar_model?: string;
|
|
21
|
+
/** Anam output video width in pixels. Set together with `video_height`; omit both to use the model default resolution. */
|
|
22
|
+
video_width?: number;
|
|
23
|
+
/** Anam output video height in pixels. Set together with `video_width`; omit both to use the model default resolution. */
|
|
24
|
+
video_height?: number;
|
|
25
|
+
/** Accepts any additional properties */
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace AnamAvatarParams {
|
|
29
|
+
/** The video quality level. */
|
|
30
|
+
const Quality: {
|
|
31
|
+
readonly High: "high";
|
|
32
|
+
readonly Medium: "medium";
|
|
33
|
+
readonly Low: "low";
|
|
34
|
+
};
|
|
35
|
+
type Quality = (typeof Quality)[keyof typeof Quality];
|
|
36
|
+
/** The video encoding format. */
|
|
37
|
+
const VideoEncoding: {
|
|
38
|
+
readonly H264: "H264";
|
|
39
|
+
readonly Av1: "AV1";
|
|
40
|
+
};
|
|
41
|
+
type VideoEncoding = (typeof VideoEncoding)[keyof typeof VideoEncoding];
|
|
42
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var AnamAvatarParams;
|
|
3
|
+
(function (AnamAvatarParams) {
|
|
4
|
+
/** The video quality level. */
|
|
5
|
+
AnamAvatarParams.Quality = {
|
|
6
|
+
High: "high",
|
|
7
|
+
Medium: "medium",
|
|
8
|
+
Low: "low",
|
|
9
|
+
};
|
|
10
|
+
/** The video encoding format. */
|
|
11
|
+
AnamAvatarParams.VideoEncoding = {
|
|
12
|
+
H264: "H264",
|
|
13
|
+
Av1: "AV1",
|
|
14
|
+
};
|
|
15
|
+
})(AnamAvatarParams || (AnamAvatarParams = {}));
|