agora-agents 2.9.0 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/agentkit/Agent.js +3 -3
  3. package/dist/cjs/agentkit/index.d.ts +8 -10
  4. package/dist/cjs/agentkit/index.js +10 -8
  5. package/dist/cjs/agentkit/preview/client.d.ts +6 -18
  6. package/dist/cjs/agentkit/preview/client.js +17 -84
  7. package/dist/cjs/agentkit/preview/index.d.ts +4 -2
  8. package/dist/cjs/agentkit/preview/index.js +4 -2
  9. package/dist/cjs/agentkit/preview/vendors.d.ts +8 -104
  10. package/dist/cjs/agentkit/preview/vendors.js +14 -115
  11. package/dist/cjs/agentkit/types.d.ts +10 -4
  12. package/dist/cjs/agentkit/vendors/base.d.ts +15 -4
  13. package/dist/cjs/agentkit/vendors/base.js +16 -5
  14. package/dist/cjs/agentkit/vendors/cn.js +2 -2
  15. package/dist/cjs/agentkit/vendors/llm.js +2 -2
  16. package/dist/cjs/agentkit/vendors/mllm.d.ts +92 -10
  17. package/dist/cjs/agentkit/vendors/mllm.js +115 -18
  18. package/dist/cjs/agentkit/vendors/stt.d.ts +41 -0
  19. package/dist/cjs/agentkit/vendors/stt.js +18 -1
  20. package/dist/cjs/agentkit/vendors/tts.d.ts +27 -0
  21. package/dist/cjs/agentkit/vendors/tts.js +16 -1
  22. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +11 -5
  23. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +3 -1
  24. package/dist/cjs/api/types/AnamAvatarParams.d.ts +42 -0
  25. package/dist/cjs/api/types/AnamAvatarParams.js +18 -0
  26. package/dist/cjs/api/types/Asr.d.ts +4 -1
  27. package/dist/cjs/api/types/LlmTool.d.ts +7 -0
  28. package/dist/cjs/api/types/McpServer.d.ts +24 -0
  29. package/dist/cjs/api/types/McpServer.js +3 -0
  30. package/dist/cjs/api/types/Mllm.d.ts +14 -0
  31. package/dist/cjs/api/types/SmallestAiAsr.d.ts +11 -0
  32. package/dist/cjs/api/types/SmallestAiAsr.js +3 -0
  33. package/dist/cjs/api/types/SmallestAiAsrParams.d.ts +49 -0
  34. package/dist/cjs/api/types/SmallestAiAsrParams.js +3 -0
  35. package/dist/cjs/api/types/SmallestAiTts.d.ts +9 -0
  36. package/dist/cjs/api/types/SmallestAiTts.js +3 -0
  37. package/dist/cjs/api/types/SmallestAiTtsParams.d.ts +31 -0
  38. package/dist/cjs/api/types/SmallestAiTtsParams.js +3 -0
  39. package/dist/cjs/api/types/Tts.d.ts +4 -1
  40. package/dist/cjs/api/types/index.d.ts +6 -0
  41. package/dist/cjs/api/types/index.js +6 -0
  42. package/dist/cjs/index.d.ts +2 -2
  43. package/dist/cjs/index.js +6 -3
  44. package/dist/cjs/version.d.ts +1 -1
  45. package/dist/cjs/version.js +1 -1
  46. package/dist/esm/BaseClient.mjs +2 -2
  47. package/dist/esm/agentkit/Agent.mjs +2 -2
  48. package/dist/esm/agentkit/index.d.mts +8 -10
  49. package/dist/esm/agentkit/index.mjs +3 -4
  50. package/dist/esm/agentkit/preview/client.d.mts +6 -18
  51. package/dist/esm/agentkit/preview/client.mjs +17 -84
  52. package/dist/esm/agentkit/preview/index.d.mts +4 -2
  53. package/dist/esm/agentkit/preview/index.mjs +2 -1
  54. package/dist/esm/agentkit/preview/vendors.d.mts +8 -104
  55. package/dist/esm/agentkit/preview/vendors.mjs +5 -112
  56. package/dist/esm/agentkit/types.d.mts +10 -4
  57. package/dist/esm/agentkit/vendors/base.d.mts +15 -4
  58. package/dist/esm/agentkit/vendors/base.mjs +16 -5
  59. package/dist/esm/agentkit/vendors/cn.mjs +2 -2
  60. package/dist/esm/agentkit/vendors/llm.mjs +2 -2
  61. package/dist/esm/agentkit/vendors/mllm.d.mts +92 -10
  62. package/dist/esm/agentkit/vendors/mllm.mjs +111 -16
  63. package/dist/esm/agentkit/vendors/stt.d.mts +41 -0
  64. package/dist/esm/agentkit/vendors/stt.mjs +16 -0
  65. package/dist/esm/agentkit/vendors/tts.d.mts +27 -0
  66. package/dist/esm/agentkit/vendors/tts.mjs +14 -0
  67. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +11 -5
  68. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +3 -1
  69. package/dist/esm/api/types/AnamAvatarParams.d.mts +42 -0
  70. package/dist/esm/api/types/AnamAvatarParams.mjs +15 -0
  71. package/dist/esm/api/types/Asr.d.mts +4 -1
  72. package/dist/esm/api/types/LlmTool.d.mts +7 -0
  73. package/dist/esm/api/types/McpServer.d.mts +24 -0
  74. package/dist/esm/api/types/McpServer.mjs +2 -0
  75. package/dist/esm/api/types/Mllm.d.mts +14 -0
  76. package/dist/esm/api/types/SmallestAiAsr.d.mts +11 -0
  77. package/dist/esm/api/types/SmallestAiAsr.mjs +2 -0
  78. package/dist/esm/api/types/SmallestAiAsrParams.d.mts +49 -0
  79. package/dist/esm/api/types/SmallestAiAsrParams.mjs +2 -0
  80. package/dist/esm/api/types/SmallestAiTts.d.mts +9 -0
  81. package/dist/esm/api/types/SmallestAiTts.mjs +2 -0
  82. package/dist/esm/api/types/SmallestAiTtsParams.d.mts +31 -0
  83. package/dist/esm/api/types/SmallestAiTtsParams.mjs +2 -0
  84. package/dist/esm/api/types/Tts.d.mts +4 -1
  85. package/dist/esm/api/types/index.d.mts +6 -0
  86. package/dist/esm/api/types/index.mjs +6 -0
  87. package/dist/esm/index.d.mts +2 -2
  88. package/dist/esm/index.mjs +2 -2
  89. package/dist/esm/version.d.mts +1 -1
  90. package/dist/esm/version.mjs +1 -1
  91. package/package.json +1 -1
@@ -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, GeminiAsrParams as GeminiAsrParamsType, 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, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, 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";
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, GeminiAsrParams as GeminiAsrParamsType, 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, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, McpServer as McpServerType, 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, SmallestAiAsrParams as SmallestAiAsrParamsType, SmallestAiAsr as SmallestAiAsrType, SmallestAiTtsParams as SmallestAiTtsParamsType, SmallestAiTts as SmallestAiTtsType, 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) */
@@ -90,11 +90,11 @@ export type LlmTool = LlmToolType;
90
90
  export type LlmToolExecution = LlmToolExecutionType;
91
91
  export type LlmToolFunction = LlmToolFunctionType;
92
92
  export type LlmToolServer = LlmToolServerType;
93
- /** MLLM configuration, including preview vendors not present in the generated schema yet. */
93
+ /** MLLM configuration, including production vendors not present in the generated schema yet. */
94
94
  export type MllmConfig = Omit<Mllm, "vendor"> & {
95
95
  vendor?: Mllm.Vendor | "openai_gpt_live";
96
96
  };
97
- /** MLLM wire vendor name, including preview vendors. */
97
+ /** MLLM wire vendor name, including schema compatibility extensions. */
98
98
  export type MllmVendor = Exclude<MllmConfig["vendor"], undefined>;
99
99
  /** Avatar configuration */
100
100
  export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
@@ -228,7 +228,9 @@ export type LlmGreetingConfigs = Llm.GreetingConfigs;
228
228
  /** Greeting broadcast ASR policy: `"merge_reply"` | `"context"` */
229
229
  export type LlmGreetingConfigsMode = Llm.GreetingConfigs.UninterruptibleAsrPolicy;
230
230
  /** MCP server config item (`llm.mcp_servers[]` or `mllm.mcp_servers[]`) */
231
- export type McpServersItem = Record<string, unknown>;
231
+ export type McpServer = McpServerType;
232
+ /** @deprecated Use {@link McpServer}. */
233
+ export type McpServersItem = McpServer & Record<string, unknown>;
232
234
  /** Full agent configuration (alias for StartAgentsRequest.Properties) */
233
235
  export type AgentConfig = StartAgentsRequest.Properties;
234
236
  /** Agent configuration update (for runtime updates) */
@@ -561,6 +563,8 @@ export interface SarvamAsrParams {
561
563
  */
562
564
  export type XAiAsr = XAiAsrType;
563
565
  export type XAiAsrParams = XAiAsrParamsType;
566
+ export type SmallestAiAsr = SmallestAiAsrType;
567
+ export type SmallestAiAsrParams = SmallestAiAsrParamsType;
564
568
  /** Google Gemini STT parameters generated from the API schema. */
565
569
  export type GeminiAsrParams = GeminiAsrParamsType;
566
570
  export type MicrosoftTts = MicrosoftTtsType;
@@ -595,6 +599,8 @@ export type SarvamTts = SarvamTtsType;
595
599
  export type SarvamTtsParams = SarvamTtsParamsType;
596
600
  export type XAiTts = XAiTtsType;
597
601
  export type XAiTtsParams = XAiTtsParamsType;
602
+ export type SmallestAiTts = SmallestAiTtsType;
603
+ export type SmallestAiTtsParams = SmallestAiTtsParamsType;
598
604
  export type TypecastTts = TypecastTtsType;
599
605
  export type TypecastTtsParams = TypecastTtsParamsType;
600
606
  export type SpatiusAvatarParams = SpatiusAvatarParamsType;
@@ -5,7 +5,7 @@
5
5
  * that converts TypeScript-friendly constructor params (camelCase) into the
6
6
  * Agora API format (snake_case).
7
7
  */
8
- import type { AvatarConfig, LlmConfig, LlmGreetingConfigs, LlmTool, McpServersItem, MllmConfig, SttConfig, TtsConfig } from "../types.js";
8
+ import type { AvatarConfig, LlmConfig, LlmGreetingConfigs, LlmTool, McpServer, McpServersItem, MllmConfig, SttConfig, TtsConfig } from "../types.js";
9
9
  /**
10
10
  * Common options shared by all LLM vendor classes.
11
11
  * These map directly to top-level fields on `LlmConfig` that are not
@@ -47,6 +47,13 @@ export interface BaseLlmOptions {
47
47
  /** Inline synchronous REST tools exposed to the LLM for function calling. Requires `withTools(true)`. */
48
48
  tools?: LlmTool[];
49
49
  }
50
+ /** Tool configuration shared by all MLLM vendor helpers. */
51
+ export interface BaseMllmOptions {
52
+ /** MCP servers exposed to the MLLM. Requires `Agent.withTools()`. */
53
+ mcpServers?: McpServer[];
54
+ /** Inline synchronous REST tools exposed to the MLLM. Requires `Agent.withTools()`. */
55
+ tools?: LlmTool[];
56
+ }
50
57
  type VendorScope = "global" | "cn";
51
58
  /**
52
59
  * Standard audio sample rates supported by Agora platform.
@@ -169,7 +176,11 @@ export declare abstract class BaseCNSTT extends ScopedBaseSTT<"cn"> {
169
176
  */
170
177
  declare abstract class ScopedBaseMLLM<TScope extends VendorScope> {
171
178
  readonly areaScope: TScope;
172
- constructor(areaScope: TScope);
179
+ private readonly _mcpServers?;
180
+ private readonly _tools?;
181
+ constructor(areaScope: TScope, options?: BaseMllmOptions);
182
+ protected get mcpServers(): McpServer[] | undefined;
183
+ protected get tools(): LlmTool[] | undefined;
173
184
  /**
174
185
  * Converts the vendor configuration to the Agora API format.
175
186
  */
@@ -177,11 +188,11 @@ declare abstract class ScopedBaseMLLM<TScope extends VendorScope> {
177
188
  }
178
189
  /** Base class for global MLLM vendors. */
179
190
  export declare abstract class BaseMLLM extends ScopedBaseMLLM<"global"> {
180
- constructor();
191
+ constructor(options?: BaseMllmOptions);
181
192
  }
182
193
  /** Base class for Chinese mainland MLLM vendors. */
183
194
  export declare abstract class BaseCNMLLM extends ScopedBaseMLLM<"cn"> {
184
- constructor();
195
+ constructor(options?: BaseMllmOptions);
185
196
  }
186
197
  /**
187
198
  * Base class for Avatar vendors with required sample rate.
@@ -118,21 +118,32 @@ exports.BaseCNSTT = BaseCNSTT;
118
118
  * Base class for MLLM (Multimodal Large Language Model) vendors.
119
119
  */
120
120
  class ScopedBaseMLLM {
121
- constructor(areaScope) {
121
+ constructor(areaScope, options) {
122
122
  this.areaScope = areaScope;
123
+ this._mcpServers = options === null || options === void 0 ? void 0 : options.mcpServers;
124
+ this._tools = options === null || options === void 0 ? void 0 : options.tools;
125
+ }
126
+ get mcpServers() {
127
+ var _a;
128
+ if (!((_a = this._mcpServers) === null || _a === void 0 ? void 0 : _a.length))
129
+ return this._mcpServers;
130
+ return this._mcpServers.map((server) => server.transport ? server : Object.assign(Object.assign({}, server), { transport: "streamable_http" }));
131
+ }
132
+ get tools() {
133
+ return this._tools;
123
134
  }
124
135
  }
125
136
  /** Base class for global MLLM vendors. */
126
137
  class BaseMLLM extends ScopedBaseMLLM {
127
- constructor() {
128
- super("global");
138
+ constructor(options) {
139
+ super("global", options);
129
140
  }
130
141
  }
131
142
  exports.BaseMLLM = BaseMLLM;
132
143
  /** Base class for Chinese mainland MLLM vendors. */
133
144
  class BaseCNMLLM extends ScopedBaseMLLM {
134
- constructor() {
135
- super("cn");
145
+ constructor(options) {
146
+ super("cn", options);
136
147
  }
137
148
  }
138
149
  exports.BaseCNMLLM = BaseCNMLLM;
@@ -229,8 +229,8 @@ class StepFunTTS extends base_js_1.BaseCNTTS {
229
229
  }
230
230
  exports.StepFunTTS = StepFunTTS;
231
231
  function cnLlmConfig(options, vendor) {
232
- var _a;
233
- return Object.assign(Object.assign({ url: options.url }, (options.apiKey && { api_key: options.apiKey })), { params: Object.assign({ model: options.model }, options.params), headers: options.headers, max_history: options.maxHistory, system_messages: options.systemMessages, greeting_message: options.greetingMessage, greeting_audio_url: options.greetingAudioUrl, failure_message: options.failureMessage, input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"], output_modalities: options.outputModalities, style: "openai", vendor, greeting_configs: options.greetingConfigs, template_variables: options.templateVariables, mcp_servers: options.mcpServers, tools: options.tools });
232
+ var _a, _b;
233
+ return Object.assign(Object.assign({ url: options.url }, (options.apiKey && { api_key: options.apiKey })), { params: Object.assign({ model: options.model }, options.params), headers: options.headers, max_history: options.maxHistory, system_messages: options.systemMessages, greeting_message: options.greetingMessage, greeting_audio_url: options.greetingAudioUrl, failure_message: options.failureMessage, input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"], output_modalities: options.outputModalities, style: "openai", vendor, greeting_configs: options.greetingConfigs, template_variables: options.templateVariables, mcp_servers: (_b = options.mcpServers) === null || _b === void 0 ? void 0 : _b.map((server) => server.transport ? server : Object.assign(Object.assign({}, server), { transport: "streamable_http" })), tools: options.tools });
234
234
  }
235
235
  class AliyunLLM extends base_js_1.BaseCNLLM {
236
236
  constructor(options) {
@@ -213,7 +213,7 @@ class Gemini extends base_js_1.BaseLLM {
213
213
  }
214
214
  exports.Gemini = Gemini;
215
215
  function openAIStyleConfig(options, vendor) {
216
- var _a, _b;
216
+ var _a, _b, _c;
217
217
  return {
218
218
  url: options.url,
219
219
  api_key: options.apiKey,
@@ -230,7 +230,7 @@ function openAIStyleConfig(options, vendor) {
230
230
  vendor: (_b = options.vendor) !== null && _b !== void 0 ? _b : vendor,
231
231
  greeting_configs: options.greetingConfigs,
232
232
  template_variables: options.templateVariables,
233
- mcp_servers: options.mcpServers,
233
+ mcp_servers: (_c = options.mcpServers) === null || _c === void 0 ? void 0 : _c.map((server) => server.transport ? server : Object.assign(Object.assign({}, server), { transport: "streamable_http" })),
234
234
  tools: options.tools,
235
235
  };
236
236
  }
@@ -5,13 +5,95 @@
5
5
  * ASR → LLM → TTS pipeline. Calling `agent.withMllm(vendor)` automatically
6
6
  * sets `mllm.enable: true`.
7
7
  */
8
- import type { GeminiThinkingLevel } from "../preview/vendors.js";
9
8
  import type { MllmConfig, MllmTurnDetectionConfig } from "../types.js";
10
- import { BaseCNMLLM, BaseMLLM } from "./base.js";
9
+ import { BaseCNMLLM, BaseMLLM, type BaseMllmOptions } from "./base.js";
10
+ export declare const GeminiLiveModels: {
11
+ /** Public ID for the low-latency voice model. */
12
+ readonly Live38: "models/gemini-3.8-live";
13
+ /** Public ID for the reasoning voice model. */
14
+ readonly Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking";
15
+ };
16
+ /** The model Gemini Live sends by default. */
17
+ export declare const GEMINI_MLLM_DEFAULT_MODEL: string;
18
+ /** Default Gemini Developer API endpoint for Gemini 3.8 models. */
19
+ export declare const GEMINI_MLLM_URL = "https://generativelanguage.googleapis.com";
20
+ /** @deprecated Use {@link GEMINI_MLLM_URL}. */
21
+ export declare const GEMINI_PREVIEW_MLLM_URL: string;
22
+ /** A Gemini Live model. Known models autocomplete while future model IDs remain accepted. */
23
+ export type GeminiLiveModel = (typeof GeminiLiveModels)[keyof typeof GeminiLiveModels] | (string & {});
24
+ /** Reasoning budgets accepted by Gemini Extended Thinking. */
25
+ export declare const GeminiThinkingLevels: readonly ["low", "medium", "high"];
26
+ export type GeminiThinkingLevel = (typeof GeminiThinkingLevels)[number];
27
+ /** Known Gemini output voices; future voice names remain accepted. */
28
+ export type GeminiLiveVoice = "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede" | "Leda" | "Orus" | "Zephyr" | (string & {});
29
+ /** @deprecated Use {@link GeminiLiveVoice}. */
30
+ export type GeminiPreviewVoice = GeminiLiveVoice;
31
+ export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
32
+ export declare function isOpenAIGPTLiveConfig(config: unknown): boolean;
33
+ /** GPT Live v3 options. */
34
+ export interface OpenAIGPTLiveOptions extends BaseMllmOptions {
35
+ apiKey: string;
36
+ /** Full WebSocket URL, used verbatim except OpenAI's legacy /v1/live route. */
37
+ url?: string;
38
+ /** @deprecated Use prompt. Serialized as prompt; an explicit prompt wins. */
39
+ instructions?: string;
40
+ greeting?: string;
41
+ failureMessage?: string;
42
+ inputModalities?: string[];
43
+ outputModalities?: string[];
44
+ messages?: Record<string, unknown>[];
45
+ /** Additional provider fields; explicit options take precedence. */
46
+ params?: Record<string, unknown>;
47
+ /** @deprecated Unsupported in v3; setting this raises an error. */
48
+ inputAudioTranscription?: Record<string, unknown>;
49
+ /** @deprecated Ignored with a warning; v3 performs endpointing internally. */
50
+ turnDetection?: MllmTurnDetectionConfig;
51
+ /** Defaults to gpt-live-1. */
52
+ model?: string;
53
+ /** Output voice; provider default marin. Custom voice objects require PR #1522; use params after rollout. */
54
+ voice?: string;
55
+ /** Session instructions. */
56
+ prompt?: string;
57
+ /** Host when url is omitted; default wss://api.openai.com. */
58
+ baseUrl?: string;
59
+ /** WebSocket path; default /v1/live/sessions. */
60
+ path?: string;
61
+ /** Optional OpenAI-Alpha selector for preview contracts. Omitted by default. */
62
+ alphaSelector?: string;
63
+ /** Extra provider request headers as a JSON string; protocol headers win. */
64
+ headers?: string;
65
+ /** Assistant silence boundary in ms; provider default 600. Zero disables inference. */
66
+ outputIdleEndMs?: number;
67
+ /** Caller silence boundary in ms; provider default 1500. */
68
+ inputIdleEndMs?: number;
69
+ /** Speech amplitude threshold on the 16-bit scale; provider default 50. */
70
+ outputSilencePeak?: number;
71
+ /** Graph PCM sample rate; provider default 24000. */
72
+ outputSampleRate?: number;
73
+ /** Initial audio cushion; provider default 0. Negative disables pacing. */
74
+ outputBufferMs?: number;
75
+ /** Mic append batching in ms. Join default 0; extension class default 100. */
76
+ inputBatchMs?: number;
77
+ /** Advertise graph tools; provider default false. Does not control delegate built-ins. */
78
+ toolEnabled?: boolean;
79
+ /** Tool delegation mode; provider default responses. Fixed for the session. */
80
+ delegation?: "client" | "responses";
81
+ /** Tool delegate model; provider default gpt-5.6-sol. */
82
+ responsesModel?: string;
83
+ /** Interrupt playback on caller speech; provider default false. */
84
+ interruptOnUserTurn?: boolean;
85
+ /** Unmodelled v3 session fields. Cannot override model, delegation, audio, instructions or input. */
86
+ sessionParams?: Record<string, unknown>;
87
+ }
88
+ export declare class OpenAIGPTLive extends BaseMLLM {
89
+ private readonly options;
90
+ constructor(options: OpenAIGPTLiveOptions);
91
+ toConfig(): MllmConfig;
92
+ }
11
93
  /**
12
94
  * Constructor options for OpenAI Realtime API.
13
95
  */
14
- export interface OpenAIRealtimeOptions {
96
+ export interface OpenAIRealtimeOptions extends BaseMllmOptions {
15
97
  /** OpenAI API key */
16
98
  apiKey: string;
17
99
  /** Model name (e.g., 'gpt-4o-realtime-preview') */
@@ -67,7 +149,7 @@ export interface AzureOpenAIRealtimeParams {
67
149
  voice?: string;
68
150
  }
69
151
  /** Constructor options for Azure OpenAI Realtime API. */
70
- export interface AzureOpenAIRealtimeOptions {
152
+ export interface AzureOpenAIRealtimeOptions extends BaseMllmOptions {
71
153
  /** Azure OpenAI API key */
72
154
  apiKey: string;
73
155
  /** Azure OpenAI Realtime WebSocket URL, including deployment routing when required */
@@ -113,11 +195,11 @@ export declare class AzureOpenAIRealtime extends BaseMLLM {
113
195
  /**
114
196
  * Constructor options for Google Gemini Live (direct API, non-Vertex AI).
115
197
  */
116
- export interface GeminiLiveOptions {
198
+ export interface GeminiLiveOptions extends BaseMllmOptions {
117
199
  /** Google API key */
118
200
  apiKey: string;
119
201
  /** Model name (e.g., 'gemini-live-2.5-flash') */
120
- model?: string;
202
+ model?: GeminiLiveModel;
121
203
  /** Sent only for models/gemini-3.8-live-extended-thinking. */
122
204
  thinkingLevel?: GeminiThinkingLevel;
123
205
  /** Languages for Gemini 3.8, sent as params.language_codes. */
@@ -127,7 +209,7 @@ export interface GeminiLiveOptions {
127
209
  /** System instructions for the model */
128
210
  instructions?: string;
129
211
  /** Voice name (e.g., 'Aoede', 'Charon') */
130
- voice?: string;
212
+ voice?: GeminiLiveVoice;
131
213
  affectiveDialog?: boolean;
132
214
  proactiveAudio?: boolean;
133
215
  transcribeAgent?: boolean;
@@ -172,7 +254,7 @@ export declare class GeminiLive extends BaseMLLM {
172
254
  /**
173
255
  * Constructor options for Google Gemini Live (Vertex AI).
174
256
  */
175
- export interface VertexAIOptions {
257
+ export interface VertexAIOptions extends BaseMllmOptions {
176
258
  /** Model name (e.g., 'gemini-live-2.5-flash-preview-native-audio-09-2025') */
177
259
  model: string;
178
260
  /** WebSocket URL for real-time communication */
@@ -233,7 +315,7 @@ export declare class VertexAI extends BaseMLLM {
233
315
  /**
234
316
  * Constructor options for xAI Grok Realtime API.
235
317
  */
236
- export interface XaiGrokOptions {
318
+ export interface XaiGrokOptions extends BaseMllmOptions {
237
319
  /** xAI API key */
238
320
  apiKey: string;
239
321
  /** WebSocket URL for real-time communication (defaults to xAI Realtime API) */
@@ -284,7 +366,7 @@ export declare class XaiGrok extends BaseMLLM {
284
366
  toConfig(): MllmConfig;
285
367
  }
286
368
  /** Constructor options for Alibaba Cloud Qwen Omni Realtime. */
287
- export interface QwenOmniOptions {
369
+ export interface QwenOmniOptions extends BaseMllmOptions {
288
370
  /** Alibaba Cloud DashScope API key */
289
371
  apiKey: string;
290
372
  /** Qwen Omni model identifier */
@@ -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
- const vendors_js_1 = require("../preview/vendors.js");
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 && !vendors_js_1.GeminiThinkingLevels.includes(options.thinkingLevel)) {
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()) || vendors_js_1.GeminiLiveModels.Live38;
117
- if (selectedModel === vendors_js_1.GeminiLiveModels.Live38 || selectedModel === vendors_js_1.GeminiLiveModels.Live38ExtendedThinking) {
118
- return (0, vendors_js_1.buildGeminiPreviewConfig)(this.options);
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 : "", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model: selectedModel }), (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 }));
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 {};