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
@@ -26,6 +26,7 @@ function _validExample1() {
26
26
  key: "test",
27
27
  modelId: "eleven_flash_v2_5",
28
28
  voiceId: "test",
29
+ baseUrl: "wss://api.elevenlabs.io/v1",
29
30
  sampleRate: 24000,
30
31
  }))
31
32
  .withAvatar(new LiveAvatarAvatar({
@@ -41,6 +42,7 @@ function _validExample2() {
41
42
  key: "test",
42
43
  modelId: "eleven_flash_v2_5",
43
44
  voiceId: "test",
45
+ baseUrl: "wss://api.elevenlabs.io/v1",
44
46
  sampleRate: 16000,
45
47
  }))
46
48
  .withAvatar(new AkoolAvatar({
@@ -68,6 +70,8 @@ function _validExample4() {
68
70
  .withTts(new OpenAITTS({
69
71
  apiKey: "test",
70
72
  voice: "alloy",
73
+ model: "gpt-4o-mini-tts",
74
+ baseUrl: "https://api.openai.com/v1",
71
75
  }))
72
76
  .withAvatar(new LiveAvatarAvatar({
73
77
  apiKey: "test",
@@ -81,6 +85,7 @@ function _validExample5() {
81
85
  .withTts(new CartesiaTTS({
82
86
  apiKey: "test",
83
87
  voiceId: "test",
88
+ modelId: "sonic-2",
84
89
  sampleRate: 16000,
85
90
  }))
86
91
  .withAvatar(new AkoolAvatar({
@@ -91,7 +96,12 @@ function _validExample5() {
91
96
  new DeepgramSTT({ model: "nova-3" });
92
97
  new OpenAI({ model: "gpt-5-mini" });
93
98
  new OpenAITTS({ voice: "alloy" });
94
- new OpenAI({ apiKey: "test", model: "gpt-5-mini", vendor: "custom" });
99
+ new OpenAI({
100
+ apiKey: "test",
101
+ model: "gpt-5-mini",
102
+ url: "https://api.openai.com/v1/chat/completions",
103
+ vendor: "custom",
104
+ });
95
105
  new MiniMaxTTS({
96
106
  model: "speech-2.6-turbo",
97
107
  });
@@ -125,6 +135,7 @@ function invalidMismatch1(): Agent<24000> {
125
135
  key: "test",
126
136
  modelId: "eleven_flash_v2_5",
127
137
  voiceId: "test",
138
+ baseUrl: "wss://api.elevenlabs.io/v1",
128
139
  sampleRate: 16000, // ❌ Wrong rate for HeyGen
129
140
  })
130
141
  )
@@ -146,6 +157,7 @@ function invalidMismatch2(): Agent<16000> {
146
157
  key: "test",
147
158
  modelId: "eleven_flash_v2_5",
148
159
  voiceId: "test",
160
+ baseUrl: "wss://api.elevenlabs.io/v1",
149
161
  sampleRate: 24000, // ❌ Wrong rate for Akool
150
162
  })
151
163
  )
@@ -189,7 +201,8 @@ function invalidEnum1() {
189
201
  key: "test",
190
202
  modelId: "eleven_flash_v2_5",
191
203
  voiceId: "test",
192
- sampleRate: 25000, // ❌ Not in enum: 16000, 22050, 24000, 44100
204
+ baseUrl: "wss://api.elevenlabs.io/v1",
205
+ sampleRate: 25000, // ❌ Not in enum: 16000, 22050, 24000, 44100
193
206
  })
194
207
  );
195
208
  }
@@ -214,7 +227,8 @@ function invalidEnum3() {
214
227
  new CartesiaTTS({
215
228
  key: "test",
216
229
  voiceId: "test",
217
- sampleRate: 32000, // ❌ Not in enum: 8000-48000 (specific values)
230
+ baseUrl: "wss://api.elevenlabs.io/v1",
231
+ sampleRate: 32000, // ❌ Not in enum: 8000-48000 (specific values)
218
232
  })
219
233
  );
220
234
  }
@@ -236,6 +250,7 @@ function _edgeCase2() {
236
250
  key: "test",
237
251
  modelId: "eleven_flash_v2_5",
238
252
  voiceId: "test",
253
+ baseUrl: "wss://api.elevenlabs.io/v1",
239
254
  sampleRate: 16000,
240
255
  }));
241
256
  }
@@ -246,6 +261,7 @@ function _edgeCase3() {
246
261
  key: "test",
247
262
  modelId: "eleven_flash_v2_5",
248
263
  voiceId: "test",
264
+ baseUrl: "wss://api.elevenlabs.io/v1",
249
265
  sampleRate: 24000,
250
266
  }))
251
267
  .withInstructions("Updated instructions")
@@ -264,6 +280,7 @@ function _typeInference1() {
264
280
  key: "test",
265
281
  modelId: "eleven_flash_v2_5",
266
282
  voiceId: "test",
283
+ baseUrl: "wss://api.elevenlabs.io/v1",
267
284
  sampleRate: 24000,
268
285
  }));
269
286
  // Verify: Type should be Agent<24000>
@@ -275,6 +292,7 @@ function _typeInference2() {
275
292
  key: "test",
276
293
  modelId: "eleven_flash_v2_5",
277
294
  voiceId: "test",
295
+ baseUrl: "wss://api.elevenlabs.io/v1",
278
296
  sampleRate: 16000,
279
297
  }));
280
298
  // Verify: Type should be Agent<16000>
@@ -285,6 +303,8 @@ function _typeInference3() {
285
303
  const openAIAgent = new Agent({ instructions: "Test" }).withTts(new OpenAITTS({
286
304
  apiKey: "test",
287
305
  voice: "alloy",
306
+ model: "gpt-4o-mini-tts",
307
+ baseUrl: "https://api.openai.com/v1",
288
308
  }));
289
309
  // Verify: OpenAI is fixed at 24kHz, so type should be Agent<24000>
290
310
  const _typeCheck = openAIAgent;
@@ -5,6 +5,7 @@
5
5
  import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.mjs";
6
6
  import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.mjs";
7
7
  import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.mjs";
8
+ import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.mjs";
8
9
  /** Data channel: `"rtm"` | `"datastream"` */
9
10
  export declare const DataChannel: typeof StartAgentsRequestNS.Properties.Parameters.DataChannel;
10
11
  /** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
@@ -45,13 +46,13 @@ export declare const SpeakPriorityAppend: SpeakAgentsRequestNS.Priority;
45
46
  /** Drop the message if the agent is busy. */
46
47
  export declare const SpeakPriorityIgnore: SpeakAgentsRequestNS.Priority;
47
48
  /** MLLM turn-detection mode: `"agora_vad"` | `"server_vad"` | `"semantic_vad"` */
48
- export declare const MllmTurnDetectionModeValues: typeof StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode;
49
+ export declare const MllmTurnDetectionModeValues: typeof MllmTurnDetectionNS.Mode;
49
50
  /** MLLM turn-detection mode: Agora VAD. */
50
- export declare const MllmTurnDetectionModeAgoraVad: StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode;
51
+ export declare const MllmTurnDetectionModeAgoraVad: MllmTurnDetectionNS.Mode;
51
52
  /** MLLM turn-detection mode: server/vendor VAD. */
52
- export declare const MllmTurnDetectionModeServerVad: StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode;
53
+ export declare const MllmTurnDetectionModeServerVad: MllmTurnDetectionNS.Mode;
53
54
  /** MLLM turn-detection mode: semantic VAD. */
54
- export declare const MllmTurnDetectionModeSemanticVad: StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode;
55
+ export declare const MllmTurnDetectionModeSemanticVad: MllmTurnDetectionNS.Mode;
55
56
  /** Think action when the agent is listening: inject custom text without interrupting. */
56
57
  export declare const ThinkOnListeningActionInject: AgentThinkRequestNS.OnListeningAction;
57
58
  /** Think action when the agent is listening: interrupt and start a new turn. */
@@ -6,6 +6,7 @@
6
6
  import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.mjs";
7
7
  import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.mjs";
8
8
  import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.mjs";
9
+ import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.mjs";
9
10
  /** Data channel: `"rtm"` | `"datastream"` */
10
11
  export const DataChannel = StartAgentsRequestNS.Properties.Parameters.DataChannel;
11
12
  /** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
@@ -46,13 +47,13 @@ export const SpeakPriorityAppend = SpeakAgentsRequestNS.Priority.Append;
46
47
  /** Drop the message if the agent is busy. */
47
48
  export const SpeakPriorityIgnore = SpeakAgentsRequestNS.Priority.Ignore;
48
49
  /** MLLM turn-detection mode: `"agora_vad"` | `"server_vad"` | `"semantic_vad"` */
49
- export const MllmTurnDetectionModeValues = StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode;
50
+ export const MllmTurnDetectionModeValues = MllmTurnDetectionNS.Mode;
50
51
  /** MLLM turn-detection mode: Agora VAD. */
51
- export const MllmTurnDetectionModeAgoraVad = StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode.AgoraVad;
52
+ export const MllmTurnDetectionModeAgoraVad = MllmTurnDetectionNS.Mode.AgoraVad;
52
53
  /** MLLM turn-detection mode: server/vendor VAD. */
53
- export const MllmTurnDetectionModeServerVad = StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode.ServerVad;
54
+ export const MllmTurnDetectionModeServerVad = MllmTurnDetectionNS.Mode.ServerVad;
54
55
  /** MLLM turn-detection mode: semantic VAD. */
55
- export const MllmTurnDetectionModeSemanticVad = StartAgentsRequestNS.Properties.Mllm.TurnDetection.Mode.SemanticVad;
56
+ export const MllmTurnDetectionModeSemanticVad = MllmTurnDetectionNS.Mode.SemanticVad;
56
57
  /** Think action when the agent is listening: inject custom text without interrupting. */
57
58
  export const ThinkOnListeningActionInject = AgentThinkRequestNS.OnListeningAction.Inject;
58
59
  /** Think action when the agent is listening: interrupt and start a new turn. */
@@ -30,7 +30,7 @@ export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPre
30
30
  export { AgentPresets, normalizePresetInput } from "./presets.mjs";
31
31
  export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.mjs";
32
32
  export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.mjs";
33
- export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AvatarConfig, AvatarVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, SttVendor, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionNestedConfig, TurnDetectionType, } from "./types.mjs";
33
+ export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AvatarConfig, AvatarVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, SttVendor, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, } from "./types.mjs";
34
34
  export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.mjs";
35
35
  export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.mjs";
36
36
  export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.mjs";
@@ -29,6 +29,35 @@ export type DeepgramPresetModel = (typeof DeepgramPresetModels)[number];
29
29
  export type OpenAIPresetModel = (typeof OpenAIPresetModels)[number];
30
30
  export type OpenAITtsPresetModel = (typeof OpenAITtsPresetModels)[number];
31
31
  export type MiniMaxPresetModel = (typeof MiniMaxPresetModels)[number];
32
+ export type PresetCategory = "asr" | "llm" | "tts";
33
+ type AsrInference = {
34
+ category: "asr";
35
+ preset: AsrPreset;
36
+ stripModel: boolean;
37
+ };
38
+ type LlmInference = {
39
+ category: "llm";
40
+ preset: LlmPreset;
41
+ stripModel: boolean;
42
+ stripDefaultUrl: boolean;
43
+ };
44
+ type OpenAITtsInference = {
45
+ category: "tts";
46
+ preset: typeof AgentPresets.tts.openaiTts1;
47
+ vendor: "openai";
48
+ stripModel: boolean;
49
+ };
50
+ type MiniMaxTtsInference = {
51
+ category: "tts";
52
+ preset: TtsPreset;
53
+ vendor: "minimax";
54
+ stripModel: boolean;
55
+ };
56
+ type TtsInference = OpenAITtsInference | MiniMaxTtsInference;
57
+ export declare function getPresetCategory(preset: string): PresetCategory | undefined;
58
+ export declare function inferAsrPreset(asr?: Agora.Asr): AsrInference | undefined;
59
+ export declare function inferLlmPreset(llm?: Agora.Llm): LlmInference | undefined;
60
+ export declare function inferTtsPreset(tts?: Agora.Tts): TtsInference | undefined;
32
61
  export declare function normalizePresetInput(preset?: PresetInput | readonly string[]): string | undefined;
33
62
  export declare function resolveSessionPresets(args: {
34
63
  preset?: PresetInput;
@@ -37,3 +66,4 @@ export declare function resolveSessionPresets(args: {
37
66
  preset?: string;
38
67
  properties: Agora.StartAgentsRequest.Properties;
39
68
  };
69
+ export {};
@@ -53,9 +53,12 @@ const minimaxModelToPreset = {
53
53
  speech_2_8_turbo: AgentPresets.tts.minimaxSpeech28Turbo,
54
54
  };
55
55
  function normalizeModelName(value) {
56
- return typeof value === "string" ? value.trim().toLowerCase() : undefined;
56
+ if (typeof value !== "string")
57
+ return undefined;
58
+ const normalized = value.trim().toLowerCase();
59
+ return normalized.length > 0 ? normalized : undefined;
57
60
  }
58
- function getPresetCategory(preset) {
61
+ export function getPresetCategory(preset) {
59
62
  if (Object.values(AgentPresets.asr).includes(preset))
60
63
  return "asr";
61
64
  if (Object.values(AgentPresets.llm).includes(preset))
@@ -80,7 +83,7 @@ function omitUndefinedKeys(value) {
80
83
  const next = Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== undefined));
81
84
  return Object.keys(next).length > 0 ? next : undefined;
82
85
  }
83
- function inferAsrPreset(asr) {
86
+ export function inferAsrPreset(asr) {
84
87
  var _a, _b, _c;
85
88
  if (!asr || asr.vendor !== "deepgram" || ((_a = asr.params) === null || _a === void 0 ? void 0 : _a.api_key))
86
89
  return undefined;
@@ -93,7 +96,7 @@ function inferAsrPreset(asr) {
93
96
  stripModel: true,
94
97
  };
95
98
  }
96
- function inferLlmPreset(llm) {
99
+ export function inferLlmPreset(llm) {
97
100
  var _a, _b;
98
101
  if (!llm || llm.api_key)
99
102
  return undefined;
@@ -111,7 +114,7 @@ function inferLlmPreset(llm) {
111
114
  stripDefaultUrl: true,
112
115
  };
113
116
  }
114
- function inferTtsPreset(tts) {
117
+ export function inferTtsPreset(tts) {
115
118
  var _a, _b, _c, _d, _e, _f;
116
119
  if (!tts)
117
120
  return undefined;
@@ -166,7 +169,7 @@ function stripInferredPresetFields(properties, inferred) {
166
169
  tts = Object.assign(Object.assign({}, tts), { params: omitUndefinedKeys(Object.assign(Object.assign({}, tts.params), { key: undefined, group_id: undefined, url: undefined, model: ttsInference.stripModel ? undefined : (_d = tts.params) === null || _d === void 0 ? void 0 : _d.model })) });
167
170
  }
168
171
  }
169
- return Object.assign(Object.assign({}, properties), { asr, llm, tts });
172
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, properties), (asr && { asr })), (llm && { llm })), (tts && { tts }));
170
173
  }
171
174
  export function normalizePresetInput(preset) {
172
175
  const entries = parsePresetInput(preset);
@@ -2,11 +2,11 @@
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, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest } from "../api/index.mjs";
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, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, 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, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest } from "../api/index.mjs";
6
6
  import type { AgentThinkAgentManagementRequest } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.mjs";
7
7
  import type { PresetInput } from "./presets.mjs";
8
8
  /** LLM request style (openai, gemini, anthropic, dify) */
9
- export type LlmStyle = StartAgentsRequest.Properties.Llm.Style;
9
+ export type LlmStyle = Llm.Style;
10
10
  /**
11
11
  * STT/ASR (Speech-to-Text) configuration with vendor-specific typed parameters.
12
12
  * This discriminated union provides type safety and auto-complete for vendor params.
@@ -14,55 +14,57 @@ export type LlmStyle = StartAgentsRequest.Properties.Llm.Style;
14
14
  */
15
15
  export type SttConfig = {
16
16
  vendor: "speechmatics";
17
- language?: string;
17
+ language?: TurnDetectionLanguage;
18
18
  params: SpeechmaticsParams;
19
19
  } | {
20
20
  vendor: "deepgram";
21
- language?: string;
22
- params?: DeepgramParams;
21
+ language?: TurnDetectionLanguage;
22
+ params: DeepgramParams;
23
23
  } | {
24
24
  vendor: "microsoft";
25
- language?: string;
25
+ language?: TurnDetectionLanguage;
26
26
  params: MicrosoftAsrParams;
27
27
  } | {
28
28
  vendor: "openai";
29
- language?: string;
29
+ language?: TurnDetectionLanguage;
30
30
  params: OpenAiAsrParams;
31
31
  } | {
32
32
  vendor: "google";
33
- language?: string;
33
+ language?: TurnDetectionLanguage;
34
34
  params: GoogleAsrParams;
35
35
  } | {
36
36
  vendor: "amazon";
37
- language?: string;
37
+ language?: TurnDetectionLanguage;
38
38
  params: AmazonAsrParams;
39
39
  } | {
40
40
  vendor: "assemblyai";
41
- language?: string;
42
- params?: AssemblyAiParams;
41
+ language?: TurnDetectionLanguage;
42
+ params: AssemblyAiParams;
43
43
  } | {
44
44
  vendor: "ares";
45
- language?: string;
45
+ language?: TurnDetectionLanguage;
46
46
  params?: AresParams;
47
47
  } | {
48
48
  vendor: "sarvam";
49
- language?: string;
50
- params?: SarvamAsrParams;
51
- } | StartAgentsRequest.Properties.Asr;
49
+ language?: TurnDetectionLanguage;
50
+ params: SarvamAsrParams;
51
+ } | Asr;
52
52
  /** ASR configuration — alias for {@link SttConfig} (wire field: `asr`). */
53
53
  export type AsrConfig = SttConfig;
54
54
  /** STT vendor (ares, microsoft, deepgram, openai, etc.) */
55
- export type SttVendor = StartAgentsRequest.Properties.Asr.Vendor;
55
+ export type SttVendor = string;
56
56
  /** TTS (Text-to-Speech) configuration - discriminated union */
57
57
  export type TtsConfig = Tts;
58
58
  /** MLLM (Multimodal LLM) configuration */
59
- export type MllmConfig = StartAgentsRequest.Properties.Mllm;
59
+ export type MllmConfig = Mllm;
60
60
  /** MLLM vendor (openai, gemini, vertexai, xai) */
61
- export type MllmVendor = StartAgentsRequest.Properties.Mllm.Vendor;
61
+ export type MllmVendor = Mllm.Vendor;
62
62
  /** Avatar configuration */
63
63
  export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
64
64
  /** Avatar vendor (akool, liveavatar, anam, generic, deprecated heygen) */
65
65
  export type AvatarVendor = StartAgentsRequest.Properties.Avatar.Vendor;
66
+ /** BCP-47 language tag used by `turn_detection.language`. */
67
+ export type TurnDetectionLanguage = AsrLanguage;
66
68
  /** Turn detection configuration */
67
69
  export type TurnDetectionConfig = StartAgentsRequest.Properties.TurnDetection;
68
70
  /** Detailed nested config for turn detection (`turn_detection.config`) */
@@ -132,9 +134,9 @@ export type InterruptionConfig = StartAgentsRequest.Properties.Interruption;
132
134
  /** Interruption trigger mode: `"start_of_speech"` | `"keywords"` */
133
135
  export type InterruptionMode = StartAgentsRequest.Properties.Interruption.Mode;
134
136
  /** MLLM turn-detection configuration (`mllm.turn_detection`) */
135
- export type MllmTurnDetectionConfig = StartAgentsRequest.Properties.Mllm.TurnDetection;
137
+ export type MllmTurnDetectionConfig = MllmTurnDetection;
136
138
  /** MLLM turn-detection mode (`agora_vad` | `server_vad` | `semantic_vad`) */
137
- export type MllmTurnDetectionMode = StartAgentsRequest.Properties.Mllm.TurnDetection.Mode;
139
+ export type MllmTurnDetectionMode = MllmTurnDetectionNS.Mode;
138
140
  /** Options for `AgentSession.think()` */
139
141
  export type ThinkOnListeningAction = AgentThinkAgentManagementRequest.OnListeningAction;
140
142
  export type ThinkOnThinkingAction = AgentThinkAgentManagementRequest.OnThinkingAction;
@@ -178,11 +180,11 @@ export type FillerWordsContentSelectionRule = StartAgentsRequest.Properties.Fill
178
180
  /** Custom business labels attached to the agent (returned in notification callbacks) */
179
181
  export type Labels = Record<string, string>;
180
182
  /** LLM greeting broadcast configuration (`llm.greeting_configs`) */
181
- export type LlmGreetingConfigs = StartAgentsRequest.Properties.Llm.GreetingConfigs;
183
+ export type LlmGreetingConfigs = Record<string, unknown>;
182
184
  /** Greeting broadcast mode: `"single_every"` | `"single_first"` */
183
- export type LlmGreetingConfigsMode = StartAgentsRequest.Properties.Llm.GreetingConfigs.Mode;
185
+ export type LlmGreetingConfigsMode = string;
184
186
  /** MCP server config item (`llm.mcp_servers[]`) */
185
- export type McpServersItem = StartAgentsRequest.Properties.Llm.McpServers.Item;
187
+ export type McpServersItem = Record<string, unknown>;
186
188
  /** Full agent configuration (alias for StartAgentsRequest.Properties) */
187
189
  export type AgentConfig = StartAgentsRequest.Properties;
188
190
  /** Agent configuration update (for runtime updates) */
@@ -205,7 +207,7 @@ export interface SessionOptions {
205
207
  enableStringUid?: boolean;
206
208
  /** Preset IDs to use as the base ASR/LLM/TTS configuration for this session */
207
209
  preset?: PresetInput;
208
- /** Published AI Studio pipeline ID to use as the base configuration for this session */
210
+ /** Published AI Studio pipeline ID to use as this session's base configuration. Overrides agent.pipelineId. */
209
211
  pipelineId?: string;
210
212
  /**
211
213
  * Token lifetime in seconds (default: 86400 = 24 hours, Agora maximum).
@@ -371,7 +373,7 @@ export type LlmConfig = (BaseLlmConfig & {
371
373
  }) | (BaseLlmConfig & {
372
374
  style?: undefined;
373
375
  params?: Record<string, unknown>;
374
- }) | StartAgentsRequest.Properties.Llm;
376
+ }) | Llm;
375
377
  /**
376
378
  * Speechmatics STT parameters
377
379
  * @see https://docs.agora.io/en/conversational-ai/models/asr/speechmatics
@@ -381,6 +383,8 @@ export interface SpeechmaticsParams {
381
383
  api_key: string;
382
384
  /** Language code for transcription (e.g., 'en', 'es', 'fr') (required) */
383
385
  language: string;
386
+ /** Speechmatics streaming WebSocket URL */
387
+ uri?: string;
384
388
  /** Additional Speechmatics-specific parameters passed directly to Speechmatics API */
385
389
  [key: string]: unknown;
386
390
  }
@@ -390,7 +394,7 @@ export interface SpeechmaticsParams {
390
394
  */
391
395
  export interface DeepgramParams {
392
396
  /** Deepgram API key */
393
- api_key?: string;
397
+ key?: string;
394
398
  /** Model to use (e.g., 'nova-2', 'enhanced', 'base') */
395
399
  model?: string;
396
400
  /** Language code (e.g., 'en-US', 'es', 'fr') */
@@ -423,8 +427,13 @@ export interface MicrosoftAsrParams {
423
427
  export interface OpenAiAsrParams {
424
428
  /** OpenAI API key (required) */
425
429
  api_key: string;
426
- /** Model to use (default: 'whisper-1') */
427
- model?: string;
430
+ /** OpenAI transcription settings */
431
+ input_audio_transcription?: {
432
+ model?: string;
433
+ prompt?: string;
434
+ language?: string;
435
+ [key: string]: unknown;
436
+ };
428
437
  /** Additional OpenAI-specific parameters */
429
438
  [key: string]: unknown;
430
439
  }
@@ -433,10 +442,16 @@ export interface OpenAiAsrParams {
433
442
  * @see https://docs.agora.io/en/conversational-ai/models/asr/google
434
443
  */
435
444
  export interface GoogleAsrParams {
436
- /** Google Cloud API key (required) */
437
- api_key: string;
445
+ /** Google Cloud project ID where Speech-to-Text is enabled (required) */
446
+ project_id: string;
447
+ /** Google Cloud region for the recognizer (required) */
448
+ location: string;
449
+ /** Google service account credentials JSON string (required) */
450
+ adc_credentials_string: string;
438
451
  /** Language code (e.g., 'en-US', 'es-ES') */
439
452
  language?: string;
453
+ /** Recognition model to use */
454
+ model?: string;
440
455
  /** Additional Google Speech-to-Text parameters */
441
456
  [key: string]: unknown;
442
457
  }
@@ -446,13 +461,13 @@ export interface GoogleAsrParams {
446
461
  */
447
462
  export interface AmazonAsrParams {
448
463
  /** AWS Access Key ID (required) */
449
- access_key: string;
464
+ access_key_id: string;
450
465
  /** AWS Secret Access Key (required) */
451
- secret_key: string;
466
+ secret_access_key: string;
452
467
  /** AWS region (e.g., 'us-east-1') (required) */
453
468
  region: string;
454
469
  /** Language code */
455
- language?: string;
470
+ language_code?: string;
456
471
  /** Additional Amazon Transcribe parameters */
457
472
  [key: string]: unknown;
458
473
  }
@@ -465,6 +480,8 @@ export interface AssemblyAiParams {
465
480
  api_key: string;
466
481
  /** Language code */
467
482
  language?: string;
483
+ /** AssemblyAI streaming WebSocket URL */
484
+ uri?: string;
468
485
  /** Additional AssemblyAI-specific parameters */
469
486
  [key: string]: unknown;
470
487
  }
@@ -473,8 +490,6 @@ export interface AssemblyAiParams {
473
490
  * @see https://docs.agora.io/en/conversational-ai/models/asr/ares
474
491
  */
475
492
  export interface AresParams {
476
- /** Language code for ARES ASR */
477
- language?: string;
478
493
  /** Additional ARES-specific parameters */
479
494
  [key: string]: unknown;
480
495
  }
@@ -63,6 +63,7 @@ export interface AkoolAvatarOptions {
63
63
  * key: process.env.ELEVENLABS_API_KEY,
64
64
  * modelId: 'eleven_flash_v2_5',
65
65
  * voiceId: 'voice-id',
66
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
66
67
  * sampleRate: 16000, // Required for Akool
67
68
  * });
68
69
  *
@@ -100,9 +101,10 @@ export declare class AkoolAvatar extends BaseAvatar<AkoolSampleRate> {
100
101
  * });
101
102
  *
102
103
  * const tts = new ElevenLabsTTS({
103
- * apiKey: process.env.ELEVENLABS_API_KEY,
104
+ * key: process.env.ELEVENLABS_API_KEY,
104
105
  * modelId: 'eleven_flash_v2_5',
105
106
  * voiceId: 'voice-id',
107
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
106
108
  * sampleRate: 24000, // Required for LiveAvatar
107
109
  * });
108
110
  *
@@ -25,6 +25,7 @@ import { BaseAvatar } from "./base.mjs";
25
25
  * key: process.env.ELEVENLABS_API_KEY,
26
26
  * modelId: 'eleven_flash_v2_5',
27
27
  * voiceId: 'voice-id',
28
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
28
29
  * sampleRate: 16000, // Required for Akool
29
30
  * });
30
31
  *
@@ -79,9 +80,10 @@ export class AkoolAvatar extends BaseAvatar {
79
80
  * });
80
81
  *
81
82
  * const tts = new ElevenLabsTTS({
82
- * apiKey: process.env.ELEVENLABS_API_KEY,
83
+ * key: process.env.ELEVENLABS_API_KEY,
83
84
  * modelId: 'eleven_flash_v2_5',
84
85
  * voiceId: 'voice-id',
86
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
85
87
  * sampleRate: 24000, // Required for LiveAvatar
86
88
  * });
87
89
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Type-safe LLM (Large Language Model) vendor classes.
3
3
  */
4
- import type { OpenAIPresetModel } from "../presets.mjs";
4
+ import { type OpenAIPresetModel } from "../presets.mjs";
5
5
  import type { LlmConfig } from "../types.mjs";
6
6
  import { BaseLLM, type BaseLlmOptions } from "./base.mjs";
7
7
  /**
@@ -12,7 +12,7 @@ type OpenAICommonOptions = BaseLlmOptions & {
12
12
  apiKey?: string;
13
13
  /** Model name (e.g., 'gpt-4o-mini', 'gpt-4', 'gpt-3.5-turbo') */
14
14
  model: string;
15
- /** API endpoint URL (defaults to OpenAI's standard endpoint) */
15
+ /** API endpoint URL */
16
16
  url?: string;
17
17
  /** Maximum number of conversation history messages to cache */
18
18
  maxHistory?: number;
@@ -37,6 +37,7 @@ type OpenAICommonOptions = BaseLlmOptions & {
37
37
  };
38
38
  export type OpenAIOptions = (OpenAICommonOptions & {
39
39
  apiKey: string;
40
+ url: string;
40
41
  }) | (Omit<OpenAICommonOptions, "model" | "url" | "vendor"> & {
41
42
  apiKey?: undefined;
42
43
  model: OpenAIPresetModel;
@@ -51,6 +52,7 @@ export type OpenAIOptions = (OpenAICommonOptions & {
51
52
  * const llm = new OpenAI({
52
53
  * apiKey: process.env.OPENAI_API_KEY,
53
54
  * model: 'gpt-4o',
55
+ * url: 'https://api.openai.com/v1/chat/completions',
54
56
  * });
55
57
  * ```
56
58
  */
@@ -120,12 +122,12 @@ export interface AnthropicOptions extends BaseLlmOptions {
120
122
  apiKey: string;
121
123
  /** Model name (e.g., 'claude-3-5-sonnet-20241022', 'claude-3-opus-20240229') */
122
124
  model: string;
123
- /** API endpoint URL (defaults to Anthropic's standard endpoint) */
124
- url?: string;
125
+ /** API endpoint URL */
126
+ url: string;
125
127
  /** Maximum number of conversation history messages to cache */
126
128
  maxHistory?: number;
127
129
  /** Maximum tokens to generate */
128
- maxTokens?: number;
130
+ maxTokens: number;
129
131
  /** Sampling temperature (0.0–1.0) */
130
132
  temperature?: number;
131
133
  /** Nucleus sampling (0.0–1.0) */
@@ -151,6 +153,9 @@ export interface AnthropicOptions extends BaseLlmOptions {
151
153
  * const llm = new Anthropic({
152
154
  * apiKey: process.env.ANTHROPIC_API_KEY,
153
155
  * model: 'claude-3-5-sonnet-20241022',
156
+ * url: 'https://api.anthropic.com/v1/messages',
157
+ * headers: { 'anthropic-version': '2023-06-01' },
158
+ * maxTokens: 1024,
154
159
  * });
155
160
  * ```
156
161
  */
@@ -211,7 +216,7 @@ export declare class Gemini extends BaseLLM {
211
216
  type OpenAIStyleOptions = BaseLlmOptions & {
212
217
  apiKey: string;
213
218
  model: string;
214
- url?: string;
219
+ url: string;
215
220
  maxHistory?: number;
216
221
  temperature?: number;
217
222
  topP?: number;
@@ -259,9 +264,13 @@ export declare class VertexAILLM extends BaseLLM {
259
264
  toConfig(): LlmConfig;
260
265
  }
261
266
  export interface AmazonBedrockOptions extends BaseLlmOptions {
262
- apiKey: string;
267
+ /** AWS access key ID. */
268
+ accessKey: string;
269
+ /** AWS secret access key. */
270
+ secretKey: string;
271
+ /** AWS region. */
272
+ region: string;
263
273
  model: string;
264
- url: string;
265
274
  maxHistory?: number;
266
275
  maxTokens?: number;
267
276
  temperature?: number;
@@ -282,6 +291,7 @@ export declare class AmazonBedrock extends BaseLLM {
282
291
  export interface DifyOptions extends BaseLlmOptions {
283
292
  apiKey: string;
284
293
  url: string;
294
+ model: string;
285
295
  user?: string;
286
296
  conversationId?: string;
287
297
  maxHistory?: number;