agora-agents 2.0.1 → 2.1.1

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 (228) hide show
  1. package/README.md +38 -9
  2. package/dist/cjs/AgoraPoolClient.js +7 -2
  3. package/dist/cjs/BaseClient.js +2 -2
  4. package/dist/cjs/Client.js +16 -8
  5. package/dist/cjs/agentkit/Agent.d.ts +56 -11
  6. package/dist/cjs/agentkit/Agent.js +114 -15
  7. package/dist/cjs/agentkit/AgentSession.d.ts +4 -3
  8. package/dist/cjs/agentkit/AgentSession.js +39 -10
  9. package/dist/cjs/agentkit/__tests__/type-safety.test.js +23 -3
  10. package/dist/cjs/agentkit/constants.d.ts +5 -4
  11. package/dist/cjs/agentkit/constants.js +5 -4
  12. package/dist/cjs/agentkit/index.d.ts +1 -1
  13. package/dist/cjs/agentkit/presets.d.ts +30 -0
  14. package/dist/cjs/agentkit/presets.js +9 -2
  15. package/dist/cjs/agentkit/types.d.ts +50 -35
  16. package/dist/cjs/agentkit/vendors/avatar.d.ts +3 -1
  17. package/dist/cjs/agentkit/vendors/avatar.js +3 -1
  18. package/dist/cjs/agentkit/vendors/llm.d.ts +18 -8
  19. package/dist/cjs/agentkit/vendors/llm.js +83 -15
  20. package/dist/cjs/agentkit/vendors/mllm.d.ts +16 -0
  21. package/dist/cjs/agentkit/vendors/mllm.js +11 -7
  22. package/dist/cjs/agentkit/vendors/stt.d.ts +29 -11
  23. package/dist/cjs/agentkit/vendors/stt.js +74 -53
  24. package/dist/cjs/agentkit/vendors/tts.d.ts +70 -22
  25. package/dist/cjs/agentkit/vendors/tts.js +67 -34
  26. package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -2
  27. package/dist/cjs/api/resources/agents/client/Client.js +3 -2
  28. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +8 -331
  29. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +0 -107
  30. package/dist/cjs/api/types/AmazonAsr.d.ts +10 -0
  31. package/dist/cjs/api/types/AmazonAsr.js +3 -0
  32. package/dist/cjs/api/types/AmazonAsrParams.d.ts +19 -0
  33. package/dist/cjs/api/types/AmazonAsrParams.js +3 -0
  34. package/dist/cjs/api/types/AmazonTtsParams.d.ts +19 -5
  35. package/dist/cjs/api/types/AmazonTtsParams.js +11 -0
  36. package/dist/cjs/api/types/AresAsr.d.ts +10 -0
  37. package/dist/cjs/api/types/AresAsr.js +3 -0
  38. package/dist/cjs/api/types/AresAsrParams.d.ts +4 -0
  39. package/dist/cjs/api/types/AresAsrParams.js +3 -0
  40. package/dist/cjs/api/types/Asr.d.ts +31 -0
  41. package/dist/cjs/api/types/Asr.js +3 -0
  42. package/dist/cjs/api/types/AsrLanguage.d.ts +36 -0
  43. package/dist/cjs/api/types/AsrLanguage.js +39 -0
  44. package/dist/cjs/api/types/AssemblyAiAsr.d.ts +10 -0
  45. package/dist/cjs/api/types/AssemblyAiAsr.js +3 -0
  46. package/dist/cjs/api/types/AssemblyAiAsrParams.d.ts +13 -0
  47. package/dist/cjs/api/types/AssemblyAiAsrParams.js +3 -0
  48. package/dist/cjs/api/types/CartesiaTtsOutputFormat.d.ts +11 -0
  49. package/dist/cjs/api/types/CartesiaTtsOutputFormat.js +3 -0
  50. package/dist/cjs/api/types/CartesiaTtsParams.d.ts +9 -4
  51. package/dist/cjs/api/types/CartesiaTtsVoice.d.ts +2 -0
  52. package/dist/cjs/api/types/DeepgramAsr.d.ts +12 -0
  53. package/dist/cjs/api/types/DeepgramAsr.js +3 -0
  54. package/dist/cjs/api/types/DeepgramAsrParams.d.ts +17 -0
  55. package/dist/cjs/api/types/DeepgramAsrParams.js +3 -0
  56. package/dist/cjs/api/types/DeepgramTtsParams.d.ts +2 -2
  57. package/dist/cjs/api/types/ElevenLabsTtsParams.d.ts +13 -1
  58. package/dist/cjs/api/types/FishAudioTtsParams.d.ts +5 -1
  59. package/dist/cjs/api/types/GoogleAsr.d.ts +10 -0
  60. package/dist/cjs/api/types/GoogleAsr.js +3 -0
  61. package/dist/cjs/api/types/GoogleAsrParams.d.ts +17 -0
  62. package/dist/cjs/api/types/GoogleAsrParams.js +3 -0
  63. package/dist/cjs/api/types/GoogleTtsAudioConfig.d.ts +11 -0
  64. package/dist/cjs/api/types/GoogleTtsAudioConfig.js +3 -0
  65. package/dist/cjs/api/types/GoogleTtsParams.d.ts +7 -8
  66. package/dist/cjs/api/types/GoogleTtsVoiceSelectionParams.d.ts +9 -0
  67. package/dist/cjs/api/types/GoogleTtsVoiceSelectionParams.js +3 -0
  68. package/dist/cjs/api/types/HumeAiTtsParams.d.ts +21 -1
  69. package/dist/cjs/api/types/HumeAiTtsParams.js +9 -0
  70. package/dist/cjs/api/types/Llm.d.ts +58 -0
  71. package/dist/cjs/api/types/Llm.js +15 -0
  72. package/dist/cjs/api/types/LlmParams.d.ts +11 -0
  73. package/dist/cjs/api/types/LlmParams.js +3 -0
  74. package/dist/cjs/api/types/MicrosoftAsr.d.ts +10 -0
  75. package/dist/cjs/api/types/MicrosoftAsr.js +3 -0
  76. package/dist/cjs/api/types/MicrosoftAsrParams.d.ts +15 -0
  77. package/dist/cjs/api/types/MicrosoftAsrParams.js +3 -0
  78. package/dist/cjs/api/types/MicrosoftTtsParams.d.ts +6 -0
  79. package/dist/cjs/api/types/MinimaxTtsParams.d.ts +4 -0
  80. package/dist/cjs/api/types/Mllm.d.ts +44 -0
  81. package/dist/cjs/api/types/Mllm.js +14 -0
  82. package/dist/cjs/api/types/MllmHttpOptions.d.ts +9 -0
  83. package/dist/cjs/api/types/MllmHttpOptions.js +3 -0
  84. package/dist/cjs/api/types/MllmInputAudioTranscription.d.ts +13 -0
  85. package/dist/cjs/api/types/MllmInputAudioTranscription.js +3 -0
  86. package/dist/cjs/api/types/MllmParams.d.ts +28 -0
  87. package/dist/cjs/api/types/MllmParams.js +3 -0
  88. package/dist/cjs/api/types/MllmTurnDetection.d.ts +65 -0
  89. package/dist/cjs/api/types/MllmTurnDetection.js +33 -0
  90. package/dist/cjs/api/types/MurfTtsParams.d.ts +17 -5
  91. package/dist/cjs/api/types/OpenAiAsr.d.ts +10 -0
  92. package/dist/cjs/api/types/OpenAiAsr.js +3 -0
  93. package/dist/cjs/api/types/OpenAiAsrParams.d.ts +11 -0
  94. package/dist/cjs/api/types/OpenAiAsrParams.js +3 -0
  95. package/dist/cjs/api/types/OpenAiInputAudioTranscription.d.ts +13 -0
  96. package/dist/cjs/api/types/OpenAiInputAudioTranscription.js +3 -0
  97. package/dist/cjs/api/types/OpenAiTtsParams.d.ts +9 -1
  98. package/dist/cjs/api/types/RimeTtsParams.d.ts +7 -3
  99. package/dist/cjs/api/types/SarvamAsr.d.ts +10 -0
  100. package/dist/cjs/api/types/SarvamAsr.js +3 -0
  101. package/dist/cjs/api/types/SarvamAsrParams.d.ts +11 -0
  102. package/dist/cjs/api/types/SarvamAsrParams.js +3 -0
  103. package/dist/cjs/api/types/SarvamTtsParams.d.ts +29 -2
  104. package/dist/cjs/api/types/SarvamTtsParams.js +18 -0
  105. package/dist/cjs/api/types/SpeechmaticsAsr.d.ts +10 -0
  106. package/dist/cjs/api/types/SpeechmaticsAsr.js +3 -0
  107. package/dist/cjs/api/types/SpeechmaticsAsrParams.d.ts +13 -0
  108. package/dist/cjs/api/types/SpeechmaticsAsrParams.js +3 -0
  109. package/dist/cjs/api/types/index.d.ts +31 -0
  110. package/dist/cjs/api/types/index.js +31 -0
  111. package/dist/cjs/core/base64.js +5 -1
  112. package/dist/cjs/index.d.ts +1 -1
  113. package/dist/cjs/version.d.ts +1 -1
  114. package/dist/cjs/version.js +1 -1
  115. package/dist/esm/AgoraPoolClient.mjs +7 -2
  116. package/dist/esm/BaseClient.mjs +2 -2
  117. package/dist/esm/Client.mjs +16 -8
  118. package/dist/esm/agentkit/Agent.d.mts +56 -11
  119. package/dist/esm/agentkit/Agent.mjs +114 -15
  120. package/dist/esm/agentkit/AgentSession.d.mts +4 -3
  121. package/dist/esm/agentkit/AgentSession.mjs +40 -11
  122. package/dist/esm/agentkit/__tests__/type-safety.test.mjs +23 -3
  123. package/dist/esm/agentkit/constants.d.mts +5 -4
  124. package/dist/esm/agentkit/constants.mjs +5 -4
  125. package/dist/esm/agentkit/index.d.mts +1 -1
  126. package/dist/esm/agentkit/presets.d.mts +30 -0
  127. package/dist/esm/agentkit/presets.mjs +9 -6
  128. package/dist/esm/agentkit/types.d.mts +50 -35
  129. package/dist/esm/agentkit/vendors/avatar.d.mts +3 -1
  130. package/dist/esm/agentkit/vendors/avatar.mjs +3 -1
  131. package/dist/esm/agentkit/vendors/llm.d.mts +18 -8
  132. package/dist/esm/agentkit/vendors/llm.mjs +83 -15
  133. package/dist/esm/agentkit/vendors/mllm.d.mts +16 -0
  134. package/dist/esm/agentkit/vendors/mllm.mjs +11 -7
  135. package/dist/esm/agentkit/vendors/stt.d.mts +29 -11
  136. package/dist/esm/agentkit/vendors/stt.mjs +74 -53
  137. package/dist/esm/agentkit/vendors/tts.d.mts +70 -22
  138. package/dist/esm/agentkit/vendors/tts.mjs +67 -34
  139. package/dist/esm/api/resources/agents/client/Client.d.mts +3 -2
  140. package/dist/esm/api/resources/agents/client/Client.mjs +3 -2
  141. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +8 -331
  142. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +0 -107
  143. package/dist/esm/api/types/AmazonAsr.d.mts +10 -0
  144. package/dist/esm/api/types/AmazonAsr.mjs +2 -0
  145. package/dist/esm/api/types/AmazonAsrParams.d.mts +19 -0
  146. package/dist/esm/api/types/AmazonAsrParams.mjs +2 -0
  147. package/dist/esm/api/types/AmazonTtsParams.d.mts +19 -5
  148. package/dist/esm/api/types/AmazonTtsParams.mjs +10 -1
  149. package/dist/esm/api/types/AresAsr.d.mts +10 -0
  150. package/dist/esm/api/types/AresAsr.mjs +2 -0
  151. package/dist/esm/api/types/AresAsrParams.d.mts +4 -0
  152. package/dist/esm/api/types/AresAsrParams.mjs +2 -0
  153. package/dist/esm/api/types/Asr.d.mts +31 -0
  154. package/dist/esm/api/types/Asr.mjs +2 -0
  155. package/dist/esm/api/types/AsrLanguage.d.mts +36 -0
  156. package/dist/esm/api/types/AsrLanguage.mjs +36 -0
  157. package/dist/esm/api/types/AssemblyAiAsr.d.mts +10 -0
  158. package/dist/esm/api/types/AssemblyAiAsr.mjs +2 -0
  159. package/dist/esm/api/types/AssemblyAiAsrParams.d.mts +13 -0
  160. package/dist/esm/api/types/AssemblyAiAsrParams.mjs +2 -0
  161. package/dist/esm/api/types/CartesiaTtsOutputFormat.d.mts +11 -0
  162. package/dist/esm/api/types/CartesiaTtsOutputFormat.mjs +2 -0
  163. package/dist/esm/api/types/CartesiaTtsParams.d.mts +9 -4
  164. package/dist/esm/api/types/CartesiaTtsVoice.d.mts +2 -0
  165. package/dist/esm/api/types/DeepgramAsr.d.mts +12 -0
  166. package/dist/esm/api/types/DeepgramAsr.mjs +2 -0
  167. package/dist/esm/api/types/DeepgramAsrParams.d.mts +17 -0
  168. package/dist/esm/api/types/DeepgramAsrParams.mjs +2 -0
  169. package/dist/esm/api/types/DeepgramTtsParams.d.mts +2 -2
  170. package/dist/esm/api/types/ElevenLabsTtsParams.d.mts +13 -1
  171. package/dist/esm/api/types/FishAudioTtsParams.d.mts +5 -1
  172. package/dist/esm/api/types/GoogleAsr.d.mts +10 -0
  173. package/dist/esm/api/types/GoogleAsr.mjs +2 -0
  174. package/dist/esm/api/types/GoogleAsrParams.d.mts +17 -0
  175. package/dist/esm/api/types/GoogleAsrParams.mjs +2 -0
  176. package/dist/esm/api/types/GoogleTtsAudioConfig.d.mts +11 -0
  177. package/dist/esm/api/types/GoogleTtsAudioConfig.mjs +2 -0
  178. package/dist/esm/api/types/GoogleTtsParams.d.mts +7 -8
  179. package/dist/esm/api/types/GoogleTtsVoiceSelectionParams.d.mts +9 -0
  180. package/dist/esm/api/types/GoogleTtsVoiceSelectionParams.mjs +2 -0
  181. package/dist/esm/api/types/HumeAiTtsParams.d.mts +21 -1
  182. package/dist/esm/api/types/HumeAiTtsParams.mjs +8 -1
  183. package/dist/esm/api/types/Llm.d.mts +58 -0
  184. package/dist/esm/api/types/Llm.mjs +12 -0
  185. package/dist/esm/api/types/LlmParams.d.mts +11 -0
  186. package/dist/esm/api/types/LlmParams.mjs +2 -0
  187. package/dist/esm/api/types/MicrosoftAsr.d.mts +10 -0
  188. package/dist/esm/api/types/MicrosoftAsr.mjs +2 -0
  189. package/dist/esm/api/types/MicrosoftAsrParams.d.mts +15 -0
  190. package/dist/esm/api/types/MicrosoftAsrParams.mjs +2 -0
  191. package/dist/esm/api/types/MicrosoftTtsParams.d.mts +6 -0
  192. package/dist/esm/api/types/MinimaxTtsParams.d.mts +4 -0
  193. package/dist/esm/api/types/Mllm.d.mts +44 -0
  194. package/dist/esm/api/types/Mllm.mjs +11 -0
  195. package/dist/esm/api/types/MllmHttpOptions.d.mts +9 -0
  196. package/dist/esm/api/types/MllmHttpOptions.mjs +2 -0
  197. package/dist/esm/api/types/MllmInputAudioTranscription.d.mts +13 -0
  198. package/dist/esm/api/types/MllmInputAudioTranscription.mjs +2 -0
  199. package/dist/esm/api/types/MllmParams.d.mts +28 -0
  200. package/dist/esm/api/types/MllmParams.mjs +2 -0
  201. package/dist/esm/api/types/MllmTurnDetection.d.mts +65 -0
  202. package/dist/esm/api/types/MllmTurnDetection.mjs +30 -0
  203. package/dist/esm/api/types/MurfTtsParams.d.mts +17 -5
  204. package/dist/esm/api/types/OpenAiAsr.d.mts +10 -0
  205. package/dist/esm/api/types/OpenAiAsr.mjs +2 -0
  206. package/dist/esm/api/types/OpenAiAsrParams.d.mts +11 -0
  207. package/dist/esm/api/types/OpenAiAsrParams.mjs +2 -0
  208. package/dist/esm/api/types/OpenAiInputAudioTranscription.d.mts +13 -0
  209. package/dist/esm/api/types/OpenAiInputAudioTranscription.mjs +2 -0
  210. package/dist/esm/api/types/OpenAiTtsParams.d.mts +9 -1
  211. package/dist/esm/api/types/RimeTtsParams.d.mts +7 -3
  212. package/dist/esm/api/types/SarvamAsr.d.mts +10 -0
  213. package/dist/esm/api/types/SarvamAsr.mjs +2 -0
  214. package/dist/esm/api/types/SarvamAsrParams.d.mts +11 -0
  215. package/dist/esm/api/types/SarvamAsrParams.mjs +2 -0
  216. package/dist/esm/api/types/SarvamTtsParams.d.mts +29 -2
  217. package/dist/esm/api/types/SarvamTtsParams.mjs +17 -1
  218. package/dist/esm/api/types/SpeechmaticsAsr.d.mts +10 -0
  219. package/dist/esm/api/types/SpeechmaticsAsr.mjs +2 -0
  220. package/dist/esm/api/types/SpeechmaticsAsrParams.d.mts +13 -0
  221. package/dist/esm/api/types/SpeechmaticsAsrParams.mjs +2 -0
  222. package/dist/esm/api/types/index.d.mts +31 -0
  223. package/dist/esm/api/types/index.mjs +31 -0
  224. package/dist/esm/core/base64.mjs +5 -1
  225. package/dist/esm/index.d.mts +1 -1
  226. package/dist/esm/version.d.mts +1 -1
  227. package/dist/esm/version.mjs +1 -1
  228. package/package.json +2 -1
@@ -11,7 +11,8 @@ import type * as Agora from "../../../../index.mjs";
11
11
  * remote_rtc_uids: ["1002"],
12
12
  * idle_timeout: 120,
13
13
  * asr: {
14
- * language: "en-US"
14
+ * vendor: "ares",
15
+ * vendor: "ares"
15
16
  * },
16
17
  * tts: {
17
18
  * vendor: "microsoft",
@@ -29,7 +30,7 @@ import type * as Agora from "../../../../index.mjs";
29
30
  * "content": "You are a helpful chatbot."
30
31
  * }],
31
32
  * params: {
32
- * "model": "gpt-4o-mini"
33
+ * model: "gpt-4o-mini"
33
34
  * },
34
35
  * max_history: 32,
35
36
  * greeting_message: "Hello, how can I assist you today?",
@@ -91,13 +92,13 @@ export declare namespace StartAgentsRequest {
91
92
  /** Advanced features configuration. */
92
93
  advanced_features?: Properties.AdvancedFeatures;
93
94
  /** Automatic Speech Recognition (ASR) configuration. */
94
- asr?: Properties.Asr;
95
+ asr?: Agora.Asr;
95
96
  /** Text-to-speech (TTS) module configuration. */
96
97
  tts?: Agora.Tts;
97
98
  /** Large language model (LLM) configuration. */
98
- llm?: Properties.Llm;
99
+ llm?: Agora.Llm;
99
100
  /** Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. `mllm` is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline. */
100
- mllm?: Properties.Mllm;
101
+ mllm?: Agora.Mllm;
101
102
  /** Avatar configuration. */
102
103
  avatar?: Properties.Avatar;
103
104
  /** Conversation turn detection settings. Controls the logic for voice activity detection and conversation turn determination. This object has no effect when `mllm.enable` is true; use `mllm.turn_detection` instead. */
@@ -159,332 +160,6 @@ export declare namespace StartAgentsRequest {
159
160
  /** Enable tool invocation. When enabled, the agent can invoke tools provided by the MCP server to implement advanced functionality. */
160
161
  enable_tools?: boolean;
161
162
  }
162
- /**
163
- * Automatic Speech Recognition (ASR) configuration.
164
- */
165
- interface Asr {
166
- /** The BCP-47 language tag identifying the primary language used for agent interaction. If `params` contains a vendor-specific language code, it takes precedence over this setting. */
167
- language?: string;
168
- /**
169
- * ASR provider:
170
- * - `ares`: Adaptive Recognition Engine for Speech
171
- * - `microsoft`: Microsoft Azure
172
- * - `deepgram`: Deepgram
173
- * - `openai`: OpenAI (Beta)
174
- * - `speechmatics`: Speechmatics
175
- * - `assemblyai`: AssemblyAI (Beta)
176
- * - `amazon`: Amazon Transcribe (Beta)
177
- * - `google`: Google (Beta)
178
- * - `sarvam`: Sarvam (Beta)
179
- */
180
- vendor?: Asr.Vendor;
181
- /** The configuration parameters for the ASR vendor. See [ASR Overview](https://docs.agora.io/en/conversational-ai/models/asr/overview) for details. */
182
- params?: Record<string, unknown>;
183
- }
184
- namespace Asr {
185
- /**
186
- * ASR provider:
187
- * - `ares`: Adaptive Recognition Engine for Speech
188
- * - `microsoft`: Microsoft Azure
189
- * - `deepgram`: Deepgram
190
- * - `openai`: OpenAI (Beta)
191
- * - `speechmatics`: Speechmatics
192
- * - `assemblyai`: AssemblyAI (Beta)
193
- * - `amazon`: Amazon Transcribe (Beta)
194
- * - `google`: Google (Beta)
195
- * - `sarvam`: Sarvam (Beta)
196
- */
197
- const Vendor: {
198
- readonly Ares: "ares";
199
- readonly Microsoft: "microsoft";
200
- readonly Deepgram: "deepgram";
201
- readonly Openai: "openai";
202
- readonly Google: "google";
203
- readonly Amazon: "amazon";
204
- readonly Assemblyai: "assemblyai";
205
- readonly Speechmatics: "speechmatics";
206
- readonly Sarvam: "sarvam";
207
- };
208
- type Vendor = (typeof Vendor)[keyof typeof Vendor];
209
- }
210
- /**
211
- * Large language model (LLM) configuration.
212
- */
213
- interface Llm {
214
- /** The LLM callback address. */
215
- url: string;
216
- /** The LLM verification API key. The default value is an empty string. Ensure that you enable the API key in a production environment. */
217
- api_key?: string;
218
- /** A set of predefined information used as input to the LLM, including prompt words and examples. */
219
- system_messages?: Record<string, unknown>[];
220
- /** Additional LLM configuration parameters, such as the `model` used, and the maximum token limit. For details about each supported LLM, refer to [Supported LLMs](https://docs.agora.io/en/conversational-ai/models/llm/overview#supported-llms). */
221
- params?: Record<string, unknown>;
222
- /** The number of conversation history messages cached in the custom LLM. History includes user and agent dialog messages, tool call information, and timestamps. Agent and user messages are recorded separately. */
223
- max_history?: number;
224
- /**
225
- * LLM input modalities:
226
- * - `["text"]`: Text only
227
- * - `["text", "image"]`: Text plus image. Recommended configuration, requires the selected LLM to support visual input
228
- */
229
- input_modalities?: string[];
230
- /**
231
- * LLM output modalities:
232
- * - `["text"]`: The output text is converted to speech by the TTS module and then published to the RTC channel.
233
- * - `["audio"]`: Voice only. Voice is published directly to the RTC channel.
234
- * - `["text", "audio"]`: Text plus voice. Write your own logic to process the output of LLM as needed.
235
- */
236
- output_modalities?: string[];
237
- /** Agent greeting. If provided, the first user in the channel is automatically greeted with the message upon joining. */
238
- greeting_message?: string;
239
- /** Prompt for agent activation failure. If provided, it is returned through TTS when the custom LLM call fails. */
240
- failure_message?: string;
241
- /**
242
- * LLM provider, supports the following settings:
243
- * - `custom`: Custom LLM. When you set this option, the agent includes the following fields, in addition to `role` and `content` when making requests to the custom LLM:
244
- * - `turn_id`: A unique identifier for each conversation turn. It starts from `0` and increments with each turn. One user-agent interaction corresponds to one `turn_id`.
245
- * - `timestamp`: The request timestamp, in milliseconds.
246
- * - `azure`: Use this value for Azure OpenAI
247
- */
248
- vendor?: string;
249
- /**
250
- * The request style for chat completion:
251
- * - `openai`: For OpenAI and OpenAI-compatible APIs
252
- * - `gemini`: For Google Gemini and Google Vertex API format
253
- * - `anthropic`: For Anthropic Claude API format
254
- * - `dify`: For Dify API format
255
- */
256
- style?: Llm.Style;
257
- /** Agent greeting broadcast configuration. */
258
- greeting_configs?: Llm.GreetingConfigs;
259
- /** Template parameter configuration used to insert variables into the agent's `system_messages`, `greeting_message`, `failure_message`, and `parameters.silence_config.content` text. Uses key-value pairs, where the key is the variable name and the value is the variable's value. To insert defined variables in the prompt text, use the syntax `{{variable_name}}`. The system automatically replaces each variable with the corresponding value defined in `template_variables`. Variable values cannot reference other variables. */
260
- template_variables?: Record<string, string>;
261
- /** MCP (Model Context Protocol) server configuration. By configuring MCP servers, agents can call tools provided by external services to implement advanced functionality. */
262
- mcp_servers?: Llm.McpServers.Item[];
263
- /** Custom headers to include in requests to the LLM. Use this field to pass business-specific information such as custom fields or tenant identifiers. These headers are merged with the headers generated by the Conversational AI Engine. If a key conflict occurs, the engine-generated header takes precedence. */
264
- headers?: Record<string, string>;
265
- }
266
- namespace Llm {
267
- /**
268
- * The request style for chat completion:
269
- * - `openai`: For OpenAI and OpenAI-compatible APIs
270
- * - `gemini`: For Google Gemini and Google Vertex API format
271
- * - `anthropic`: For Anthropic Claude API format
272
- * - `dify`: For Dify API format
273
- */
274
- const Style: {
275
- readonly Openai: "openai";
276
- readonly Gemini: "gemini";
277
- readonly Anthropic: "anthropic";
278
- readonly Dify: "dify";
279
- };
280
- type Style = (typeof Style)[keyof typeof Style];
281
- /**
282
- * Agent greeting broadcast configuration.
283
- */
284
- interface GreetingConfigs {
285
- /**
286
- * Determines when the agent sends greeting messages to users joining the channel.
287
- * - `single_every`: Broadcasts a greeting every time a user joins the channel.
288
- * - `single_first`: Broadcasts a greeting only once to the first user who joins the channel.
289
- */
290
- mode?: GreetingConfigs.Mode;
291
- /** The delay in milliseconds before the agent plays the greeting message after a user joins the channel. */
292
- delay_ms?: number;
293
- /**
294
- * - `true`: Follows the global `interruption` configuration.
295
- * - `false`: Uninterruptible. The greeting plays in its entirety. If the user speaks multiple times while the greeting plays, the system merges the speech segments after the greeting ends and sends them to the LLM for a single response.
296
- */
297
- interruptable?: boolean;
298
- }
299
- namespace GreetingConfigs {
300
- /**
301
- * Determines when the agent sends greeting messages to users joining the channel.
302
- * - `single_every`: Broadcasts a greeting every time a user joins the channel.
303
- * - `single_first`: Broadcasts a greeting only once to the first user who joins the channel.
304
- */
305
- const Mode: {
306
- readonly SingleEvery: "single_every";
307
- readonly SingleFirst: "single_first";
308
- };
309
- type Mode = (typeof Mode)[keyof typeof Mode];
310
- }
311
- type McpServers = McpServers.Item[];
312
- namespace McpServers {
313
- interface Item {
314
- /** A unique identifier for the MCP server. Maximum 48 characters. Accepts only English letters and numbers. */
315
- name: string;
316
- /** The endpoint address of the MCP server. The agent uses this to communicate with the MCP server. */
317
- endpoint: string;
318
- /**
319
- * Transport protocol type.
320
- * - `streamable_http`: Streaming HTTP protocol
321
- */
322
- transport?: "streamable_http";
323
- /** HTTP header information to include when requesting the MCP server, such as authentication information. */
324
- headers?: Record<string, string>;
325
- /**
326
- * A list of tools that the agent is allowed to invoke. The agent can only use tools on this list.
327
- * - Empty or omitted: All tools are enabled.
328
- * - Empty array `[]`: No tools are enabled.
329
- * - `["*"]`: All tools are enabled.
330
- * - Specific tools `["aa", "bb"]`: Only listed tools are enabled.
331
- * - Mix with wildcard `["aa", "*"]`: All tools are enabled (wildcard takes precedence).
332
- */
333
- allowed_tools?: string[];
334
- /** The MCP server request timeout in milliseconds. After timeout, the agent stops waiting for the MCP server's response and continues executing subsequent logic. */
335
- timeout_ms?: number;
336
- }
337
- }
338
- }
339
- /**
340
- * Multimodal Large Language Model (MLLM) configuration for real-time audio and text processing. `mllm` is an exclusive alternative to the standard `asr` + `llm` + `tts` pipeline.
341
- */
342
- interface Mllm {
343
- /** Enable Multimodal Large Language Model for voice-to-voice processing. Enabling MLLM automatically disables ASR, LLM, and TTS since the MLLM handles end-to-end voice processing directly. Replaces the deprecated `advanced_features.enable_mllm`. */
344
- enable?: boolean;
345
- /** The MLLM WebSocket URL for real-time communication. */
346
- url?: string;
347
- /** The API key used for MLLM authentication. */
348
- api_key?: string;
349
- /** Array of conversation items used for short-term memory management. Uses the same structure as `item.content` from the OpenAI Realtime API. */
350
- messages?: Record<string, unknown>[];
351
- /** Additional MLLM configuration parameters. The `modalities` setting is overridden by `input_modalities` and `output_modalities`. The `turn_detection` setting is overridden by `mllm.turn_detection`. */
352
- params?: Record<string, unknown>;
353
- /**
354
- * MLLM input modalities:
355
- * - `["audio"]`: Audio only
356
- * - `["audio", "text"]`: Audio plus text
357
- */
358
- input_modalities?: string[];
359
- /**
360
- * MLLM output modalities:
361
- * - `["text", "audio"]`: Text plus audio
362
- */
363
- output_modalities?: string[];
364
- /** Agent greeting message. If provided, the first user in the channel is automatically greeted with this message upon joining. */
365
- greeting_message?: string;
366
- /** Agent failure message. If provided, the agent speaks this message when an MLLM request fails. */
367
- failure_message?: string;
368
- /**
369
- * MLLM provider. Currently supports:
370
- * - `openai`: OpenAI Realtime API
371
- * - `gemini`: Google Gemini Live
372
- * - `vertexai`: Google Gemini Live (Vertex AI)
373
- * - `xai`: xAI Grok Realtime API
374
- */
375
- vendor?: Mllm.Vendor;
376
- /** Turn detection configuration for the MLLM module. When defined, the top-level `turn_detection` object has no effect. */
377
- turn_detection?: Mllm.TurnDetection;
378
- }
379
- namespace Mllm {
380
- /**
381
- * MLLM provider. Currently supports:
382
- * - `openai`: OpenAI Realtime API
383
- * - `gemini`: Google Gemini Live
384
- * - `vertexai`: Google Gemini Live (Vertex AI)
385
- * - `xai`: xAI Grok Realtime API
386
- */
387
- const Vendor: {
388
- readonly Openai: "openai";
389
- readonly Gemini: "gemini";
390
- readonly Vertexai: "vertexai";
391
- readonly Xai: "xai";
392
- };
393
- type Vendor = (typeof Vendor)[keyof typeof Vendor];
394
- /**
395
- * Turn detection configuration for the MLLM module. When defined, the top-level `turn_detection` object has no effect.
396
- */
397
- interface TurnDetection {
398
- /**
399
- * Turn detection mode for MLLM:
400
- * - `agora_vad`: Agora VAD-based detection.
401
- * - `server_vad`: Vendor-side VAD-based detection. Supported by OpenAI Realtime API, Gemini Live, and xAI Grok.
402
- * - `semantic_vad`: Semantic-based detection. Supported by OpenAI Realtime API only.
403
- */
404
- mode?: TurnDetection.Mode;
405
- /** Configuration for Agora VAD-based turn detection. Applicable when `mode` is `agora_vad`. */
406
- agora_vad_config?: TurnDetection.AgoraVadConfig;
407
- /** Configuration for vendor-side VAD-based turn detection. Applicable when `mode` is `server_vad`. Parameters are passed through to the vendor. */
408
- server_vad_config?: TurnDetection.ServerVadConfig;
409
- /** Configuration for semantic-based turn detection. Applicable when `mode` is `semantic_vad`. Supported by OpenAI Realtime API only. */
410
- semantic_vad_config?: TurnDetection.SemanticVadConfig;
411
- }
412
- namespace TurnDetection {
413
- /**
414
- * Turn detection mode for MLLM:
415
- * - `agora_vad`: Agora VAD-based detection.
416
- * - `server_vad`: Vendor-side VAD-based detection. Supported by OpenAI Realtime API, Gemini Live, and xAI Grok.
417
- * - `semantic_vad`: Semantic-based detection. Supported by OpenAI Realtime API only.
418
- */
419
- const Mode: {
420
- readonly AgoraVad: "agora_vad";
421
- readonly ServerVad: "server_vad";
422
- readonly SemanticVad: "semantic_vad";
423
- };
424
- type Mode = (typeof Mode)[keyof typeof Mode];
425
- /**
426
- * Configuration for Agora VAD-based turn detection. Applicable when `mode` is `agora_vad`.
427
- */
428
- interface AgoraVadConfig {
429
- /** Minimum duration of speech in milliseconds required to trigger an interruption. */
430
- interrupt_duration_ms?: number;
431
- /** Duration of audio in milliseconds to include before the detected speech start. */
432
- prefix_padding_ms?: number;
433
- /** Duration of silence in milliseconds required to determine end of speech. */
434
- silence_duration_ms?: number;
435
- /** VAD sensitivity threshold. A higher value reduces false positives. */
436
- threshold?: number;
437
- }
438
- /**
439
- * Configuration for vendor-side VAD-based turn detection. Applicable when `mode` is `server_vad`. Parameters are passed through to the vendor.
440
- */
441
- interface ServerVadConfig {
442
- /** Duration of audio in milliseconds to include before the detected speech start. */
443
- prefix_padding_ms?: number;
444
- /** Duration of silence in milliseconds required to determine end of speech. */
445
- silence_duration_ms?: number;
446
- /** VAD sensitivity threshold. Applicable to OpenAI Realtime API and xAI Grok. */
447
- threshold?: number;
448
- /** Idle timeout in milliseconds. Applicable to OpenAI Realtime API only. */
449
- idle_timeout_ms?: number;
450
- /** Sensitivity for start of speech detection. Applicable to Gemini Live only. */
451
- start_of_speech_sensitivity?: ServerVadConfig.StartOfSpeechSensitivity;
452
- /** Sensitivity for end of speech detection. Applicable to Gemini Live only. */
453
- end_of_speech_sensitivity?: ServerVadConfig.EndOfSpeechSensitivity;
454
- }
455
- namespace ServerVadConfig {
456
- /** Sensitivity for start of speech detection. Applicable to Gemini Live only. */
457
- const StartOfSpeechSensitivity: {
458
- readonly StartSensitivityHigh: "START_SENSITIVITY_HIGH";
459
- readonly StartSensitivityLow: "START_SENSITIVITY_LOW";
460
- };
461
- type StartOfSpeechSensitivity = (typeof StartOfSpeechSensitivity)[keyof typeof StartOfSpeechSensitivity];
462
- /** Sensitivity for end of speech detection. Applicable to Gemini Live only. */
463
- const EndOfSpeechSensitivity: {
464
- readonly EndSensitivityHigh: "END_SENSITIVITY_HIGH";
465
- readonly EndSensitivityLow: "END_SENSITIVITY_LOW";
466
- };
467
- type EndOfSpeechSensitivity = (typeof EndOfSpeechSensitivity)[keyof typeof EndOfSpeechSensitivity];
468
- }
469
- /**
470
- * Configuration for semantic-based turn detection. Applicable when `mode` is `semantic_vad`. Supported by OpenAI Realtime API only.
471
- */
472
- interface SemanticVadConfig {
473
- /** Controls how eagerly the model ends its turn. */
474
- eagerness?: SemanticVadConfig.Eagerness;
475
- }
476
- namespace SemanticVadConfig {
477
- /** Controls how eagerly the model ends its turn. */
478
- const Eagerness: {
479
- readonly Auto: "auto";
480
- readonly Low: "low";
481
- readonly Medium: "medium";
482
- readonly High: "high";
483
- };
484
- type Eagerness = (typeof Eagerness)[keyof typeof Eagerness];
485
- }
486
- }
487
- }
488
163
  /**
489
164
  * Avatar configuration.
490
165
  */
@@ -529,6 +204,8 @@ export declare namespace StartAgentsRequest {
529
204
  * Conversation turn detection settings. Controls the logic for voice activity detection and conversation turn determination. This object has no effect when `mllm.enable` is true; use `mllm.turn_detection` instead.
530
205
  */
531
206
  interface TurnDetection {
207
+ /** BCP-47 language tag identifying the primary language used for agent interaction. */
208
+ language?: Agora.AsrLanguage;
532
209
  /**
533
210
  * Conversation turn detection mode:
534
211
  * - `default`: Uses standard conversation turn detection configuration.
@@ -23,113 +23,6 @@ export var StartAgentsRequest;
23
23
  Japan: "JAPAN",
24
24
  };
25
25
  })(Geofence = Properties.Geofence || (Properties.Geofence = {}));
26
- let Asr;
27
- (function (Asr) {
28
- /**
29
- * ASR provider:
30
- * - `ares`: Adaptive Recognition Engine for Speech
31
- * - `microsoft`: Microsoft Azure
32
- * - `deepgram`: Deepgram
33
- * - `openai`: OpenAI (Beta)
34
- * - `speechmatics`: Speechmatics
35
- * - `assemblyai`: AssemblyAI (Beta)
36
- * - `amazon`: Amazon Transcribe (Beta)
37
- * - `google`: Google (Beta)
38
- * - `sarvam`: Sarvam (Beta)
39
- */
40
- Asr.Vendor = {
41
- Ares: "ares",
42
- Microsoft: "microsoft",
43
- Deepgram: "deepgram",
44
- Openai: "openai",
45
- Google: "google",
46
- Amazon: "amazon",
47
- Assemblyai: "assemblyai",
48
- Speechmatics: "speechmatics",
49
- Sarvam: "sarvam",
50
- };
51
- })(Asr = Properties.Asr || (Properties.Asr = {}));
52
- let Llm;
53
- (function (Llm) {
54
- /**
55
- * The request style for chat completion:
56
- * - `openai`: For OpenAI and OpenAI-compatible APIs
57
- * - `gemini`: For Google Gemini and Google Vertex API format
58
- * - `anthropic`: For Anthropic Claude API format
59
- * - `dify`: For Dify API format
60
- */
61
- Llm.Style = {
62
- Openai: "openai",
63
- Gemini: "gemini",
64
- Anthropic: "anthropic",
65
- Dify: "dify",
66
- };
67
- let GreetingConfigs;
68
- (function (GreetingConfigs) {
69
- /**
70
- * Determines when the agent sends greeting messages to users joining the channel.
71
- * - `single_every`: Broadcasts a greeting every time a user joins the channel.
72
- * - `single_first`: Broadcasts a greeting only once to the first user who joins the channel.
73
- */
74
- GreetingConfigs.Mode = {
75
- SingleEvery: "single_every",
76
- SingleFirst: "single_first",
77
- };
78
- })(GreetingConfigs = Llm.GreetingConfigs || (Llm.GreetingConfigs = {}));
79
- })(Llm = Properties.Llm || (Properties.Llm = {}));
80
- let Mllm;
81
- (function (Mllm) {
82
- /**
83
- * MLLM provider. Currently supports:
84
- * - `openai`: OpenAI Realtime API
85
- * - `gemini`: Google Gemini Live
86
- * - `vertexai`: Google Gemini Live (Vertex AI)
87
- * - `xai`: xAI Grok Realtime API
88
- */
89
- Mllm.Vendor = {
90
- Openai: "openai",
91
- Gemini: "gemini",
92
- Vertexai: "vertexai",
93
- Xai: "xai",
94
- };
95
- let TurnDetection;
96
- (function (TurnDetection) {
97
- /**
98
- * Turn detection mode for MLLM:
99
- * - `agora_vad`: Agora VAD-based detection.
100
- * - `server_vad`: Vendor-side VAD-based detection. Supported by OpenAI Realtime API, Gemini Live, and xAI Grok.
101
- * - `semantic_vad`: Semantic-based detection. Supported by OpenAI Realtime API only.
102
- */
103
- TurnDetection.Mode = {
104
- AgoraVad: "agora_vad",
105
- ServerVad: "server_vad",
106
- SemanticVad: "semantic_vad",
107
- };
108
- let ServerVadConfig;
109
- (function (ServerVadConfig) {
110
- /** Sensitivity for start of speech detection. Applicable to Gemini Live only. */
111
- ServerVadConfig.StartOfSpeechSensitivity = {
112
- StartSensitivityHigh: "START_SENSITIVITY_HIGH",
113
- StartSensitivityLow: "START_SENSITIVITY_LOW",
114
- };
115
- /** Sensitivity for end of speech detection. Applicable to Gemini Live only. */
116
- ServerVadConfig.EndOfSpeechSensitivity = {
117
- EndSensitivityHigh: "END_SENSITIVITY_HIGH",
118
- EndSensitivityLow: "END_SENSITIVITY_LOW",
119
- };
120
- })(ServerVadConfig = TurnDetection.ServerVadConfig || (TurnDetection.ServerVadConfig = {}));
121
- let SemanticVadConfig;
122
- (function (SemanticVadConfig) {
123
- /** Controls how eagerly the model ends its turn. */
124
- SemanticVadConfig.Eagerness = {
125
- Auto: "auto",
126
- Low: "low",
127
- Medium: "medium",
128
- High: "high",
129
- };
130
- })(SemanticVadConfig = TurnDetection.SemanticVadConfig || (TurnDetection.SemanticVadConfig = {}));
131
- })(TurnDetection = Mllm.TurnDetection || (Mllm.TurnDetection = {}));
132
- })(Mllm = Properties.Mllm || (Properties.Mllm = {}));
133
26
  let Avatar;
134
27
  (function (Avatar) {
135
28
  /**
@@ -0,0 +1,10 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Amazon Transcribe ASR configuration.
4
+ */
5
+ export interface AmazonAsr {
6
+ language?: Agora.AsrLanguage;
7
+ params: Agora.AmazonAsrParams;
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Amazon Transcribe ASR configuration parameters.
3
+ */
4
+ export interface AmazonAsrParams {
5
+ /** AWS region */
6
+ region: string;
7
+ /** AWS access key ID */
8
+ access_key_id: string;
9
+ /** AWS secret access key */
10
+ secret_access_key: string;
11
+ /** Language code for speech recognition */
12
+ language_code: string;
13
+ /** Sample rate in Hertz for the audio input */
14
+ media_sample_rate_hz?: number | null;
15
+ /** Encoding format of the audio input */
16
+ media_encoding?: string | null;
17
+ /** Accepts any additional properties */
18
+ [key: string]: any;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,12 +2,26 @@
2
2
  * Amazon Polly TTS configuration parameters.
3
3
  */
4
4
  export interface AmazonTtsParams {
5
- /** AWS access key */
6
- access_key: string;
5
+ /** AWS access key ID */
6
+ aws_access_key_id: string;
7
7
  /** AWS secret key */
8
- secret_key: string;
8
+ aws_secret_access_key: string;
9
9
  /** AWS region (e.g., "us-east-1") */
10
- region: string;
10
+ region_name: string;
11
11
  /** Amazon Polly voice ID */
12
- voice_id: string;
12
+ voice: string;
13
+ /** Amazon Polly engine type */
14
+ engine: AmazonTtsParams.Engine;
15
+ /** Accepts any additional properties */
16
+ [key: string]: any;
17
+ }
18
+ export declare namespace AmazonTtsParams {
19
+ /** Amazon Polly engine type */
20
+ const Engine: {
21
+ readonly Standard: "standard";
22
+ readonly Neural: "neural";
23
+ readonly LongForm: "long-form";
24
+ readonly Generative: "generative";
25
+ };
26
+ type Engine = (typeof Engine)[keyof typeof Engine];
13
27
  }
@@ -1,2 +1,11 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var AmazonTtsParams;
3
+ (function (AmazonTtsParams) {
4
+ /** Amazon Polly engine type */
5
+ AmazonTtsParams.Engine = {
6
+ Standard: "standard",
7
+ Neural: "neural",
8
+ LongForm: "long-form",
9
+ Generative: "generative",
10
+ };
11
+ })(AmazonTtsParams || (AmazonTtsParams = {}));
@@ -0,0 +1,10 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Adaptive Recognition Engine for Speech ASR configuration.
4
+ */
5
+ export interface AresAsr {
6
+ language?: Agora.AsrLanguage;
7
+ params?: Agora.AresAsrParams;
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * ARES ASR configuration parameters.
3
+ */
4
+ export type AresAsrParams = Record<string, unknown>;
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,31 @@
1
+ import type * as Agora from "../index.mjs";
2
+ export type Asr = Agora.Asr.Ares | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam;
3
+ export declare namespace Asr {
4
+ interface Ares extends Agora.AresAsr {
5
+ vendor: "ares";
6
+ }
7
+ interface Microsoft extends Agora.MicrosoftAsr {
8
+ vendor: "microsoft";
9
+ }
10
+ interface Deepgram extends Agora.DeepgramAsr {
11
+ vendor: "deepgram";
12
+ }
13
+ interface Openai extends Agora.OpenAiAsr {
14
+ vendor: "openai";
15
+ }
16
+ interface Google extends Agora.GoogleAsr {
17
+ vendor: "google";
18
+ }
19
+ interface Amazon extends Agora.AmazonAsr {
20
+ vendor: "amazon";
21
+ }
22
+ interface Assemblyai extends Agora.AssemblyAiAsr {
23
+ vendor: "assemblyai";
24
+ }
25
+ interface Speechmatics extends Agora.SpeechmaticsAsr {
26
+ vendor: "speechmatics";
27
+ }
28
+ interface Sarvam extends Agora.SarvamAsr {
29
+ vendor: "sarvam";
30
+ }
31
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};