agora-agents 2.9.0 → 2.11.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 +4 -3
- package/dist/cjs/agentkit/index.d.ts +10 -10
- package/dist/cjs/agentkit/index.js +13 -8
- package/dist/cjs/agentkit/preview/client.d.ts +5 -17
- package/dist/cjs/agentkit/preview/client.js +18 -84
- package/dist/cjs/agentkit/preview/gemini-tts.d.ts +31 -0
- package/dist/cjs/agentkit/preview/gemini-tts.js +32 -0
- package/dist/cjs/agentkit/preview/index.d.ts +6 -2
- package/dist/cjs/agentkit/preview/index.js +7 -2
- package/dist/cjs/agentkit/preview/vendors.d.ts +8 -104
- package/dist/cjs/agentkit/preview/vendors.js +14 -115
- package/dist/cjs/agentkit/types.d.ts +12 -5
- 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 +92 -10
- package/dist/cjs/agentkit/vendors/mllm.js +115 -18
- 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 +4 -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 +3 -2
- package/dist/esm/agentkit/index.d.mts +10 -10
- package/dist/esm/agentkit/index.mjs +4 -4
- package/dist/esm/agentkit/preview/client.d.mts +5 -17
- package/dist/esm/agentkit/preview/client.mjs +18 -84
- package/dist/esm/agentkit/preview/gemini-tts.d.mts +31 -0
- package/dist/esm/agentkit/preview/gemini-tts.mjs +28 -0
- package/dist/esm/agentkit/preview/index.d.mts +6 -2
- package/dist/esm/agentkit/preview/index.mjs +3 -1
- package/dist/esm/agentkit/preview/vendors.d.mts +8 -104
- package/dist/esm/agentkit/preview/vendors.mjs +5 -112
- package/dist/esm/agentkit/types.d.mts +12 -5
- 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 +92 -10
- package/dist/esm/agentkit/vendors/mllm.mjs +111 -16
- 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 +4 -2
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* sets `mllm.enable: true`.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.QwenOmni = exports.XaiGrok = exports.VertexAI = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.OpenAIRealtime = void 0;
|
|
11
|
-
|
|
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.isOpenAIGPTLiveConfig = isOpenAIGPTLiveConfig;
|
|
12
12
|
const base_js_1 = require("./base.js");
|
|
13
13
|
function requireString(value, field, vendor) {
|
|
14
14
|
if (typeof value !== "string" || value.length === 0) {
|
|
@@ -20,6 +20,95 @@ function requireObject(value, field, vendor) {
|
|
|
20
20
|
throw new Error(`${vendor} requires ${field}`);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Google Gemini Live (MLLM)
|
|
25
|
+
// =============================================================================
|
|
26
|
+
exports.GeminiLiveModels = {
|
|
27
|
+
/** Public ID for the low-latency voice model. */
|
|
28
|
+
Live38: "models/gemini-3.8-live",
|
|
29
|
+
/** Public ID for the reasoning voice model. */
|
|
30
|
+
Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking",
|
|
31
|
+
};
|
|
32
|
+
/** The model Gemini Live sends by default. */
|
|
33
|
+
exports.GEMINI_MLLM_DEFAULT_MODEL = exports.GeminiLiveModels.Live38;
|
|
34
|
+
/** Default Gemini Developer API endpoint for Gemini 3.8 models. */
|
|
35
|
+
exports.GEMINI_MLLM_URL = "https://generativelanguage.googleapis.com";
|
|
36
|
+
/** @deprecated Use {@link GEMINI_MLLM_URL}. */
|
|
37
|
+
exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL;
|
|
38
|
+
/** Reasoning budgets accepted by Gemini Extended Thinking. */
|
|
39
|
+
exports.GeminiThinkingLevels = ["low", "medium", "high"];
|
|
40
|
+
// =============================================================================
|
|
41
|
+
// OpenAI GPT Live (MLLM)
|
|
42
|
+
// =============================================================================
|
|
43
|
+
exports.OPENAI_GPT_LIVE_VENDOR = "openai_gpt_live";
|
|
44
|
+
function isOpenAIGPTLiveConfig(config) {
|
|
45
|
+
return (config === null || config === void 0 ? void 0 : config.vendor) === exports.OPENAI_GPT_LIVE_VENDOR;
|
|
46
|
+
}
|
|
47
|
+
class OpenAIGPTLive extends base_js_1.BaseMLLM {
|
|
48
|
+
constructor(options) {
|
|
49
|
+
super(options);
|
|
50
|
+
this.options = options;
|
|
51
|
+
if (!options.apiKey)
|
|
52
|
+
throw new Error("OpenAIGPTLive requires apiKey");
|
|
53
|
+
}
|
|
54
|
+
toConfig() {
|
|
55
|
+
var _a, _b;
|
|
56
|
+
const o = this.options;
|
|
57
|
+
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 }));
|
|
58
|
+
if (o.inputAudioTranscription !== undefined || "input_audio_transcription" in params) {
|
|
59
|
+
throw new Error("GPT Live v3 does not support input_audio_transcription");
|
|
60
|
+
}
|
|
61
|
+
if (o.turnDetection !== undefined || "turn_detection" in params) {
|
|
62
|
+
console.warn("GPT Live v3 ignores turn_detection; endpointing is internal");
|
|
63
|
+
delete params.turn_detection;
|
|
64
|
+
}
|
|
65
|
+
if (params.delegation !== undefined && params.delegation !== "client" && params.delegation !== "responses") {
|
|
66
|
+
throw new Error("GPT Live delegation must be client or responses");
|
|
67
|
+
}
|
|
68
|
+
if (params.headers !== undefined) {
|
|
69
|
+
let headers;
|
|
70
|
+
try {
|
|
71
|
+
headers = JSON.parse(String(params.headers));
|
|
72
|
+
}
|
|
73
|
+
catch (_c) {
|
|
74
|
+
throw new Error("GPT Live headers must be a JSON object string");
|
|
75
|
+
}
|
|
76
|
+
if (headers === null || typeof headers !== "object" || Array.isArray(headers)) {
|
|
77
|
+
throw new Error("GPT Live headers must be a JSON object string");
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const session = params.session_params === undefined ? {} : params.session_params;
|
|
81
|
+
if (session === null || typeof session !== "object" || Array.isArray(session)) {
|
|
82
|
+
throw new Error("GPT Live session_params must be an object");
|
|
83
|
+
}
|
|
84
|
+
for (const key of ["model", "delegation", "audio", "instructions", "input"]) {
|
|
85
|
+
if (key in session)
|
|
86
|
+
throw new Error(`GPT Live session_params cannot override ${key}`);
|
|
87
|
+
}
|
|
88
|
+
let url = o.url ||
|
|
89
|
+
`${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(/^\/+/, "")}`;
|
|
90
|
+
if (!/^wss?:\/\/[^/]/i.test(url)) {
|
|
91
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
92
|
+
}
|
|
93
|
+
let parsed;
|
|
94
|
+
try {
|
|
95
|
+
parsed = new URL(url);
|
|
96
|
+
}
|
|
97
|
+
catch (_d) {
|
|
98
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
99
|
+
}
|
|
100
|
+
if ((parsed.protocol !== "ws:" && parsed.protocol !== "wss:") || !parsed.hostname) {
|
|
101
|
+
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
102
|
+
}
|
|
103
|
+
if (parsed.hostname === "api.openai.com" && parsed.pathname === "/v1/live") {
|
|
104
|
+
parsed.pathname = "/v1/live/sessions";
|
|
105
|
+
url = parsed.toString();
|
|
106
|
+
}
|
|
107
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: exports.OPENAI_GPT_LIVE_VENDOR, api_key: o.apiKey, url,
|
|
108
|
+
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 }));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.OpenAIGPTLive = OpenAIGPTLive;
|
|
23
112
|
/**
|
|
24
113
|
* OpenAI Realtime API MLLM vendor.
|
|
25
114
|
*
|
|
@@ -35,7 +124,7 @@ function requireObject(value, field, vendor) {
|
|
|
35
124
|
*/
|
|
36
125
|
class OpenAIRealtime extends base_js_1.BaseMLLM {
|
|
37
126
|
constructor(options) {
|
|
38
|
-
super();
|
|
127
|
+
super(options);
|
|
39
128
|
this.options = options;
|
|
40
129
|
}
|
|
41
130
|
toConfig() {
|
|
@@ -50,7 +139,7 @@ class OpenAIRealtime extends base_js_1.BaseMLLM {
|
|
|
50
139
|
voice !== undefined ||
|
|
51
140
|
instructions !== undefined ||
|
|
52
141
|
inputAudioTranscription !== undefined;
|
|
53
|
-
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 }));
|
|
142
|
+
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 }));
|
|
54
143
|
}
|
|
55
144
|
}
|
|
56
145
|
exports.OpenAIRealtime = OpenAIRealtime;
|
|
@@ -70,7 +159,7 @@ exports.OpenAIRealtime = OpenAIRealtime;
|
|
|
70
159
|
*/
|
|
71
160
|
class AzureOpenAIRealtime extends base_js_1.BaseMLLM {
|
|
72
161
|
constructor(options) {
|
|
73
|
-
super();
|
|
162
|
+
super(options);
|
|
74
163
|
requireString(options.apiKey, "apiKey", "AzureOpenAIRealtime");
|
|
75
164
|
requireString(options.url, "url", "AzureOpenAIRealtime");
|
|
76
165
|
requireObject(options.turnDetection, "turnDetection", "AzureOpenAIRealtime");
|
|
@@ -80,7 +169,7 @@ class AzureOpenAIRealtime extends base_js_1.BaseMLLM {
|
|
|
80
169
|
const { apiKey, url, model, voice, instructions, maxHistory, greetingMessage, outputModalities, messages, params, turnDetection, } = this.options;
|
|
81
170
|
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 }));
|
|
82
171
|
const hasParams = Object.keys(mergedParams).length > 0;
|
|
83
|
-
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 });
|
|
172
|
+
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 }));
|
|
84
173
|
}
|
|
85
174
|
}
|
|
86
175
|
exports.AzureOpenAIRealtime = AzureOpenAIRealtime;
|
|
@@ -102,22 +191,30 @@ exports.AzureOpenAIRealtime = AzureOpenAIRealtime;
|
|
|
102
191
|
*/
|
|
103
192
|
class GeminiLive extends base_js_1.BaseMLLM {
|
|
104
193
|
constructor(options) {
|
|
105
|
-
super();
|
|
194
|
+
super(options);
|
|
106
195
|
if (!options.apiKey.trim()) {
|
|
107
196
|
throw new Error("GeminiLive requires apiKey");
|
|
108
197
|
}
|
|
109
|
-
if (options.thinkingLevel !== undefined && !
|
|
198
|
+
if (options.thinkingLevel !== undefined && !exports.GeminiThinkingLevels.includes(options.thinkingLevel)) {
|
|
110
199
|
throw new Error("GeminiLive thinkingLevel must be low, medium, or high");
|
|
111
200
|
}
|
|
112
201
|
this.options = Object.assign(Object.assign({}, options), { apiKey: options.apiKey.trim() });
|
|
113
202
|
}
|
|
114
203
|
toConfig() {
|
|
115
204
|
const { apiKey, model, url, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
116
|
-
const selectedModel = (model === null || model === void 0 ? void 0 : model.trim()) ||
|
|
117
|
-
|
|
118
|
-
|
|
205
|
+
const selectedModel = (model === null || model === void 0 ? void 0 : model.trim()) || exports.GEMINI_MLLM_DEFAULT_MODEL;
|
|
206
|
+
const isGemini38 = selectedModel === exports.GeminiLiveModels.Live38 || selectedModel === exports.GeminiLiveModels.Live38ExtendedThinking;
|
|
207
|
+
const isExtendedThinking = selectedModel === exports.GeminiLiveModels.Live38ExtendedThinking;
|
|
208
|
+
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 &&
|
|
209
|
+
this.options.thinkingLevel !== undefined && {
|
|
210
|
+
thinking_level: this.options.thinkingLevel,
|
|
211
|
+
})), (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 }));
|
|
212
|
+
if (isGemini38) {
|
|
213
|
+
delete params.api_key;
|
|
214
|
+
if (!isExtendedThinking)
|
|
215
|
+
delete params.thinking_level;
|
|
119
216
|
}
|
|
120
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "gemini", api_key: apiKey, url: url !== null && url !== void 0 ? url :
|
|
217
|
+
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 ? exports.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 }));
|
|
121
218
|
}
|
|
122
219
|
}
|
|
123
220
|
exports.GeminiLive = GeminiLive;
|
|
@@ -141,12 +238,12 @@ exports.GeminiLive = GeminiLive;
|
|
|
141
238
|
*/
|
|
142
239
|
class VertexAI extends base_js_1.BaseMLLM {
|
|
143
240
|
constructor(options) {
|
|
144
|
-
super();
|
|
241
|
+
super(options);
|
|
145
242
|
this.options = options;
|
|
146
243
|
}
|
|
147
244
|
toConfig() {
|
|
148
245
|
const { model, url, projectId, location, adcCredentialsString, instructions, voice, affectiveDialog, proactiveAudio, transcribeAgent, transcribeUser, httpOptions, greetingMessage, inputModalities, outputModalities, messages, additionalParams, turnDetection, } = this.options;
|
|
149
|
-
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 }));
|
|
246
|
+
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 }));
|
|
150
247
|
}
|
|
151
248
|
}
|
|
152
249
|
exports.VertexAI = VertexAI;
|
|
@@ -171,7 +268,7 @@ exports.VertexAI = VertexAI;
|
|
|
171
268
|
*/
|
|
172
269
|
class XaiGrok extends base_js_1.BaseMLLM {
|
|
173
270
|
constructor(options) {
|
|
174
|
-
super();
|
|
271
|
+
super(options);
|
|
175
272
|
this.options = options;
|
|
176
273
|
if (!options.apiKey) {
|
|
177
274
|
throw new Error("XaiGrok requires apiKey");
|
|
@@ -179,7 +276,7 @@ class XaiGrok extends base_js_1.BaseMLLM {
|
|
|
179
276
|
}
|
|
180
277
|
toConfig() {
|
|
181
278
|
const { apiKey, url = "wss://api.x.ai/v1/realtime", voice, language, sampleRate, greetingMessage, failureMessage, inputModalities, outputModalities, messages, params, turnDetection, } = this.options;
|
|
182
|
-
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 }));
|
|
279
|
+
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 }));
|
|
183
280
|
}
|
|
184
281
|
}
|
|
185
282
|
exports.XaiGrok = XaiGrok;
|
|
@@ -198,7 +295,7 @@ exports.XaiGrok = XaiGrok;
|
|
|
198
295
|
*/
|
|
199
296
|
class QwenOmni extends base_js_1.BaseCNMLLM {
|
|
200
297
|
constructor(options) {
|
|
201
|
-
super();
|
|
298
|
+
super(options);
|
|
202
299
|
requireString(options.apiKey, "apiKey", "QwenOmni");
|
|
203
300
|
requireString(options.model, "model", "QwenOmni");
|
|
204
301
|
requireString(options.url, "url", "QwenOmni");
|
|
@@ -206,7 +303,7 @@ class QwenOmni extends base_js_1.BaseCNMLLM {
|
|
|
206
303
|
}
|
|
207
304
|
toConfig() {
|
|
208
305
|
const { apiKey, model, url, voice, instructions, greetingMessage, failureMessage, inputModalities, outputModalities, messages, params, turnDetection, } = this.options;
|
|
209
|
-
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 }));
|
|
306
|
+
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 }));
|
|
210
307
|
}
|
|
211
308
|
}
|
|
212
309
|
exports.QwenOmni = QwenOmni;
|
|
@@ -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.js").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 {};
|
|
@@ -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.XAiSTT = 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.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;
|
|
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) {
|
|
@@ -329,3 +329,20 @@ class XAiSTT extends base_js_1.BaseSTT {
|
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
exports.XAiSTT = XAiSTT;
|
|
332
|
+
/** Smallest AI streaming STT vendor. */
|
|
333
|
+
class SmallestAISTT extends base_js_1.BaseSTT {
|
|
334
|
+
constructor(options) {
|
|
335
|
+
super();
|
|
336
|
+
this.options = options;
|
|
337
|
+
if (!options.apiKey)
|
|
338
|
+
throw new Error("SmallestAISTT requires apiKey");
|
|
339
|
+
}
|
|
340
|
+
toConfig() {
|
|
341
|
+
const o = this.options;
|
|
342
|
+
return {
|
|
343
|
+
vendor: "smallestai",
|
|
344
|
+
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) })),
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
exports.SmallestAISTT = SmallestAISTT;
|
|
@@ -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.js").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 {};
|
|
@@ -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.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.TypecastTTS = exports.MistralTTS = exports.GradiumTTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
|
|
6
|
+
exports.SmallestAITTS = exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.TypecastTTS = exports.MistralTTS = exports.GradiumTTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
|
|
7
7
|
const constants_js_1 = require("../constants.js");
|
|
8
8
|
const presets_js_1 = require("../presets.js");
|
|
9
9
|
const base_js_1 = require("./base.js");
|
|
@@ -458,3 +458,18 @@ class XAiTTS extends base_js_1.BaseTTS {
|
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
exports.XAiTTS = XAiTTS;
|
|
461
|
+
/** Smallest AI streaming TTS vendor. */
|
|
462
|
+
class SmallestAITTS extends base_js_1.BaseTTS {
|
|
463
|
+
constructor(options) {
|
|
464
|
+
super();
|
|
465
|
+
this.options = options;
|
|
466
|
+
requireString(options.apiKey, "apiKey", "SmallestAITTS");
|
|
467
|
+
}
|
|
468
|
+
toConfig() {
|
|
469
|
+
const o = this.options;
|
|
470
|
+
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 && {
|
|
471
|
+
number_pronunciation_language: o.numberPronunciationLanguage,
|
|
472
|
+
})), (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 }));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
exports.SmallestAITTS = SmallestAITTS;
|
|
@@ -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. */
|
|
@@ -42,6 +42,8 @@ var StartAgentsRequest;
|
|
|
42
42
|
/**
|
|
43
43
|
* LiveAvatar (Beta) — formerly HeyGen */
|
|
44
44
|
Liveavatar: "liveavatar",
|
|
45
|
+
/**
|
|
46
|
+
* Anam Avatar (Beta) */
|
|
45
47
|
Anam: "anam",
|
|
46
48
|
/**
|
|
47
49
|
* Generic avatar (Beta) */
|
|
@@ -190,7 +192,7 @@ var StartAgentsRequest;
|
|
|
190
192
|
/**
|
|
191
193
|
* Filler word content mode:
|
|
192
194
|
* - `static`: Static filler words. Uses a predefined list of filler words.
|
|
193
|
-
* - `generated`: LLM-generated filler words based on
|
|
195
|
+
* - `generated`: LLM-generated filler words based on recent conversation context.
|
|
194
196
|
*/
|
|
195
197
|
Content.Mode = {
|
|
196
198
|
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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.AnamAvatarParams = void 0;
|
|
5
|
+
var AnamAvatarParams;
|
|
6
|
+
(function (AnamAvatarParams) {
|
|
7
|
+
/** The video quality level. */
|
|
8
|
+
AnamAvatarParams.Quality = {
|
|
9
|
+
High: "high",
|
|
10
|
+
Medium: "medium",
|
|
11
|
+
Low: "low",
|
|
12
|
+
};
|
|
13
|
+
/** The video encoding format. */
|
|
14
|
+
AnamAvatarParams.VideoEncoding = {
|
|
15
|
+
H264: "H264",
|
|
16
|
+
Av1: "AV1",
|
|
17
|
+
};
|
|
18
|
+
})(AnamAvatarParams || (exports.AnamAvatarParams = AnamAvatarParams = {}));
|
|
@@ -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.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect;
|
|
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.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect | Agora.Asr.Smallestai;
|
|
3
3
|
export declare namespace Asr {
|
|
4
4
|
interface Ares extends Agora.AresAsr {
|
|
5
5
|
vendor: "ares";
|
|
@@ -49,4 +49,7 @@ export declare namespace Asr {
|
|
|
49
49
|
interface XfyunDialect extends Agora.XfyunDialectAsr {
|
|
50
50
|
vendor: "xfyun_dialect";
|
|
51
51
|
}
|
|
52
|
+
interface Smallestai extends Agora.SmallestAiAsr {
|
|
53
|
+
vendor: "smallestai";
|
|
54
|
+
}
|
|
52
55
|
}
|
|
@@ -6,8 +6,15 @@ import type * as Agora from "../index.js";
|
|
|
6
6
|
export interface LlmTool {
|
|
7
7
|
/** Tool type. Must be `function`. */
|
|
8
8
|
type: "function";
|
|
9
|
+
/** Tool interface exposed to the model. `parameters` is the JSON Schema for LLM arguments, not the HTTP request shape. */
|
|
9
10
|
function: Agora.LlmToolFunction;
|
|
11
|
+
/** Tool execution configuration. Defaults to `{"mode": "sync"}`. Phase 1a only allows `sync`. */
|
|
10
12
|
execution?: Agora.LlmToolExecution;
|
|
13
|
+
/**
|
|
14
|
+
* Actual HTTP request configuration for this REST tool.
|
|
15
|
+
* Does not use top-level `parameters`, `path_params`, standalone `query`,
|
|
16
|
+
* `response`, `json_path`, or `max_chars`.
|
|
17
|
+
*/
|
|
11
18
|
server: Agora.LlmToolServer;
|
|
12
19
|
/** Accepts any additional properties */
|
|
13
20
|
[key: string]: any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface McpServer {
|
|
2
|
+
/** A unique identifier for the MCP server. Maximum 48 characters. Accepts only English letters and numbers. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The endpoint address of the MCP server. The agent uses this to communicate with the MCP server. */
|
|
5
|
+
endpoint: string;
|
|
6
|
+
/**
|
|
7
|
+
* Transport protocol type.
|
|
8
|
+
* - `streamable_http`: Streaming HTTP protocol
|
|
9
|
+
*/
|
|
10
|
+
transport?: "streamable_http";
|
|
11
|
+
/** HTTP header information to include when requesting the MCP server, such as authentication information. */
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
/**
|
|
14
|
+
* A list of tools that the agent is allowed to invoke. The agent can only use tools on this list.
|
|
15
|
+
* - Empty or omitted: All tools are enabled.
|
|
16
|
+
* - Empty array `[]`: No tools are enabled.
|
|
17
|
+
* - `["*"]`: All tools are enabled.
|
|
18
|
+
* - Specific tools `["aa", "bb"]`: Only listed tools are enabled.
|
|
19
|
+
* - Mix with wildcard `["aa", "*"]`: All tools are enabled (wildcard takes precedence).
|
|
20
|
+
*/
|
|
21
|
+
allowed_tools?: string[];
|
|
22
|
+
/** The MCP server request timeout in milliseconds. After timeout, the agent stops waiting for the MCP server's response and continues executing subsequent logic. */
|
|
23
|
+
timeout_ms?: number;
|
|
24
|
+
}
|
|
@@ -28,6 +28,20 @@ export interface Mllm {
|
|
|
28
28
|
greeting_message?: string;
|
|
29
29
|
/** Agent failure message. */
|
|
30
30
|
failure_message?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Inline REST (pass-through sync) tool definitions for standard text LLM function calling.
|
|
33
|
+
* Required fields per tool: `type`, `function.name`, `function.parameters`
|
|
34
|
+
* (`type: object` with `properties`), `server.method` (`GET` or `POST`), and `server.url`.
|
|
35
|
+
* The combination of `type: function` and `server` identifies a REST tool.
|
|
36
|
+
* Phase 1a supports GET and POST only; `execution.mode` defaults to and only accepts `sync`.
|
|
37
|
+
* Template rules:
|
|
38
|
+
* - Values must be a constant, or exactly one single-level placeholder.
|
|
39
|
+
* - `{{args.<name>}}`: `server.url` and `server.body` only; not allowed in headers.
|
|
40
|
+
* - `{{template_variables.<name>}}` and `{{tool_call_id}}`: `server.url`, `server.headers`, and `server.body`.
|
|
41
|
+
*/
|
|
42
|
+
tools?: Agora.LlmTool[];
|
|
43
|
+
/** MCP server configuration. */
|
|
44
|
+
mcp_servers?: Agora.McpServer[];
|
|
31
45
|
/** MLLM provider. */
|
|
32
46
|
vendor?: Mllm.Vendor;
|
|
33
47
|
turn_detection?: Agora.MllmTurnDetection | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type * as Agora from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Smallest AI ASR configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface SmallestAiAsr {
|
|
6
|
+
/** Language code for speech recognition. */
|
|
7
|
+
language?: string;
|
|
8
|
+
params: Agora.SmallestAiAsrParams;
|
|
9
|
+
/** Accepts any additional properties */
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|