agora-agents 2.5.0 → 2.6.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.
Files changed (75) hide show
  1. package/dist/cjs/AgoraPoolClient.js +39 -1
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/agentkit/Agent.d.ts +4 -4
  4. package/dist/cjs/agentkit/Agent.js +2 -1
  5. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +26 -0
  6. package/dist/cjs/agentkit/index.d.ts +8 -8
  7. package/dist/cjs/agentkit/index.js +6 -2
  8. package/dist/cjs/agentkit/region-vendors.d.ts +3 -1
  9. package/dist/cjs/agentkit/types.d.ts +5 -3
  10. package/dist/cjs/agentkit/vendors/base.d.ts +11 -1
  11. package/dist/cjs/agentkit/vendors/base.js +18 -2
  12. package/dist/cjs/agentkit/vendors/cn.d.ts +8 -0
  13. package/dist/cjs/agentkit/vendors/cn.js +9 -3
  14. package/dist/cjs/agentkit/vendors/mllm.d.ts +99 -1
  15. package/dist/cjs/agentkit/vendors/mllm.js +68 -1
  16. package/dist/cjs/agentkit/vendors/stt.d.ts +3 -1
  17. package/dist/cjs/agentkit/vendors/stt.js +7 -4
  18. package/dist/cjs/agentkit/vendors/tts.d.ts +19 -0
  19. package/dist/cjs/agentkit/vendors/tts.js +16 -1
  20. package/dist/cjs/api/types/AresAsrParams.d.ts +6 -1
  21. package/dist/cjs/api/types/AssemblyAiAsrParams.d.ts +1 -1
  22. package/dist/cjs/api/types/FengmingAsr.d.ts +1 -2
  23. package/dist/cjs/api/types/FengmingAsrParams.d.ts +9 -0
  24. package/dist/cjs/api/types/FengmingAsrParams.js +3 -0
  25. package/dist/cjs/api/types/Mllm.d.ts +4 -0
  26. package/dist/cjs/api/types/Mllm.js +2 -0
  27. package/dist/cjs/api/types/Tts.d.ts +4 -1
  28. package/dist/cjs/api/types/TypecastTts.d.ts +9 -0
  29. package/dist/cjs/api/types/TypecastTts.js +3 -0
  30. package/dist/cjs/api/types/TypecastTtsParams.d.ts +13 -0
  31. package/dist/cjs/api/types/TypecastTtsParams.js +3 -0
  32. package/dist/cjs/api/types/index.d.ts +3 -0
  33. package/dist/cjs/api/types/index.js +3 -0
  34. package/dist/cjs/index.d.ts +2 -2
  35. package/dist/cjs/index.js +7 -3
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/AgoraPoolClient.mjs +40 -2
  39. package/dist/esm/BaseClient.mjs +2 -2
  40. package/dist/esm/agentkit/Agent.d.mts +4 -4
  41. package/dist/esm/agentkit/Agent.mjs +2 -1
  42. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +26 -0
  43. package/dist/esm/agentkit/index.d.mts +8 -8
  44. package/dist/esm/agentkit/index.mjs +3 -3
  45. package/dist/esm/agentkit/region-vendors.d.mts +3 -1
  46. package/dist/esm/agentkit/types.d.mts +5 -3
  47. package/dist/esm/agentkit/vendors/base.d.mts +11 -1
  48. package/dist/esm/agentkit/vendors/base.mjs +16 -1
  49. package/dist/esm/agentkit/vendors/cn.d.mts +8 -0
  50. package/dist/esm/agentkit/vendors/cn.mjs +9 -3
  51. package/dist/esm/agentkit/vendors/mllm.d.mts +99 -1
  52. package/dist/esm/agentkit/vendors/mllm.mjs +66 -1
  53. package/dist/esm/agentkit/vendors/stt.d.mts +3 -1
  54. package/dist/esm/agentkit/vendors/stt.mjs +7 -4
  55. package/dist/esm/agentkit/vendors/tts.d.mts +19 -0
  56. package/dist/esm/agentkit/vendors/tts.mjs +14 -0
  57. package/dist/esm/api/types/AresAsrParams.d.mts +6 -1
  58. package/dist/esm/api/types/AssemblyAiAsrParams.d.mts +1 -1
  59. package/dist/esm/api/types/FengmingAsr.d.mts +1 -2
  60. package/dist/esm/api/types/FengmingAsrParams.d.mts +9 -0
  61. package/dist/esm/api/types/FengmingAsrParams.mjs +2 -0
  62. package/dist/esm/api/types/Mllm.d.mts +4 -0
  63. package/dist/esm/api/types/Mllm.mjs +2 -0
  64. package/dist/esm/api/types/Tts.d.mts +4 -1
  65. package/dist/esm/api/types/TypecastTts.d.mts +9 -0
  66. package/dist/esm/api/types/TypecastTts.mjs +2 -0
  67. package/dist/esm/api/types/TypecastTtsParams.d.mts +13 -0
  68. package/dist/esm/api/types/TypecastTtsParams.mjs +2 -0
  69. package/dist/esm/api/types/index.d.mts +3 -0
  70. package/dist/esm/api/types/index.mjs +3 -0
  71. package/dist/esm/index.d.mts +2 -2
  72. package/dist/esm/index.mjs +3 -3
  73. package/dist/esm/version.d.mts +1 -1
  74. package/dist/esm/version.mjs +1 -1
  75. package/package.json +1 -1
@@ -26,6 +26,44 @@ const token_js_1 = require("./agentkit/token.js");
26
26
  const Client_js_1 = require("./Client.js");
27
27
  const index_js_1 = require("./core/domain/index.js");
28
28
  const index_js_2 = require("./errors/index.js");
29
+ const API_BASE_URL_ENV = "AGORA_AGENTS_API_BASE_URL";
30
+ function getConfiguredApiBaseUrl() {
31
+ var _a;
32
+ const baseUrl = (_a = process.env[API_BASE_URL_ENV]) === null || _a === void 0 ? void 0 : _a.trim();
33
+ return baseUrl || undefined;
34
+ }
35
+ function buildApiUrl(baseUrl, area) {
36
+ let parsedUrl;
37
+ try {
38
+ parsedUrl = new URL(baseUrl);
39
+ }
40
+ catch (error) {
41
+ const message = error instanceof Error ? error.message : String(error);
42
+ throw new Error(`invalid ${API_BASE_URL_ENV}: ${message}`);
43
+ }
44
+ const apiPath = area === index_js_1.Area.CN ? index_js_1.CNAPIPath : index_js_1.GlobalAPIPath;
45
+ parsedUrl.pathname = `${parsedUrl.pathname.replace(/\/+$/, "")}${apiPath}`;
46
+ return parsedUrl.toString();
47
+ }
48
+ class ConfiguredBaseUrlPool extends index_js_1.Pool {
49
+ constructor(area, configuredBaseUrl) {
50
+ super(area);
51
+ this.configuredBaseUrl = configuredBaseUrl;
52
+ }
53
+ selectBestDomain(_signal) {
54
+ return Promise.resolve();
55
+ }
56
+ nextRegion() {
57
+ // Configured endpoints intentionally do not participate in regional failover.
58
+ }
59
+ getCurrentURL() {
60
+ return this.configuredBaseUrl;
61
+ }
62
+ }
63
+ function createClientPool(area) {
64
+ const configuredBaseUrl = getConfiguredApiBaseUrl();
65
+ return configuredBaseUrl ? new ConfiguredBaseUrlPool(area, buildApiUrl(configuredBaseUrl, area)) : new index_js_1.Pool(area);
66
+ }
29
67
  /**
30
68
  * AgoraClient extends the base client with domain pool support for
31
69
  * regional URL cycling and automatic domain selection.
@@ -65,7 +103,7 @@ const index_js_2 = require("./errors/index.js");
65
103
  */
66
104
  class AgoraClient extends Client_js_1.AgoraClient {
67
105
  constructor(options) {
68
- const pool = new index_js_1.Pool(options.area);
106
+ const pool = createClientPool(options.area);
69
107
  let authMode;
70
108
  let username;
71
109
  let password;
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
41
41
  const headers = (0, headers_js_1.mergeHeaders)({
42
42
  "X-Fern-Language": "JavaScript",
43
43
  "X-Fern-SDK-Name": "agora-agents",
44
- "X-Fern-SDK-Version": "v2.5.0",
45
- "User-Agent": "agora-agents/v2.5.0",
44
+ "X-Fern-SDK-Version": "v2.6.0",
45
+ "User-Agent": "agora-agents/v2.6.0",
46
46
  "X-Fern-Runtime": core.RUNTIME.type,
47
47
  "X-Fern-Runtime-Version": core.RUNTIME.version,
48
48
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -9,9 +9,8 @@ import type { AgoraClient } from "../AgoraPoolClient.js";
9
9
  import type * as Agora from "../api/index.js";
10
10
  import { AgentSession } from "./AgentSession.js";
11
11
  import type { AgoraArea } from "./area.js";
12
- import type { AvatarVendor, LlmVendor, SttVendor, TtsVendor } from "./region-vendors.js";
12
+ import type { AvatarVendor, CNMllmVendor, GlobalMllmVendor, LlmVendor, SttVendor, TtsVendor } from "./region-vendors.js";
13
13
  import type { AdvancedFeatures, AvatarConfig, FillerWordsConfig, GeofenceConfig, InterruptionConfig, Labels, LlmConfig, LlmGreetingConfigs, MllmConfig, ParametersAudioScenario, RtcConfig, SalConfig, SessionOptions, SessionParamsInput, SttConfig, TtsConfig, TurnDetectionConfig } from "./types.js";
14
- import type { BaseMLLM } from "./vendors/base.js";
15
14
  /**
16
15
  * Configuration options for creating an Agent.
17
16
  *
@@ -166,7 +165,7 @@ export declare class Agent<TTSSampleRate extends number = number, TArea extends
166
165
  *
167
166
  * @param vendor - MLLM vendor instance (e.g., new VertexAI({ model: '...', projectId: '...', ... }))
168
167
  */
169
- withMllm(vendor: BaseMLLM): Agent<TTSSampleRate, TArea>;
168
+ withMllm(vendor: GlobalMllmVendor | CNMllmVendor): Agent<TTSSampleRate, TArea>;
170
169
  /**
171
170
  * Returns a new Agent with the specified Avatar vendor.
172
171
  *
@@ -270,7 +269,8 @@ export declare class Agent<TTSSampleRate extends number = number, TArea extends
270
269
  withFailureMessage(message: string): Agent<TTSSampleRate, TArea>;
271
270
  /**
272
271
  * Returns a new Agent with the specified maximum conversation history length.
273
- * Applies to the standard LLM pipeline only; the v2.7 MLLM core schema has no max_history field.
272
+ * Applies to the standard LLM pipeline only. For Azure OpenAI Realtime MLLM,
273
+ * configure `maxHistory` on the MLLM vendor instead.
274
274
  *
275
275
  * @deprecated Configure max history on the LLM vendor instead.
276
276
  */
@@ -345,7 +345,8 @@ class Agent {
345
345
  }
346
346
  /**
347
347
  * Returns a new Agent with the specified maximum conversation history length.
348
- * Applies to the standard LLM pipeline only; the v2.7 MLLM core schema has no max_history field.
348
+ * Applies to the standard LLM pipeline only. For Azure OpenAI Realtime MLLM,
349
+ * configure `maxHistory` on the MLLM vendor instead.
349
350
  *
350
351
  * @deprecated Configure max history on the LLM vendor instead.
351
352
  */
@@ -5,6 +5,7 @@ const index_js_1 = require("../../core/domain/index.js");
5
5
  const Agent_js_1 = require("../Agent.js");
6
6
  const cn_js_1 = require("../vendors/cn.js");
7
7
  const llm_js_1 = require("../vendors/llm.js");
8
+ const mllm_js_1 = require("../vendors/mllm.js");
8
9
  const stt_js_1 = require("../vendors/stt.js");
9
10
  const tts_js_1 = require("../vendors/tts.js");
10
11
  const client = new AgoraPoolClient_js_1.AgoraClient({
@@ -28,6 +29,19 @@ new Agent_js_1.Agent({ client }).withLlm(new cn_js_1.AliyunLLM({ url: "https://d
28
29
  new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
29
30
  const globalGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.com/v1/audio/speech" });
30
31
  new Agent_js_1.Agent({ client }).withTts(globalGenericTts);
32
+ const globalMllm = new mllm_js_1.AzureOpenAIRealtime({
33
+ apiKey: "azure-key",
34
+ url: "wss://example.openai.azure.com/openai/realtime",
35
+ turnDetection: { mode: "server_vad" },
36
+ });
37
+ new Agent_js_1.Agent({ client }).withMllm(globalMllm);
38
+ // @ts-expect-error Qwen Omni is a Chinese mainland MLLM vendor.
39
+ const _invalidGlobalMllm = new mllm_js_1.QwenOmni({
40
+ apiKey: "key",
41
+ model: "qwen3.5-omni-plus-realtime",
42
+ url: "wss://dashscope.aliyuncs.com/api-ws/v1/realtime",
43
+ turnDetection: { mode: "server_vad" },
44
+ });
31
45
  {
32
46
  const client = new AgoraPoolClient_js_1.AgoraClient({
33
47
  area: index_js_1.Area.CN,
@@ -57,5 +71,17 @@ new Agent_js_1.Agent({ client }).withTts(globalGenericTts);
57
71
  new Agent_js_1.Agent({ client }).withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
58
72
  const cnGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.cn/v1/audio/speech" });
59
73
  new Agent_js_1.Agent({ client }).withTts(cnGenericTts);
74
+ const cnMllm = new mllm_js_1.QwenOmni({
75
+ apiKey: "key",
76
+ model: "qwen3.5-omni-plus-realtime",
77
+ url: "wss://dashscope.aliyuncs.com/api-ws/v1/realtime",
78
+ });
79
+ new Agent_js_1.Agent({ client }).withMllm(cnMllm);
80
+ // @ts-expect-error Azure OpenAI Realtime is a global MLLM vendor.
81
+ const _invalidCnMllm = new mllm_js_1.AzureOpenAIRealtime({
82
+ apiKey: "azure-key",
83
+ url: "wss://example.openai.azure.com/openai/realtime",
84
+ turnDetection: { mode: "server_vad" },
85
+ });
60
86
  }
61
87
  new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
@@ -28,21 +28,21 @@ export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isH
28
28
  export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.js";
29
29
  export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPresetModel, OpenAIPresetModel, OpenAITtsPresetModel, PresetCategory, PresetInput, TtsPreset, } from "./presets.js";
30
30
  export { AgentPresets, normalizePresetInput } from "./presets.js";
31
- export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
31
+ export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
32
32
  export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
33
33
  export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
34
- export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
34
+ export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
35
35
  export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
36
36
  export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
37
37
  export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
38
- export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
39
- export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
38
+ export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
39
+ export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, FengmingSTTOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
40
40
  export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
41
41
  export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
42
42
  export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
43
- export type { GeminiLiveOptions, OpenAIRealtimeOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
44
- export { GeminiLive, OpenAIRealtime, VertexAI, XaiGrok, } from "./vendors/mllm.js";
43
+ export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
44
+ export { AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.js";
45
45
  export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
46
46
  export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
47
- export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
48
- export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.js";
47
+ export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
48
+ export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
@@ -21,8 +21,8 @@
21
21
  */
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.normalizePresetInput = exports.AgentPresets = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SilenceActionValues = exports.SalModeValues = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.Geofence = exports.FillerWordsSelectionRule = exports.DataChannel = exports.CredentialMode = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
24
- exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.OpenAIRealtime = exports.GeminiLive = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = void 0;
25
- exports.XAiTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = void 0;
24
+ exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = void 0;
25
+ exports.XAiTTS = exports.TypecastTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = void 0;
26
26
  // Core classes
27
27
  var Agent_js_1 = require("./Agent.js");
28
28
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
@@ -92,6 +92,7 @@ var base_js_1 = require("./vendors/base.js");
92
92
  Object.defineProperty(exports, "BaseAvatar", { enumerable: true, get: function () { return base_js_1.BaseAvatar; } });
93
93
  Object.defineProperty(exports, "BaseCNAvatar", { enumerable: true, get: function () { return base_js_1.BaseCNAvatar; } });
94
94
  Object.defineProperty(exports, "BaseCNLLM", { enumerable: true, get: function () { return base_js_1.BaseCNLLM; } });
95
+ Object.defineProperty(exports, "BaseCNMLLM", { enumerable: true, get: function () { return base_js_1.BaseCNMLLM; } });
95
96
  Object.defineProperty(exports, "BaseCNSTT", { enumerable: true, get: function () { return base_js_1.BaseCNSTT; } });
96
97
  Object.defineProperty(exports, "BaseCNTTS", { enumerable: true, get: function () { return base_js_1.BaseCNTTS; } });
97
98
  Object.defineProperty(exports, "BaseLLM", { enumerable: true, get: function () { return base_js_1.BaseLLM; } });
@@ -131,8 +132,10 @@ Object.defineProperty(exports, "OpenAI", { enumerable: true, get: function () {
131
132
  Object.defineProperty(exports, "VertexAILLM", { enumerable: true, get: function () { return llm_js_1.VertexAILLM; } });
132
133
  // MLLM vendor classes
133
134
  var mllm_js_1 = require("./vendors/mllm.js");
135
+ Object.defineProperty(exports, "AzureOpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.AzureOpenAIRealtime; } });
134
136
  Object.defineProperty(exports, "GeminiLive", { enumerable: true, get: function () { return mllm_js_1.GeminiLive; } });
135
137
  Object.defineProperty(exports, "OpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.OpenAIRealtime; } });
138
+ Object.defineProperty(exports, "QwenOmni", { enumerable: true, get: function () { return mllm_js_1.QwenOmni; } });
136
139
  Object.defineProperty(exports, "VertexAI", { enumerable: true, get: function () { return mllm_js_1.VertexAI; } });
137
140
  Object.defineProperty(exports, "XaiGrok", { enumerable: true, get: function () { return mllm_js_1.XaiGrok; } });
138
141
  // STT vendor classes
@@ -165,4 +168,5 @@ Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () {
165
168
  Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
166
169
  Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
167
170
  Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
171
+ Object.defineProperty(exports, "TypecastTTS", { enumerable: true, get: function () { return tts_js_1.TypecastTTS; } });
168
172
  Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
@@ -1,4 +1,4 @@
1
- import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseSTT, BaseTTS } from "./vendors/base.js";
1
+ import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS } from "./vendors/base.js";
2
2
  import type { MicrosoftCNSampleRate, MicrosoftCNSTT, MicrosoftCNTTS } from "./vendors/cn.js";
3
3
  import type { CustomLLM } from "./vendors/llm.js";
4
4
  import type { GenericTTS } from "./vendors/tts.js";
@@ -6,10 +6,12 @@ export type GlobalLlmVendor = BaseLLM;
6
6
  export type GlobalTtsVendor<SR extends number = number> = BaseTTS<SR>;
7
7
  export type GlobalSttVendor = BaseSTT;
8
8
  export type GlobalAvatarVendor<SR extends number = number> = BaseAvatar<SR>;
9
+ export type GlobalMllmVendor = BaseMLLM;
9
10
  export type CNLlmVendor = BaseCNLLM | CustomLLM;
10
11
  export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | GenericTTS | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
11
12
  export type CNSttVendor = BaseCNSTT | MicrosoftCNSTT;
12
13
  export type CNAvatarVendor<SR extends number = number> = BaseCNAvatar<SR>;
14
+ export type CNMllmVendor = BaseCNMLLM;
13
15
  export type LlmVendor = GlobalLlmVendor | CNLlmVendor;
14
16
  export type TtsVendor<SR extends number = number> = GlobalTtsVendor<SR> | CNTtsVendor<SR>;
15
17
  export type SttVendor = GlobalSttVendor | CNSttVendor;
@@ -2,7 +2,7 @@
2
2
  * Clean type aliases for the Agora Conversational AI SDK.
3
3
  * These provide shorter, more intuitive names for the verbose Fern-generated types.
4
4
  */
5
- import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } from "../api/index.js";
5
+ import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, TypecastTtsParams as TypecastTtsParamsType, TypecastTts as TypecastTtsType, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } from "../api/index.js";
6
6
  import type { AgentThinkAgentManagementRequest } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.js";
7
7
  import type { PresetInput } from "./presets.js";
8
8
  /** LLM request style (openai, gemini, anthropic, dify) */
@@ -81,7 +81,7 @@ export type AsrVendorName = string;
81
81
  export type TtsConfig = Tts;
82
82
  /** MLLM (Multimodal LLM) configuration */
83
83
  export type MllmConfig = Mllm;
84
- /** MLLM vendor (openai, gemini, vertexai, xai) */
84
+ /** MLLM wire vendor name (openai, azure, gemini, vertexai, xai, qwen_omni) */
85
85
  export type MllmVendor = Mllm.Vendor;
86
86
  /** Avatar configuration */
87
87
  export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
@@ -510,7 +510,7 @@ export interface AssemblyAiParams {
510
510
  /** Language code */
511
511
  language?: string;
512
512
  /** AssemblyAI streaming WebSocket URL */
513
- uri?: string;
513
+ ws_url?: string;
514
514
  /** Additional AssemblyAI-specific parameters */
515
515
  [key: string]: unknown;
516
516
  }
@@ -572,5 +572,7 @@ export type SarvamTts = SarvamTtsType;
572
572
  export type SarvamTtsParams = SarvamTtsParamsType;
573
573
  export type XAiTts = XAiTtsType;
574
574
  export type XAiTtsParams = XAiTtsParamsType;
575
+ export type TypecastTts = TypecastTtsType;
576
+ export type TypecastTtsParams = TypecastTtsParamsType;
575
577
  export type SpatiusAvatarParams = SpatiusAvatarParamsType;
576
578
  export {};
@@ -163,12 +163,22 @@ export declare abstract class BaseCNSTT extends ScopedBaseSTT<"cn"> {
163
163
  /**
164
164
  * Base class for MLLM (Multimodal Large Language Model) vendors.
165
165
  */
166
- export declare abstract class BaseMLLM {
166
+ declare abstract class ScopedBaseMLLM<TScope extends VendorScope> {
167
+ readonly areaScope: TScope;
168
+ constructor(areaScope: TScope);
167
169
  /**
168
170
  * Converts the vendor configuration to the Agora API format.
169
171
  */
170
172
  abstract toConfig(): MllmConfig;
171
173
  }
174
+ /** Base class for global MLLM vendors. */
175
+ export declare abstract class BaseMLLM extends ScopedBaseMLLM<"global"> {
176
+ constructor();
177
+ }
178
+ /** Base class for Chinese mainland MLLM vendors. */
179
+ export declare abstract class BaseCNMLLM extends ScopedBaseMLLM<"cn"> {
180
+ constructor();
181
+ }
172
182
  /**
173
183
  * Base class for Avatar vendors with required sample rate.
174
184
  * @template RequiredSR - Required sample rate literal type
@@ -7,7 +7,7 @@
7
7
  * Agora API format (snake_case).
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.BaseCNAvatar = exports.BaseAvatar = exports.BaseMLLM = exports.BaseCNSTT = exports.BaseSTT = exports.BaseCNTTS = exports.BaseTTS = exports.BaseCNLLM = exports.BaseLLM = void 0;
10
+ exports.BaseCNAvatar = exports.BaseAvatar = exports.BaseCNMLLM = exports.BaseMLLM = exports.BaseCNSTT = exports.BaseSTT = exports.BaseCNTTS = exports.BaseTTS = exports.BaseCNLLM = exports.BaseLLM = void 0;
11
11
  /**
12
12
  * Base class for LLM (Large Language Model) vendors.
13
13
  */
@@ -113,9 +113,25 @@ exports.BaseCNSTT = BaseCNSTT;
113
113
  /**
114
114
  * Base class for MLLM (Multimodal Large Language Model) vendors.
115
115
  */
116
- class BaseMLLM {
116
+ class ScopedBaseMLLM {
117
+ constructor(areaScope) {
118
+ this.areaScope = areaScope;
119
+ }
120
+ }
121
+ /** Base class for global MLLM vendors. */
122
+ class BaseMLLM extends ScopedBaseMLLM {
123
+ constructor() {
124
+ super("global");
125
+ }
117
126
  }
118
127
  exports.BaseMLLM = BaseMLLM;
128
+ /** Base class for Chinese mainland MLLM vendors. */
129
+ class BaseCNMLLM extends ScopedBaseMLLM {
130
+ constructor() {
131
+ super("cn");
132
+ }
133
+ }
134
+ exports.BaseCNMLLM = BaseCNMLLM;
119
135
  /**
120
136
  * Base class for Avatar vendors with required sample rate.
121
137
  * @template RequiredSR - Required sample rate literal type
@@ -1,6 +1,14 @@
1
1
  import type { AvatarConfig, LlmConfig, SttConfig, TtsConfig } from "../types.js";
2
2
  import { BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, type BaseLlmOptions } from "./base.js";
3
+ export interface FengmingSTTOptions {
4
+ /** Hotwords that improve recognition accuracy */
5
+ keywords?: string[];
6
+ /** Additional vendor-specific parameters */
7
+ additionalParams?: Record<string, unknown>;
8
+ }
3
9
  export declare class FengmingSTT extends BaseCNSTT {
10
+ private readonly options;
11
+ constructor(options?: FengmingSTTOptions);
4
12
  toConfig(): SttConfig;
5
13
  }
6
14
  export interface MicrosoftCNSTTOptions {
@@ -8,10 +8,16 @@ function requireString(value, field, vendor) {
8
8
  }
9
9
  }
10
10
  class FengmingSTT extends base_js_1.BaseCNSTT {
11
+ constructor(options = {}) {
12
+ super();
13
+ this.options = options;
14
+ }
11
15
  toConfig() {
12
- return {
13
- vendor: "fengming",
14
- };
16
+ const { keywords, additionalParams } = this.options;
17
+ const hasParams = keywords !== undefined || (additionalParams !== undefined && Object.keys(additionalParams).length > 0);
18
+ return Object.assign({ vendor: "fengming" }, (hasParams && {
19
+ params: Object.assign(Object.assign({}, additionalParams), (keywords !== undefined && { keywords })),
20
+ }));
15
21
  }
16
22
  }
17
23
  exports.FengmingSTT = FengmingSTT;
@@ -6,7 +6,7 @@
6
6
  * sets `mllm.enable: true`.
7
7
  */
8
8
  import type { MllmConfig, MllmTurnDetectionConfig } from "../types.js";
9
- import { BaseMLLM } from "./base.js";
9
+ import { BaseCNMLLM, BaseMLLM } from "./base.js";
10
10
  /**
11
11
  * Constructor options for OpenAI Realtime API.
12
12
  */
@@ -56,6 +56,59 @@ export declare class OpenAIRealtime extends BaseMLLM {
56
56
  constructor(options: OpenAIRealtimeOptions);
57
57
  toConfig(): MllmConfig;
58
58
  }
59
+ /** Parameters accepted by Azure OpenAI Realtime. */
60
+ export interface AzureOpenAIRealtimeParams {
61
+ /** System instructions that define agent behavior */
62
+ instructions?: string;
63
+ /** Model or deployment model identifier */
64
+ model?: string;
65
+ /** Voice identifier for audio output */
66
+ voice?: string;
67
+ }
68
+ /** Constructor options for Azure OpenAI Realtime API. */
69
+ export interface AzureOpenAIRealtimeOptions {
70
+ /** Azure OpenAI API key */
71
+ apiKey: string;
72
+ /** Azure OpenAI Realtime WebSocket URL, including deployment routing when required */
73
+ url: string;
74
+ /** Model or deployment model identifier */
75
+ model?: string;
76
+ /** Voice identifier for audio output */
77
+ voice?: string;
78
+ /** System instructions that define agent behavior */
79
+ instructions?: string;
80
+ /** Number of conversation history messages cached by the MLLM */
81
+ maxHistory?: number;
82
+ /** Agent greeting message */
83
+ greetingMessage?: string;
84
+ /** Output modalities (e.g., ['text', 'audio']) */
85
+ outputModalities?: string[];
86
+ /** Conversation messages for short-term memory */
87
+ messages?: Record<string, unknown>[];
88
+ /** Azure Realtime model parameters */
89
+ params?: AzureOpenAIRealtimeParams;
90
+ /** Required MLLM turn detection configuration. Overrides top-level turn_detection. */
91
+ turnDetection: MllmTurnDetectionConfig;
92
+ }
93
+ /**
94
+ * Azure OpenAI Realtime MLLM vendor for global deployments.
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const agent = new Agent({ client }).withMllm(new AzureOpenAIRealtime({
99
+ * apiKey: process.env.AZURE_OPENAI_API_KEY,
100
+ * url: 'wss://example.openai.azure.com/openai/realtime',
101
+ * model: 'gpt-4o-realtime-preview',
102
+ * maxHistory: 32,
103
+ * turnDetection: { mode: 'server_vad' },
104
+ * }));
105
+ * ```
106
+ */
107
+ export declare class AzureOpenAIRealtime extends BaseMLLM {
108
+ private readonly options;
109
+ constructor(options: AzureOpenAIRealtimeOptions);
110
+ toConfig(): MllmConfig;
111
+ }
59
112
  /**
60
113
  * Constructor options for Google Gemini Live (direct API, non-Vertex AI).
61
114
  */
@@ -225,3 +278,48 @@ export declare class XaiGrok extends BaseMLLM {
225
278
  constructor(options: XaiGrokOptions);
226
279
  toConfig(): MllmConfig;
227
280
  }
281
+ /** Constructor options for Alibaba Cloud Qwen Omni Realtime. */
282
+ export interface QwenOmniOptions {
283
+ /** Alibaba Cloud DashScope API key */
284
+ apiKey: string;
285
+ /** Qwen Omni model identifier */
286
+ model: string;
287
+ /** Qwen Omni Realtime WebSocket URL */
288
+ url: string;
289
+ /** Voice identifier for audio output */
290
+ voice?: string;
291
+ /** System instructions that define agent behavior */
292
+ instructions?: string;
293
+ /** Agent greeting message */
294
+ greetingMessage?: string;
295
+ /** Message played on failure */
296
+ failureMessage?: string;
297
+ /** Input modalities (e.g., ['audio'], ['audio', 'text']) */
298
+ inputModalities?: string[];
299
+ /** Output modalities (e.g., ['text', 'audio']) */
300
+ outputModalities?: string[];
301
+ /** Conversation messages for short-term memory */
302
+ messages?: Record<string, unknown>[];
303
+ /** Additional Qwen Omni parameters */
304
+ params?: Record<string, unknown>;
305
+ /** MLLM turn detection configuration. Overrides top-level turn_detection. */
306
+ turnDetection?: MllmTurnDetectionConfig;
307
+ }
308
+ /**
309
+ * Alibaba Cloud Qwen Omni Realtime MLLM vendor for Chinese mainland deployments.
310
+ *
311
+ * @example
312
+ * ```typescript
313
+ * const agent = new Agent({ client }).withMllm(new QwenOmni({
314
+ * apiKey: process.env.DASHSCOPE_API_KEY,
315
+ * model: 'qwen3.5-omni-plus-realtime',
316
+ * url: 'wss://dashscope.aliyuncs.com/api-ws/v1/realtime',
317
+ * greetingMessage: '你好,有什么可以帮你?',
318
+ * }));
319
+ * ```
320
+ */
321
+ export declare class QwenOmni extends BaseCNMLLM {
322
+ private readonly options;
323
+ constructor(options: QwenOmniOptions);
324
+ toConfig(): MllmConfig;
325
+ }
@@ -7,8 +7,18 @@
7
7
  * sets `mllm.enable: true`.
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.XaiGrok = exports.VertexAI = exports.GeminiLive = exports.OpenAIRealtime = void 0;
10
+ exports.QwenOmni = exports.XaiGrok = exports.VertexAI = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.OpenAIRealtime = void 0;
11
11
  const base_js_1 = require("./base.js");
12
+ function requireString(value, field, vendor) {
13
+ if (typeof value !== "string" || value.length === 0) {
14
+ throw new Error(`${vendor} requires ${field}`);
15
+ }
16
+ }
17
+ function requireObject(value, field, vendor) {
18
+ if (value == null || typeof value !== "object" || Array.isArray(value)) {
19
+ throw new Error(`${vendor} requires ${field}`);
20
+ }
21
+ }
12
22
  /**
13
23
  * OpenAI Realtime API MLLM vendor.
14
24
  *
@@ -43,6 +53,36 @@ class OpenAIRealtime extends base_js_1.BaseMLLM {
43
53
  }
44
54
  }
45
55
  exports.OpenAIRealtime = OpenAIRealtime;
56
+ /**
57
+ * Azure OpenAI Realtime MLLM vendor for global deployments.
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * const agent = new Agent({ client }).withMllm(new AzureOpenAIRealtime({
62
+ * apiKey: process.env.AZURE_OPENAI_API_KEY,
63
+ * url: 'wss://example.openai.azure.com/openai/realtime',
64
+ * model: 'gpt-4o-realtime-preview',
65
+ * maxHistory: 32,
66
+ * turnDetection: { mode: 'server_vad' },
67
+ * }));
68
+ * ```
69
+ */
70
+ class AzureOpenAIRealtime extends base_js_1.BaseMLLM {
71
+ constructor(options) {
72
+ super();
73
+ requireString(options.apiKey, "apiKey", "AzureOpenAIRealtime");
74
+ requireString(options.url, "url", "AzureOpenAIRealtime");
75
+ requireObject(options.turnDetection, "turnDetection", "AzureOpenAIRealtime");
76
+ this.options = options;
77
+ }
78
+ toConfig() {
79
+ const { apiKey, url, model, voice, instructions, maxHistory, greetingMessage, outputModalities, messages, params, turnDetection, } = this.options;
80
+ 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 }));
81
+ const hasParams = Object.keys(mergedParams).length > 0;
82
+ 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 });
83
+ }
84
+ }
85
+ exports.AzureOpenAIRealtime = AzureOpenAIRealtime;
46
86
  /**
47
87
  * Google Gemini Live MLLM vendor (direct API, non-Vertex AI).
48
88
  *
@@ -132,3 +172,30 @@ class XaiGrok extends base_js_1.BaseMLLM {
132
172
  }
133
173
  }
134
174
  exports.XaiGrok = XaiGrok;
175
+ /**
176
+ * Alibaba Cloud Qwen Omni Realtime MLLM vendor for Chinese mainland deployments.
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * const agent = new Agent({ client }).withMllm(new QwenOmni({
181
+ * apiKey: process.env.DASHSCOPE_API_KEY,
182
+ * model: 'qwen3.5-omni-plus-realtime',
183
+ * url: 'wss://dashscope.aliyuncs.com/api-ws/v1/realtime',
184
+ * greetingMessage: '你好,有什么可以帮你?',
185
+ * }));
186
+ * ```
187
+ */
188
+ class QwenOmni extends base_js_1.BaseCNMLLM {
189
+ constructor(options) {
190
+ super();
191
+ requireString(options.apiKey, "apiKey", "QwenOmni");
192
+ requireString(options.model, "model", "QwenOmni");
193
+ requireString(options.url, "url", "QwenOmni");
194
+ this.options = options;
195
+ }
196
+ toConfig() {
197
+ const { apiKey, model, url, voice, instructions, greetingMessage, failureMessage, inputModalities, outputModalities, messages, params, turnDetection, } = this.options;
198
+ 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 }));
199
+ }
200
+ }
201
+ exports.QwenOmni = QwenOmni;
@@ -216,7 +216,7 @@ export interface AssemblyAISTTOptions {
216
216
  /** Language code */
217
217
  language: string;
218
218
  /** AssemblyAI streaming WebSocket URL */
219
- uri?: string;
219
+ ws_url?: string;
220
220
  /** Additional vendor-specific parameters */
221
221
  additionalParams?: Record<string, unknown>;
222
222
  }
@@ -240,6 +240,8 @@ export declare class AssemblyAISTT extends BaseSTT {
240
240
  * Constructor options for Agora ARES STT.
241
241
  */
242
242
  export interface AresSTTOptions {
243
+ /** Hotwords that improve recognition accuracy */
244
+ keywords?: string[];
243
245
  /** Additional vendor-specific parameters */
244
246
  additionalParams?: Record<string, unknown>;
245
247
  }