agora-agents 2.14.0 → 2.16.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.d.ts +6 -4
- package/dist/cjs/agentkit/Agent.js +89 -29
- package/dist/cjs/agentkit/AgentSession.js +1 -5
- package/dist/cjs/agentkit/index.d.ts +9 -9
- package/dist/cjs/agentkit/index.js +8 -4
- package/dist/cjs/agentkit/preview/client.d.ts +10 -3
- package/dist/cjs/agentkit/preview/client.js +22 -13
- package/dist/cjs/agentkit/preview/index.d.ts +2 -2
- package/dist/cjs/agentkit/preview/index.js +3 -1
- package/dist/cjs/agentkit/preview/vendors.d.ts +2 -2
- package/dist/cjs/agentkit/preview/vendors.js +3 -1
- package/dist/cjs/agentkit/types.d.ts +51 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +12 -0
- package/dist/cjs/agentkit/vendors/cn.js +16 -1
- package/dist/cjs/agentkit/vendors/mllm.d.ts +56 -4
- package/dist/cjs/agentkit/vendors/mllm.js +62 -7
- package/dist/cjs/agentkit/vendors/stt.d.ts +24 -0
- package/dist/cjs/agentkit/vendors/stt.js +31 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +0 -38
- package/dist/cjs/agentkit/vendors/tts.js +1 -24
- package/dist/cjs/api/types/Asr.d.ts +10 -1
- package/dist/cjs/api/types/ElevenLabsAsr.d.ts +10 -0
- package/dist/cjs/api/types/ElevenLabsAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/ElevenLabsAsrParams.js +3 -0
- package/dist/cjs/api/types/FishAudioAsr.d.ts +10 -0
- package/dist/cjs/api/types/FishAudioAsr.js +3 -0
- package/dist/cjs/api/types/FishAudioAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/FishAudioAsrParams.js +3 -0
- package/dist/cjs/api/types/QwenAsr.d.ts +10 -0
- package/dist/cjs/api/types/QwenAsr.js +3 -0
- package/dist/cjs/api/types/QwenAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/QwenAsrParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +1 -4
- package/dist/cjs/api/types/index.d.ts +6 -2
- package/dist/cjs/api/types/index.js +6 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +9 -5
- 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.d.mts +6 -4
- package/dist/esm/agentkit/Agent.mjs +89 -29
- package/dist/esm/agentkit/AgentSession.mjs +1 -5
- package/dist/esm/agentkit/index.d.mts +9 -9
- package/dist/esm/agentkit/index.mjs +4 -4
- package/dist/esm/agentkit/preview/client.d.mts +10 -3
- package/dist/esm/agentkit/preview/client.mjs +22 -13
- package/dist/esm/agentkit/preview/index.d.mts +2 -2
- package/dist/esm/agentkit/preview/index.mjs +1 -1
- package/dist/esm/agentkit/preview/vendors.d.mts +2 -2
- package/dist/esm/agentkit/preview/vendors.mjs +1 -1
- package/dist/esm/agentkit/types.d.mts +51 -6
- package/dist/esm/agentkit/vendors/cn.d.mts +12 -0
- package/dist/esm/agentkit/vendors/cn.mjs +14 -0
- package/dist/esm/agentkit/vendors/mllm.d.mts +56 -4
- package/dist/esm/agentkit/vendors/mllm.mjs +60 -6
- package/dist/esm/agentkit/vendors/stt.d.mts +24 -0
- package/dist/esm/agentkit/vendors/stt.mjs +28 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +0 -38
- package/dist/esm/agentkit/vendors/tts.mjs +0 -22
- package/dist/esm/api/types/Asr.d.mts +10 -1
- package/dist/esm/api/types/ElevenLabsAsr.d.mts +10 -0
- package/dist/esm/api/types/ElevenLabsAsrParams.d.mts +9 -0
- package/dist/esm/api/types/ElevenLabsAsrParams.mjs +2 -0
- package/dist/esm/api/types/FishAudioAsr.d.mts +10 -0
- package/dist/esm/api/types/FishAudioAsr.mjs +2 -0
- package/dist/esm/api/types/FishAudioAsrParams.d.mts +9 -0
- package/dist/esm/api/types/FishAudioAsrParams.mjs +2 -0
- package/dist/esm/api/types/QwenAsr.d.mts +10 -0
- package/dist/esm/api/types/QwenAsr.mjs +2 -0
- package/dist/esm/api/types/QwenAsrParams.d.mts +9 -0
- package/dist/esm/api/types/QwenAsrParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +1 -4
- package/dist/esm/api/types/index.d.mts +6 -2
- package/dist/esm/api/types/index.mjs +6 -2
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/types/HumeAiTts.d.ts +0 -9
- package/dist/cjs/api/types/HumeAiTtsParams.d.ts +0 -29
- package/dist/cjs/api/types/HumeAiTtsParams.js +0 -12
- package/dist/esm/api/types/HumeAiTts.d.mts +0 -9
- package/dist/esm/api/types/HumeAiTtsParams.d.mts +0 -29
- package/dist/esm/api/types/HumeAiTtsParams.mjs +0 -9
- /package/dist/cjs/api/types/{HumeAiTts.js → ElevenLabsAsr.js} +0 -0
- /package/dist/esm/api/types/{HumeAiTts.mjs → ElevenLabsAsr.mjs} +0 -0
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { MinimaxDuplexTtsParams } from "../../api/index.js";
|
|
2
2
|
import type { AvatarConfig, LlmConfig, SttConfig, TtsConfig } from "../types.js";
|
|
3
3
|
import { BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, type BaseLlmOptions } from "./base.js";
|
|
4
|
+
/** Constructor options for mainland China Qwen ASR. */
|
|
5
|
+
export interface QwenSTTOptions {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
8
|
+
additionalParams?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Qwen ASR for mainland China. */
|
|
11
|
+
export declare class QwenSTT extends BaseCNSTT {
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(options: QwenSTTOptions);
|
|
14
|
+
toConfig(): SttConfig;
|
|
15
|
+
}
|
|
4
16
|
export interface FengmingSTTOptions {
|
|
5
17
|
/** Hotwords that improve recognition accuracy */
|
|
6
18
|
keywords?: string[];
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpatiusAvatar = exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.MiniMaxDuplexTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.StepFunSTT = exports.FengmingSTT = void 0;
|
|
3
|
+
exports.SpatiusAvatar = exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.MiniMaxDuplexTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.StepFunSTT = exports.FengmingSTT = exports.QwenSTT = void 0;
|
|
4
4
|
const base_js_1 = require("./base.js");
|
|
5
5
|
function requireString(value, field, vendor) {
|
|
6
6
|
if (typeof value !== "string" || value.length === 0) {
|
|
7
7
|
throw new Error(`${vendor} requires ${field}`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
+
/** Qwen ASR for mainland China. */
|
|
11
|
+
class QwenSTT extends base_js_1.BaseCNSTT {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super();
|
|
14
|
+
this.options = options;
|
|
15
|
+
requireString(options.apiKey, "apiKey", "QwenSTT");
|
|
16
|
+
}
|
|
17
|
+
toConfig() {
|
|
18
|
+
return {
|
|
19
|
+
vendor: "qwen",
|
|
20
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.QwenSTT = QwenSTT;
|
|
10
25
|
class FengmingSTT extends base_js_1.BaseCNSTT {
|
|
11
26
|
constructor(options = {}) {
|
|
12
27
|
var _a;
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Type-safe MLLM (Multimodal Large Language Model) vendor classes.
|
|
3
3
|
*
|
|
4
4
|
* MLLM vendors handle real-time audio end-to-end, bypassing the standard
|
|
5
|
-
* ASR → LLM → TTS pipeline. Calling `agent.withMllm(vendor)`
|
|
6
|
-
*
|
|
5
|
+
* ASR → LLM → TTS pipeline. Calling `agent.withMllm(vendor)` makes the start
|
|
6
|
+
* request send `advanced_features.enable_mllm: true`. `mllm.enable` is never
|
|
7
|
+
* sent, because its presence stops RTM `message.metrics` from being delivered.
|
|
7
8
|
*/
|
|
8
9
|
import type { MllmConfig, MllmTurnDetectionConfig } from "../types.js";
|
|
9
10
|
import { BaseCNMLLM, BaseMLLM, type BaseMllmOptions } from "./base.js";
|
|
@@ -12,7 +13,49 @@ export declare const GeminiLiveModels: {
|
|
|
12
13
|
readonly Live38: "models/gemini-3.8-live";
|
|
13
14
|
/** Public ID for the reasoning voice model. */
|
|
14
15
|
readonly Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking";
|
|
16
|
+
/** Gemini Live EAP voice model. Accepts `thinkingLevel`. */
|
|
17
|
+
readonly Live4: "gemini-4-live";
|
|
18
|
+
/** Gemini Live EAP translation model. Set `translateTo` to use it. */
|
|
19
|
+
readonly Live4Translate: "gemini-4-live-translate";
|
|
15
20
|
};
|
|
21
|
+
/** How the SDK treats one Gemini Live model ID. */
|
|
22
|
+
export interface GeminiLiveModelSpec {
|
|
23
|
+
/**
|
|
24
|
+
* Served only by the preview endpoint. `AgentSession` routes these sessions
|
|
25
|
+
* to the preview host with `agora-feature: gemini`. The start body is the
|
|
26
|
+
* same as the GA body.
|
|
27
|
+
*/
|
|
28
|
+
readonly preview: boolean;
|
|
29
|
+
/** Accepts `thinkingLevel`, sent as `params.thinking_level`. */
|
|
30
|
+
readonly extendedThinking?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** A row in {@link GEMINI_LIVE_MODEL_TABLE}: a model spec, or an alias of another row. */
|
|
33
|
+
export type GeminiLiveModelRow = GeminiLiveModelSpec | {
|
|
34
|
+
readonly aliasOf: string;
|
|
35
|
+
readonly deprecated?: boolean;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Every Gemini Live model that uses the Gemini 3.8 builder path, keyed by the
|
|
39
|
+
* model ID sent in `mllm.params.model`. This one table selects the builder
|
|
40
|
+
* path, the production greeting normalization, and preview routing.
|
|
41
|
+
*
|
|
42
|
+
* A renamed model can keep its old ID as `{ aliasOf: "<new name>", deprecated: true }`.
|
|
43
|
+
* An alias takes the target's spec, and the SDK sends the model ID the caller
|
|
44
|
+
* wrote unchanged.
|
|
45
|
+
*
|
|
46
|
+
* Models missing from this table use the legacy Gemini path and the production
|
|
47
|
+
* route.
|
|
48
|
+
*/
|
|
49
|
+
export declare const GEMINI_LIVE_MODEL_TABLE: Readonly<Record<string, GeminiLiveModelRow>>;
|
|
50
|
+
/**
|
|
51
|
+
* Looks up a model in a Gemini Live model table, following alias rows.
|
|
52
|
+
* Returns `undefined` for models missing from the table.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveGeminiLiveModel(model: string, table?: Readonly<Record<string, GeminiLiveModelRow>>): GeminiLiveModelSpec | undefined;
|
|
55
|
+
/** Gemini Live EAP models, served only by the preview endpoint. Derived from {@link GEMINI_LIVE_MODEL_TABLE}. */
|
|
56
|
+
export declare const GEMINI_EAP_MLLM_MODELS: ReadonlySet<string>;
|
|
57
|
+
/** Gemini Live models served by the production endpoint. Derived from {@link GEMINI_LIVE_MODEL_TABLE}. */
|
|
58
|
+
export declare const PRODUCTION_GEMINI_MLLM_MODELS: ReadonlySet<string>;
|
|
16
59
|
/** The model Gemini Live sends by default. */
|
|
17
60
|
export declare const GEMINI_MLLM_DEFAULT_MODEL: string;
|
|
18
61
|
/** Default Gemini Developer API endpoint for Gemini 3.8 models. */
|
|
@@ -25,7 +68,7 @@ export type GeminiLiveModel = (typeof GeminiLiveModels)[keyof typeof GeminiLiveM
|
|
|
25
68
|
export declare const GeminiThinkingLevels: readonly ["low", "medium", "high"];
|
|
26
69
|
export type GeminiThinkingLevel = (typeof GeminiThinkingLevels)[number];
|
|
27
70
|
/** Known Gemini output voices; future voice names remain accepted. */
|
|
28
|
-
export type GeminiLiveVoice = "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede" | "Leda" | "Orus" | "Zephyr" | (string & {});
|
|
71
|
+
export type GeminiLiveVoice = "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede" | "Leda" | "Orus" | "Zephyr" | "Fola" | (string & {});
|
|
29
72
|
/** @deprecated Use {@link GeminiLiveVoice}. */
|
|
30
73
|
export type GeminiPreviewVoice = GeminiLiveVoice;
|
|
31
74
|
export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
|
|
@@ -200,10 +243,19 @@ export interface GeminiLiveOptions extends BaseMllmOptions {
|
|
|
200
243
|
apiKey: string;
|
|
201
244
|
/** Model name (e.g., 'gemini-live-2.5-flash') */
|
|
202
245
|
model?: GeminiLiveModel;
|
|
203
|
-
/** Sent only for models/gemini-3.8-live-extended-thinking. */
|
|
246
|
+
/** Sent only for models/gemini-3.8-live-extended-thinking and gemini-4-live. */
|
|
204
247
|
thinkingLevel?: GeminiThinkingLevel;
|
|
205
248
|
/** Languages for Gemini 3.8, sent as params.language_codes. */
|
|
206
249
|
languageCodes?: readonly string[];
|
|
250
|
+
/**
|
|
251
|
+
* Switches the session to speech translation, sent as params.translate_to
|
|
252
|
+
* whenever set. The Gemini Live EAP `gemini-4-live-translate` model uses it. Codes are a vendor allow-list that the SDK does not
|
|
253
|
+
* validate: `es` and `pt-BR` work, `es-ES` does not. A rejected code closes
|
|
254
|
+
* the session mid-stream with a 1007.
|
|
255
|
+
*/
|
|
256
|
+
translateTo?: string;
|
|
257
|
+
/** Sent as params.echo_target_language whenever set. Used with `translateTo`. */
|
|
258
|
+
echoTargetLanguage?: boolean;
|
|
207
259
|
/** Endpoint override; Gemini 3.8 defaults to the Developer API host. */
|
|
208
260
|
url?: string;
|
|
209
261
|
/** System instructions for the model */
|
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Type-safe MLLM (Multimodal Large Language Model) vendor classes.
|
|
4
4
|
*
|
|
5
5
|
* MLLM vendors handle real-time audio end-to-end, bypassing the standard
|
|
6
|
-
* ASR → LLM → TTS pipeline. Calling `agent.withMllm(vendor)`
|
|
7
|
-
*
|
|
6
|
+
* ASR → LLM → TTS pipeline. Calling `agent.withMllm(vendor)` makes the start
|
|
7
|
+
* request send `advanced_features.enable_mllm: true`. `mllm.enable` is never
|
|
8
|
+
* sent, because its presence stops RTM `message.metrics` from being delivered.
|
|
8
9
|
*/
|
|
9
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.QwenOmni = exports.XaiGrok = exports.VertexAI = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.OPENAI_GPT_LIVE_VENDOR = exports.GeminiThinkingLevels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.GeminiLiveModels = void 0;
|
|
11
|
+
exports.QwenOmni = exports.XaiGrok = exports.VertexAI = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.OPENAI_GPT_LIVE_VENDOR = exports.GeminiThinkingLevels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.PRODUCTION_GEMINI_MLLM_MODELS = exports.GEMINI_EAP_MLLM_MODELS = exports.GEMINI_LIVE_MODEL_TABLE = exports.GeminiLiveModels = void 0;
|
|
12
|
+
exports.resolveGeminiLiveModel = resolveGeminiLiveModel;
|
|
11
13
|
exports.isOpenAIGPTLiveConfig = isOpenAIGPTLiveConfig;
|
|
12
14
|
const base_js_1 = require("./base.js");
|
|
13
15
|
function requireString(value, field, vendor) {
|
|
@@ -28,7 +30,57 @@ exports.GeminiLiveModels = {
|
|
|
28
30
|
Live38: "models/gemini-3.8-live",
|
|
29
31
|
/** Public ID for the reasoning voice model. */
|
|
30
32
|
Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking",
|
|
33
|
+
/** Gemini Live EAP voice model. Accepts `thinkingLevel`. */
|
|
34
|
+
Live4: "gemini-4-live",
|
|
35
|
+
/** Gemini Live EAP translation model. Set `translateTo` to use it. */
|
|
36
|
+
Live4Translate: "gemini-4-live-translate",
|
|
31
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* Every Gemini Live model that uses the Gemini 3.8 builder path, keyed by the
|
|
40
|
+
* model ID sent in `mllm.params.model`. This one table selects the builder
|
|
41
|
+
* path, the production greeting normalization, and preview routing.
|
|
42
|
+
*
|
|
43
|
+
* A renamed model can keep its old ID as `{ aliasOf: "<new name>", deprecated: true }`.
|
|
44
|
+
* An alias takes the target's spec, and the SDK sends the model ID the caller
|
|
45
|
+
* wrote unchanged.
|
|
46
|
+
*
|
|
47
|
+
* Models missing from this table use the legacy Gemini path and the production
|
|
48
|
+
* route.
|
|
49
|
+
*/
|
|
50
|
+
exports.GEMINI_LIVE_MODEL_TABLE = {
|
|
51
|
+
[exports.GeminiLiveModels.Live38]: { preview: false },
|
|
52
|
+
[exports.GeminiLiveModels.Live38ExtendedThinking]: { preview: false, extendedThinking: true },
|
|
53
|
+
[exports.GeminiLiveModels.Live4]: { preview: true, extendedThinking: true },
|
|
54
|
+
[exports.GeminiLiveModels.Live4Translate]: { preview: true },
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Looks up a model in a Gemini Live model table, following alias rows.
|
|
58
|
+
* Returns `undefined` for models missing from the table.
|
|
59
|
+
*/
|
|
60
|
+
function resolveGeminiLiveModel(model, table = exports.GEMINI_LIVE_MODEL_TABLE) {
|
|
61
|
+
var _a, _b;
|
|
62
|
+
const seen = new Set();
|
|
63
|
+
let id = model;
|
|
64
|
+
let row = (_a = Object.getOwnPropertyDescriptor(table, id)) === null || _a === void 0 ? void 0 : _a.value;
|
|
65
|
+
while (row !== undefined && !seen.has(id)) {
|
|
66
|
+
if (!("aliasOf" in row))
|
|
67
|
+
return row;
|
|
68
|
+
seen.add(id);
|
|
69
|
+
id = row.aliasOf;
|
|
70
|
+
row = (_b = Object.getOwnPropertyDescriptor(table, id)) === null || _b === void 0 ? void 0 : _b.value;
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
function geminiLiveModelsWhere(predicate) {
|
|
75
|
+
return new Set(Object.keys(exports.GEMINI_LIVE_MODEL_TABLE).filter((model) => {
|
|
76
|
+
const spec = resolveGeminiLiveModel(model);
|
|
77
|
+
return spec !== undefined && predicate(spec);
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
/** Gemini Live EAP models, served only by the preview endpoint. Derived from {@link GEMINI_LIVE_MODEL_TABLE}. */
|
|
81
|
+
exports.GEMINI_EAP_MLLM_MODELS = geminiLiveModelsWhere((spec) => spec.preview);
|
|
82
|
+
/** Gemini Live models served by the production endpoint. Derived from {@link GEMINI_LIVE_MODEL_TABLE}. */
|
|
83
|
+
exports.PRODUCTION_GEMINI_MLLM_MODELS = geminiLiveModelsWhere((spec) => !spec.preview);
|
|
32
84
|
/** The model Gemini Live sends by default. */
|
|
33
85
|
exports.GEMINI_MLLM_DEFAULT_MODEL = exports.GeminiLiveModels.Live38;
|
|
34
86
|
/** Default Gemini Developer API endpoint for Gemini 3.8 models. */
|
|
@@ -203,12 +255,15 @@ class GeminiLive extends base_js_1.BaseMLLM {
|
|
|
203
255
|
toConfig() {
|
|
204
256
|
const { apiKey, model, url, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
205
257
|
const selectedModel = (model === null || model === void 0 ? void 0 : model.trim()) || exports.GEMINI_MLLM_DEFAULT_MODEL;
|
|
206
|
-
const
|
|
207
|
-
const
|
|
208
|
-
const
|
|
258
|
+
const spec = resolveGeminiLiveModel(selectedModel);
|
|
259
|
+
const isGemini38 = spec !== undefined;
|
|
260
|
+
const isExtendedThinking = (spec === null || spec === void 0 ? void 0 : spec.extendedThinking) === true;
|
|
261
|
+
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({}, additionalParams), { model: selectedModel }), (instructions && { instructions })), ((voice || isGemini38) && { voice: voice || "Puck" })), (isExtendedThinking &&
|
|
209
262
|
this.options.thinkingLevel !== undefined && {
|
|
210
263
|
thinking_level: this.options.thinkingLevel,
|
|
211
|
-
})), (isGemini38 && this.options.languageCodes && { language_codes: [...this.options.languageCodes] })), (
|
|
264
|
+
})), (isGemini38 && this.options.languageCodes && { language_codes: [...this.options.languageCodes] })), (this.options.translateTo && { translate_to: this.options.translateTo })), (this.options.echoTargetLanguage !== undefined && {
|
|
265
|
+
echo_target_language: this.options.echoTargetLanguage,
|
|
266
|
+
})), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (httpOptions && { http_options: httpOptions }));
|
|
212
267
|
if (isGemini38) {
|
|
213
268
|
delete params.api_key;
|
|
214
269
|
if (!isExtendedThinking)
|
|
@@ -4,6 +4,30 @@
|
|
|
4
4
|
import { type DeepgramPresetModel } from "../presets.js";
|
|
5
5
|
import type { SttConfig, TurnDetectionLanguage } from "../types.js";
|
|
6
6
|
import { BaseSTT, type SampleRate } from "./base.js";
|
|
7
|
+
/** Constructor options for global ElevenLabs ASR. */
|
|
8
|
+
export interface ElevenLabsSTTOptions {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
11
|
+
additionalParams?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
/** ElevenLabs ASR for global deployments. */
|
|
14
|
+
export declare class ElevenLabsSTT extends BaseSTT {
|
|
15
|
+
private readonly options;
|
|
16
|
+
constructor(options: ElevenLabsSTTOptions);
|
|
17
|
+
toConfig(): SttConfig;
|
|
18
|
+
}
|
|
19
|
+
/** Constructor options for global Fish Audio ASR. */
|
|
20
|
+
export interface FishAudioSTTOptions {
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
23
|
+
additionalParams?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/** Fish Audio ASR for global deployments. */
|
|
26
|
+
export declare class FishAudioSTT extends BaseSTT {
|
|
27
|
+
private readonly options;
|
|
28
|
+
constructor(options: FishAudioSTTOptions);
|
|
29
|
+
toConfig(): SttConfig;
|
|
30
|
+
}
|
|
7
31
|
/** Gemini transcription models. */
|
|
8
32
|
export declare const GeminiSTTModels: {
|
|
9
33
|
readonly Transcribe35Live: "gemini-3.5-transcribe-live";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type-safe STT (Speech-to-Text) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SmallestAISTT = exports.XAiSTT = exports.RTZRSTT = exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = exports.GeminiSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = void 0;
|
|
6
|
+
exports.SmallestAISTT = exports.XAiSTT = exports.RTZRSTT = exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = exports.GeminiSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.FishAudioSTT = exports.ElevenLabsSTT = void 0;
|
|
7
7
|
const presets_js_1 = require("../presets.js");
|
|
8
8
|
const base_js_1 = require("./base.js");
|
|
9
9
|
function _requireString(value, field, vendor) {
|
|
@@ -11,6 +11,36 @@ function _requireString(value, field, vendor) {
|
|
|
11
11
|
throw new Error(`${vendor} requires ${field}`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
/** ElevenLabs ASR for global deployments. */
|
|
15
|
+
class ElevenLabsSTT extends base_js_1.BaseSTT {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super();
|
|
18
|
+
this.options = options;
|
|
19
|
+
_requireString(options.apiKey, "apiKey", "ElevenLabsSTT");
|
|
20
|
+
}
|
|
21
|
+
toConfig() {
|
|
22
|
+
return {
|
|
23
|
+
vendor: "elevenlabs",
|
|
24
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ElevenLabsSTT = ElevenLabsSTT;
|
|
29
|
+
/** Fish Audio ASR for global deployments. */
|
|
30
|
+
class FishAudioSTT extends base_js_1.BaseSTT {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super();
|
|
33
|
+
this.options = options;
|
|
34
|
+
_requireString(options.apiKey, "apiKey", "FishAudioSTT");
|
|
35
|
+
}
|
|
36
|
+
toConfig() {
|
|
37
|
+
return {
|
|
38
|
+
vendor: "fishaudio",
|
|
39
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FishAudioSTT = FishAudioSTT;
|
|
14
44
|
function isDeepgramManagedModel(model) {
|
|
15
45
|
return model !== undefined && presets_js_1.DeepgramPresetModels.includes(model.trim().toLowerCase());
|
|
16
46
|
}
|
|
@@ -399,44 +399,6 @@ export declare class TypecastTTS extends BaseTTS {
|
|
|
399
399
|
constructor(options: TypecastTTSOptions);
|
|
400
400
|
toConfig(): TtsConfig;
|
|
401
401
|
}
|
|
402
|
-
/**
|
|
403
|
-
* Constructor options for Hume AI TTS.
|
|
404
|
-
*/
|
|
405
|
-
export interface HumeAITTSOptions {
|
|
406
|
-
/** Hume AI API key */
|
|
407
|
-
key: string;
|
|
408
|
-
/** Configuration ID */
|
|
409
|
-
configId?: string;
|
|
410
|
-
/** Hume AI voice ID */
|
|
411
|
-
voiceId: string;
|
|
412
|
-
/** Base URL for the Hume AI API */
|
|
413
|
-
baseUrl?: string;
|
|
414
|
-
/** Voice provider type */
|
|
415
|
-
provider: "HUME_AI" | "CUSTOM_VOICE";
|
|
416
|
-
/** Playback speed of the generated speech */
|
|
417
|
-
speed?: number;
|
|
418
|
-
/** Duration of silence in seconds to add at the end of each utterance */
|
|
419
|
-
trailingSilence?: number;
|
|
420
|
-
/** Skip patterns for bracketed content */
|
|
421
|
-
skipPatterns?: number[];
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Hume AI TTS vendor.
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```typescript
|
|
428
|
-
* const tts = new HumeAITTS({
|
|
429
|
-
* key: process.env.HUME_API_KEY,
|
|
430
|
-
* voiceId: 'voice-id',
|
|
431
|
-
* provider: 'CUSTOM_VOICE',
|
|
432
|
-
* });
|
|
433
|
-
* ```
|
|
434
|
-
*/
|
|
435
|
-
export declare class HumeAITTS extends BaseTTS {
|
|
436
|
-
private readonly options;
|
|
437
|
-
constructor(options: HumeAITTSOptions);
|
|
438
|
-
toConfig(): TtsConfig;
|
|
439
|
-
}
|
|
440
402
|
/**
|
|
441
403
|
* Constructor options for Rime TTS.
|
|
442
404
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type-safe TTS (Text-to-Speech) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SmallestAITTS = exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.SarvamTTSLanguage = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.
|
|
6
|
+
exports.SmallestAITTS = exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.SarvamTTSLanguage = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.TypecastTTS = exports.MistralTTS = exports.GradiumTTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = exports.GeminiTTS = exports.GeminiTTSModels = exports.SonioxTTS = void 0;
|
|
7
7
|
const SarvamTtsParams_js_1 = require("../../api/types/SarvamTtsParams.js");
|
|
8
8
|
const constants_js_1 = require("../constants.js");
|
|
9
9
|
const presets_js_1 = require("../presets.js");
|
|
@@ -292,29 +292,6 @@ class TypecastTTS extends base_js_1.BaseTTS {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
exports.TypecastTTS = TypecastTTS;
|
|
295
|
-
/**
|
|
296
|
-
* Hume AI TTS vendor.
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* ```typescript
|
|
300
|
-
* const tts = new HumeAITTS({
|
|
301
|
-
* key: process.env.HUME_API_KEY,
|
|
302
|
-
* voiceId: 'voice-id',
|
|
303
|
-
* provider: 'CUSTOM_VOICE',
|
|
304
|
-
* });
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
class HumeAITTS extends base_js_1.BaseTTS {
|
|
308
|
-
constructor(options) {
|
|
309
|
-
super();
|
|
310
|
-
this.options = options;
|
|
311
|
-
}
|
|
312
|
-
toConfig() {
|
|
313
|
-
const { key, configId, voiceId, baseUrl, provider, speed, trailingSilence, skipPatterns } = this.options;
|
|
314
|
-
return Object.assign({ vendor: "humeai", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key, voice_id: voiceId }, (baseUrl && { base_url: baseUrl })), { provider }), (speed !== undefined && { speed })), (trailingSilence !== undefined && { trailing_silence: trailingSilence })), (configId && { config_id: configId })) }, (skipPatterns && { skip_patterns: skipPatterns }));
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
exports.HumeAITTS = HumeAITTS;
|
|
318
295
|
/**
|
|
319
296
|
* Rime TTS vendor.
|
|
320
297
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Gemini | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Rtzr | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect | Agora.Asr.Smallestai | Agora.Asr.Stepfun;
|
|
2
|
+
export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Gemini | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Rtzr | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect | Agora.Asr.Smallestai | Agora.Asr.Stepfun | Agora.Asr.Elevenlabs | Agora.Asr.Fishaudio | Agora.Asr.Qwen;
|
|
3
3
|
export declare namespace Asr {
|
|
4
4
|
interface Ares extends Agora.AresAsr {
|
|
5
5
|
vendor: "ares";
|
|
@@ -58,4 +58,13 @@ export declare namespace Asr {
|
|
|
58
58
|
interface Stepfun extends Agora.StepfunAsr {
|
|
59
59
|
vendor: "stepfun";
|
|
60
60
|
}
|
|
61
|
+
interface Elevenlabs extends Agora.ElevenLabsAsr {
|
|
62
|
+
vendor: "elevenlabs";
|
|
63
|
+
}
|
|
64
|
+
interface Fishaudio extends Agora.FishAudioAsr {
|
|
65
|
+
vendor: "fishaudio";
|
|
66
|
+
}
|
|
67
|
+
interface Qwen extends Agora.QwenAsr {
|
|
68
|
+
vendor: "qwen";
|
|
69
|
+
}
|
|
61
70
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Agora from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* ElevenLabs ASR configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface ElevenLabsAsr {
|
|
6
|
+
language?: Agora.AsrLanguage;
|
|
7
|
+
params: Agora.ElevenLabsAsrParams;
|
|
8
|
+
/** Accepts any additional properties */
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.MinimaxDuplex | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.
|
|
2
|
+
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.MinimaxDuplex | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Gemini | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai | Agora.Tts.Soniox;
|
|
3
3
|
export declare namespace Tts {
|
|
4
4
|
interface Tencent extends Agora.TencentTts {
|
|
5
5
|
vendor: "tencent";
|
|
@@ -28,9 +28,6 @@ export declare namespace Tts {
|
|
|
28
28
|
interface Openai extends Agora.OpenAiTts {
|
|
29
29
|
vendor: "openai";
|
|
30
30
|
}
|
|
31
|
-
interface Humeai extends Agora.HumeAiTts {
|
|
32
|
-
vendor: "humeai";
|
|
33
|
-
}
|
|
34
31
|
interface Rime extends Agora.RimeTts {
|
|
35
32
|
vendor: "rime";
|
|
36
33
|
}
|
|
@@ -24,10 +24,14 @@ export * from "./DeepgramAsr.js";
|
|
|
24
24
|
export * from "./DeepgramAsrParams.js";
|
|
25
25
|
export * from "./DeepgramTts.js";
|
|
26
26
|
export * from "./DeepgramTtsParams.js";
|
|
27
|
+
export * from "./ElevenLabsAsr.js";
|
|
28
|
+
export * from "./ElevenLabsAsrParams.js";
|
|
27
29
|
export * from "./ElevenLabsTts.js";
|
|
28
30
|
export * from "./ElevenLabsTtsParams.js";
|
|
29
31
|
export * from "./FengmingAsr.js";
|
|
30
32
|
export * from "./FengmingAsrParams.js";
|
|
33
|
+
export * from "./FishAudioAsr.js";
|
|
34
|
+
export * from "./FishAudioAsrParams.js";
|
|
31
35
|
export * from "./FishAudioTts.js";
|
|
32
36
|
export * from "./FishAudioTtsParams.js";
|
|
33
37
|
export * from "./GeminiAsr.js";
|
|
@@ -44,8 +48,6 @@ export * from "./GoogleTtsParams.js";
|
|
|
44
48
|
export * from "./GoogleTtsVoiceSelectionParams.js";
|
|
45
49
|
export * from "./GradiumTts.js";
|
|
46
50
|
export * from "./GradiumTtsParams.js";
|
|
47
|
-
export * from "./HumeAiTts.js";
|
|
48
|
-
export * from "./HumeAiTtsParams.js";
|
|
49
51
|
export * from "./Llm.js";
|
|
50
52
|
export * from "./LlmParams.js";
|
|
51
53
|
export * from "./LlmTool.js";
|
|
@@ -75,6 +77,8 @@ export * from "./OpenAiAsrParams.js";
|
|
|
75
77
|
export * from "./OpenAiInputAudioTranscription.js";
|
|
76
78
|
export * from "./OpenAiTts.js";
|
|
77
79
|
export * from "./OpenAiTtsParams.js";
|
|
80
|
+
export * from "./QwenAsr.js";
|
|
81
|
+
export * from "./QwenAsrParams.js";
|
|
78
82
|
export * from "./RimeTts.js";
|
|
79
83
|
export * from "./RimeTtsParams.js";
|
|
80
84
|
export * from "./RtzrAsr.js";
|
|
@@ -40,10 +40,14 @@ __exportStar(require("./DeepgramAsr.js"), exports);
|
|
|
40
40
|
__exportStar(require("./DeepgramAsrParams.js"), exports);
|
|
41
41
|
__exportStar(require("./DeepgramTts.js"), exports);
|
|
42
42
|
__exportStar(require("./DeepgramTtsParams.js"), exports);
|
|
43
|
+
__exportStar(require("./ElevenLabsAsr.js"), exports);
|
|
44
|
+
__exportStar(require("./ElevenLabsAsrParams.js"), exports);
|
|
43
45
|
__exportStar(require("./ElevenLabsTts.js"), exports);
|
|
44
46
|
__exportStar(require("./ElevenLabsTtsParams.js"), exports);
|
|
45
47
|
__exportStar(require("./FengmingAsr.js"), exports);
|
|
46
48
|
__exportStar(require("./FengmingAsrParams.js"), exports);
|
|
49
|
+
__exportStar(require("./FishAudioAsr.js"), exports);
|
|
50
|
+
__exportStar(require("./FishAudioAsrParams.js"), exports);
|
|
47
51
|
__exportStar(require("./FishAudioTts.js"), exports);
|
|
48
52
|
__exportStar(require("./FishAudioTtsParams.js"), exports);
|
|
49
53
|
__exportStar(require("./GeminiAsr.js"), exports);
|
|
@@ -60,8 +64,6 @@ __exportStar(require("./GoogleTtsParams.js"), exports);
|
|
|
60
64
|
__exportStar(require("./GoogleTtsVoiceSelectionParams.js"), exports);
|
|
61
65
|
__exportStar(require("./GradiumTts.js"), exports);
|
|
62
66
|
__exportStar(require("./GradiumTtsParams.js"), exports);
|
|
63
|
-
__exportStar(require("./HumeAiTts.js"), exports);
|
|
64
|
-
__exportStar(require("./HumeAiTtsParams.js"), exports);
|
|
65
67
|
__exportStar(require("./Llm.js"), exports);
|
|
66
68
|
__exportStar(require("./LlmParams.js"), exports);
|
|
67
69
|
__exportStar(require("./LlmTool.js"), exports);
|
|
@@ -91,6 +93,8 @@ __exportStar(require("./OpenAiAsrParams.js"), exports);
|
|
|
91
93
|
__exportStar(require("./OpenAiInputAudioTranscription.js"), exports);
|
|
92
94
|
__exportStar(require("./OpenAiTts.js"), exports);
|
|
93
95
|
__exportStar(require("./OpenAiTtsParams.js"), exports);
|
|
96
|
+
__exportStar(require("./QwenAsr.js"), exports);
|
|
97
|
+
__exportStar(require("./QwenAsrParams.js"), exports);
|
|
94
98
|
__exportStar(require("./RimeTts.js"), exports);
|
|
95
99
|
__exportStar(require("./RimeTtsParams.js"), exports);
|
|
96
100
|
__exportStar(require("./RtzrAsr.js"), exports);
|