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
package/README.md CHANGED
@@ -16,6 +16,7 @@ npm install agora-agents
16
16
  ## Quick Start
17
17
 
18
18
  Start with the `Agent` builder: create a client with app credentials, choose your ASR, LLM, and TTS providers, then start a session. Omit vendor API keys for supported Agora-managed models, or provide keys when you want BYOK.
19
+ Set Agora interaction language with `turnDetection.language`; provider-specific STT language values remain under `asr.params`.
19
20
 
20
21
  ```typescript
21
22
  import {
@@ -44,11 +45,8 @@ export async function startConversation(): Promise<string> {
44
45
 
45
46
  const agent = new Agent({
46
47
  name: `conversation-${Date.now()}`,
47
- instructions: AGENT_PROMPT,
48
- greeting: GREETING,
49
- failureMessage: 'Please wait a moment.',
50
- maxHistory: 50,
51
48
  turnDetection: {
49
+ language: 'en-US',
52
50
  config: {
53
51
  speech_threshold: 0.5,
54
52
  start_of_speech: {
@@ -84,9 +82,10 @@ export async function startConversation(): Promise<string> {
84
82
  .withLlm(
85
83
  new OpenAI({
86
84
  model: 'gpt-4o-mini',
85
+ systemMessages: [{ role: 'system', content: AGENT_PROMPT }],
87
86
  greetingMessage: GREETING,
88
87
  failureMessage: 'Please wait a moment.',
89
- maxHistory: 15,
88
+ maxHistory: 50,
90
89
  params: {
91
90
  max_tokens: 1024,
92
91
  temperature: 0.7,
@@ -118,15 +117,42 @@ export async function startConversation(): Promise<string> {
118
117
 
119
118
  `AgoraClient` generates the required ConvoAI REST auth and RTC join tokens automatically when you provide `appId` and `appCertificate`. For supported Agora-managed models, leave vendor API keys unset; provide keys when you want BYOK.
120
119
 
120
+ ## AI Studio pipeline IDs
121
+
122
+ Use `pipelineId` when you want a published AI Studio pipeline to provide the base agent configuration:
123
+
124
+ ```typescript
125
+ const agent = new Agent({
126
+ name: 'support',
127
+ pipelineId: 'studio-pipeline-id',
128
+ });
129
+
130
+ const session = agent.createSession(client, {
131
+ channel: 'support-room',
132
+ agentUid: '1',
133
+ remoteUids: ['100'],
134
+ });
135
+ ```
136
+
137
+ You can override it per session:
138
+
139
+ ```typescript
140
+ const session = agent.createSession(client, {
141
+ channel: 'support-room',
142
+ agentUid: '1',
143
+ remoteUids: ['100'],
144
+ pipelineId: 'session-pipeline-id',
145
+ });
146
+ ```
147
+
148
+ AgentKit sends the resolved value as the top-level `/join` field `pipeline_id`, not inside `properties`. Explicit Agent config such as `.withLlm()`, `.withTts()`, `.withStt()`, `.withMllm()`, and `advancedFeatures` may send `properties` fields that override the saved pipeline settings.
149
+
121
150
  ### BYOK version
122
151
 
123
152
  Use the same `Agent` builder shape, but provide credentials explicitly when you want vendor-managed billing and routing instead of Agora-managed models.
124
153
 
125
154
  ```typescript
126
- const agent = new Agent({
127
- instructions: SUPPORT_PROMPT,
128
- greeting: GREETING,
129
- })
155
+ const agent = new Agent({ turnDetection: { language: 'en-US' } })
130
156
  .withStt(
131
157
  new DeepgramSTT({
132
158
  apiKey: process.env.DEEPGRAM_API_KEY!,
@@ -137,7 +163,10 @@ const agent = new Agent({
137
163
  .withLlm(
138
164
  new OpenAI({
139
165
  apiKey: process.env.OPENAI_API_KEY!,
166
+ url: 'https://api.openai.com/v1/chat/completions',
140
167
  model: 'gpt-4o-mini',
168
+ systemMessages: [{ role: 'system', content: SUPPORT_PROMPT }],
169
+ greetingMessage: GREETING,
141
170
  maxTokens: 1024,
142
171
  temperature: 0.7,
143
172
  topP: 0.95,
@@ -69,14 +69,19 @@ class AgoraClient extends Client_js_1.AgoraClient {
69
69
  let authMode;
70
70
  let username;
71
71
  let password;
72
+ let authToken = "";
72
73
  const opts = options;
73
- if (opts.customerId != null) {
74
+ if (opts.customerId != null && opts.customerSecret != null) {
74
75
  authMode = "basic";
75
76
  username = opts.customerId;
76
77
  password = opts.customerSecret;
77
78
  }
79
+ else if (opts.customerId != null) {
80
+ throw new Error("customerSecret is required when customerId is provided");
81
+ }
78
82
  else if (opts.authToken != null) {
79
83
  authMode = "token";
84
+ authToken = opts.authToken;
80
85
  username = "";
81
86
  password = "";
82
87
  }
@@ -91,7 +96,7 @@ class AgoraClient extends Client_js_1.AgoraClient {
91
96
  const authorization = authMode === "basic"
92
97
  ? `Basic ${Buffer.from(`${username}:${password}`).toString("base64")}`
93
98
  : authMode === "token"
94
- ? `agora token=${opts.authToken}`
99
+ ? `agora token=${authToken}`
95
100
  : "";
96
101
  super(Object.assign(Object.assign({}, rest), { username,
97
102
  password,
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
41
41
  const headers = (0, headers_js_1.mergeHeaders)({
42
42
  "X-Fern-Language": "JavaScript",
43
43
  "X-Fern-SDK-Name": "agora-agents",
44
- "X-Fern-SDK-Version": "v2.0.0",
45
- "User-Agent": "agora-agents/v2.0.0",
44
+ "X-Fern-SDK-Version": "v2.1.1",
45
+ "User-Agent": "agora-agents/v2.1.1",
46
46
  "X-Fern-Runtime": core.RUNTIME.type,
47
47
  "X-Fern-Runtime-Version": core.RUNTIME.version,
48
48
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -12,20 +12,28 @@ class AgoraClient {
12
12
  this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
13
13
  }
14
14
  get agents() {
15
- var _a;
16
- return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_2.AgentsClient(this._options)));
15
+ if (this._agents == null) {
16
+ this._agents = new Client_js_2.AgentsClient(this._options);
17
+ }
18
+ return this._agents;
17
19
  }
18
20
  get agentManagement() {
19
- var _a;
20
- return ((_a = this._agentManagement) !== null && _a !== void 0 ? _a : (this._agentManagement = new Client_js_1.AgentManagementClient(this._options)));
21
+ if (this._agentManagement == null) {
22
+ this._agentManagement = new Client_js_1.AgentManagementClient(this._options);
23
+ }
24
+ return this._agentManagement;
21
25
  }
22
26
  get telephony() {
23
- var _a;
24
- return ((_a = this._telephony) !== null && _a !== void 0 ? _a : (this._telephony = new Client_js_4.TelephonyClient(this._options)));
27
+ if (this._telephony == null) {
28
+ this._telephony = new Client_js_4.TelephonyClient(this._options);
29
+ }
30
+ return this._telephony;
25
31
  }
26
32
  get phoneNumbers() {
27
- var _a;
28
- return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new Client_js_3.PhoneNumbersClient(this._options)));
33
+ if (this._phoneNumbers == null) {
34
+ this._phoneNumbers = new Client_js_3.PhoneNumbersClient(this._options);
35
+ }
36
+ return this._phoneNumbers;
29
37
  }
30
38
  }
31
39
  exports.AgoraClient = AgoraClient;
@@ -18,7 +18,17 @@ import type { BaseAvatar, BaseLLM, BaseMLLM, BaseSTT, BaseTTS } from "./vendors/
18
18
  export interface AgentOptions {
19
19
  /** Optional name for the agent (used as default session name) */
20
20
  name?: string;
21
- /** System instructions for the agent */
21
+ /**
22
+ * Published AI Studio pipeline ID to use as this agent's base configuration.
23
+ * Explicit Agent config such as .withLlm(), .withTts(), .withStt(),
24
+ * advancedFeatures, and other builder options may send fields in
25
+ * `properties` that override the saved pipeline settings.
26
+ */
27
+ pipelineId?: string;
28
+ /**
29
+ * System instructions for the agent.
30
+ * @deprecated Configure this on the LLM vendor with `systemMessages` instead.
31
+ */
22
32
  instructions?: string;
23
33
  /** Turn detection configuration */
24
34
  turnDetection?: TurnDetectionConfig;
@@ -32,11 +42,20 @@ export interface AgentOptions {
32
42
  advancedFeatures?: AdvancedFeatures;
33
43
  /** Session parameters */
34
44
  parameters?: SessionParamsInput;
35
- /** Greeting message */
45
+ /**
46
+ * Greeting message.
47
+ * @deprecated Configure this on the LLM or MLLM vendor with `greetingMessage` instead.
48
+ */
36
49
  greeting?: string;
37
- /** Failure message */
50
+ /**
51
+ * Failure message.
52
+ * @deprecated Configure this on the LLM or MLLM vendor with `failureMessage` instead.
53
+ */
38
54
  failureMessage?: string;
39
- /** Max conversation history for the standard LLM pipeline. Does not apply to MLLM. */
55
+ /**
56
+ * Max conversation history for the standard LLM pipeline. Does not apply to MLLM.
57
+ * @deprecated Configure this on the LLM vendor with `maxHistory` instead.
58
+ */
40
59
  maxHistory?: number;
41
60
  /** Regional access restriction configuration */
42
61
  geofence?: GeofenceConfig;
@@ -46,7 +65,10 @@ export interface AgentOptions {
46
65
  rtc?: RtcConfig;
47
66
  /** Filler word configuration (plays filler words while waiting for LLM responses) */
48
67
  fillerWords?: FillerWordsConfig;
49
- /** Greeting playback configuration for multi-user channels */
68
+ /**
69
+ * Greeting playback configuration for multi-user channels.
70
+ * @deprecated Configure this on the LLM vendor with `greetingConfigs` instead.
71
+ */
50
72
  greetingConfigs?: LlmGreetingConfigs;
51
73
  }
52
74
  /**
@@ -60,13 +82,14 @@ export interface AgentOptions {
60
82
  *
61
83
  * // Use the fluent builder pattern to configure vendors
62
84
  * const agent = new Agent({ instructions: 'You are helpful.' })
63
- * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4' }))
64
- * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', sampleRate: 24000 }))
85
+ * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
86
+ * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
65
87
  * .withStt(new DeepgramSTT({ apiKey: '...', model: 'nova-2' }));
66
88
  * ```
67
89
  */
68
90
  export declare class Agent<TTSSampleRate extends number = number> {
69
91
  private _name?;
92
+ private _pipelineId?;
70
93
  private _llm?;
71
94
  private _tts?;
72
95
  private _stt?;
@@ -90,7 +113,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
90
113
  /**
91
114
  * Returns a new Agent with the specified LLM vendor.
92
115
  *
93
- * @param vendor - LLM vendor instance (e.g., new OpenAI({ apiKey: '...', model: 'gpt-4' }))
116
+ * @param vendor - LLM vendor instance (e.g., new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
94
117
  */
95
118
  withLlm(vendor: BaseLLM): Agent<TTSSampleRate>;
96
119
  /**
@@ -99,7 +122,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
99
122
  * The sample rate type is tracked for compile-time avatar compatibility checking.
100
123
  *
101
124
  * @template SR - Sample rate literal type
102
- * @param vendor - TTS vendor instance (e.g., new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', sampleRate: 24000 }))
125
+ * @param vendor - TTS vendor instance (e.g., new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
103
126
  * @returns Agent with tracked sample rate type
104
127
  */
105
128
  withTts<SR extends number>(vendor: BaseTTS<SR>): Agent<SR>;
@@ -162,6 +185,7 @@ export declare class Agent<TTSSampleRate extends number = number> {
162
185
  * key: '...',
163
186
  * modelId: '...',
164
187
  * voiceId: '...',
188
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
165
189
  * sampleRate: 24000, // Required for HeyGen
166
190
  * }))
167
191
  * .withAvatar(new HeyGenAvatar({
@@ -182,10 +206,14 @@ export declare class Agent<TTSSampleRate extends number = number> {
182
206
  withInterruption(config: InterruptionConfig): Agent<TTSSampleRate>;
183
207
  /**
184
208
  * Returns a new Agent with the specified instructions.
209
+ *
210
+ * @deprecated Configure system messages on the LLM vendor instead.
185
211
  */
186
212
  withInstructions(instructions: string): Agent<TTSSampleRate>;
187
213
  /**
188
214
  * Returns a new Agent with the specified greeting message.
215
+ *
216
+ * @deprecated Configure the greeting on the LLM or MLLM vendor instead.
189
217
  */
190
218
  withGreeting(greeting: string): Agent<TTSSampleRate>;
191
219
  /**
@@ -193,6 +221,8 @@ export declare class Agent<TTSSampleRate extends number = number> {
193
221
  *
194
222
  * Serializes to `llm.greeting_configs`. Agent-level values override any
195
223
  * vendor-level `greeting_configs` configured on the LLM vendor.
224
+ *
225
+ * @deprecated Configure greeting playback on the LLM vendor instead.
196
226
  */
197
227
  withGreetingConfigs(configs: LlmGreetingConfigs): Agent<TTSSampleRate>;
198
228
  /**
@@ -227,11 +257,15 @@ export declare class Agent<TTSSampleRate extends number = number> {
227
257
  * Returns a new Agent with the specified failure message.
228
258
  *
229
259
  * The failure message is played via TTS when the LLM call fails.
260
+ *
261
+ * @deprecated Configure the failure message on the LLM or MLLM vendor instead.
230
262
  */
231
263
  withFailureMessage(message: string): Agent<TTSSampleRate>;
232
264
  /**
233
265
  * Returns a new Agent with the specified maximum conversation history length.
234
266
  * Applies to the standard LLM pipeline only; the v2.7 MLLM core schema has no max_history field.
267
+ *
268
+ * @deprecated Configure max history on the LLM vendor instead.
235
269
  */
236
270
  withMaxHistory(maxHistory: number): Agent<TTSSampleRate>;
237
271
  /**
@@ -260,6 +294,10 @@ export declare class Agent<TTSSampleRate extends number = number> {
260
294
  * Get the agent name.
261
295
  */
262
296
  get name(): string | undefined;
297
+ /**
298
+ * Get the AI Studio pipeline ID used as this agent's base configuration.
299
+ */
300
+ get pipelineId(): string | undefined;
263
301
  /**
264
302
  * Get the LLM configuration.
265
303
  */
@@ -388,10 +426,15 @@ export declare class Agent<TTSSampleRate extends number = number> {
388
426
  idleTimeout?: number;
389
427
  enableStringUid?: boolean;
390
428
  /**
391
- * Skip the LLM and TTS required-field guards. Set this when `preset` or
392
- * `pipeline_id` is in use — those fields supply the vendor config server-side.
429
+ * @deprecated Use `skipVendorValidationCategories` and
430
+ * `allowMissingVendorCategories` instead. This broad escape hatch will be
431
+ * removed in a future release.
393
432
  */
394
433
  skipVendorValidation?: boolean;
434
+ /** Skip generated request-shape validation for the listed provider categories. */
435
+ skipVendorValidationCategories?: ReadonlySet<"asr" | "llm" | "tts">;
436
+ /** Allow the listed provider categories to be omitted from properties. */
437
+ allowMissingVendorCategories?: ReadonlySet<"asr" | "llm" | "tts">;
395
438
  } & ({
396
439
  token: string;
397
440
  appId?: undefined;
@@ -412,4 +455,6 @@ export declare class Agent<TTSSampleRate extends number = number> {
412
455
  * If a new private field is added to Agent, it MUST also be added here.
413
456
  */
414
457
  private _clone;
458
+ private _resolveAsrConfig;
459
+ private _resolveTurnDetectionConfig;
415
460
  }
@@ -9,6 +9,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.Agent = void 0;
10
10
  const AgentSession_js_1 = require("./AgentSession.js");
11
11
  const token_js_1 = require("./token.js");
12
+ const DEFAULT_TURN_DETECTION_LANGUAGE = "en-US";
13
+ const INTERACTION_LANGUAGES = new Set([
14
+ "ar-EG",
15
+ "ar-JO",
16
+ "ar-SA",
17
+ "ar-AE",
18
+ "bn-IN",
19
+ "zh-CN",
20
+ "zh-HK",
21
+ "zh-TW",
22
+ "nl-NL",
23
+ "en-IN",
24
+ "en-US",
25
+ "fil-PH",
26
+ "fr-FR",
27
+ "de-DE",
28
+ "gu-IN",
29
+ "he-IL",
30
+ "hi-IN",
31
+ "id-ID",
32
+ "it-IT",
33
+ "ja-JP",
34
+ "kn-IN",
35
+ "ko-KR",
36
+ "ms-MY",
37
+ "fa-IR",
38
+ "pt-PT",
39
+ "ru-RU",
40
+ "es-ES",
41
+ "ta-IN",
42
+ "te-IN",
43
+ "th-TH",
44
+ "tr-TR",
45
+ "vi-VN",
46
+ ]);
47
+ function isTurnDetectionLanguage(value) {
48
+ return INTERACTION_LANGUAGES.has(value);
49
+ }
50
+ function assertTurnDetectionLanguage(value) {
51
+ if (!isTurnDetectionLanguage(value)) {
52
+ throw new Error(`Invalid interaction language: ${value}`);
53
+ }
54
+ }
12
55
  /**
13
56
  * Agent class representing a reusable agent configuration.
14
57
  *
@@ -20,14 +63,15 @@ const token_js_1 = require("./token.js");
20
63
  *
21
64
  * // Use the fluent builder pattern to configure vendors
22
65
  * const agent = new Agent({ instructions: 'You are helpful.' })
23
- * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4' }))
24
- * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', sampleRate: 24000 }))
66
+ * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
67
+ * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
25
68
  * .withStt(new DeepgramSTT({ apiKey: '...', model: 'nova-2' }));
26
69
  * ```
27
70
  */
28
71
  class Agent {
29
72
  constructor(options = {}) {
30
73
  this._name = options.name;
74
+ this._pipelineId = options.pipelineId;
31
75
  this._instructions = options.instructions;
32
76
  this._greeting = options.greeting;
33
77
  this._failureMessage = options.failureMessage;
@@ -69,7 +113,7 @@ class Agent {
69
113
  /**
70
114
  * Returns a new Agent with the specified LLM vendor.
71
115
  *
72
- * @param vendor - LLM vendor instance (e.g., new OpenAI({ apiKey: '...', model: 'gpt-4' }))
116
+ * @param vendor - LLM vendor instance (e.g., new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
73
117
  */
74
118
  withLlm(vendor) {
75
119
  const newAgent = this._clone();
@@ -82,7 +126,7 @@ class Agent {
82
126
  * The sample rate type is tracked for compile-time avatar compatibility checking.
83
127
  *
84
128
  * @template SR - Sample rate literal type
85
- * @param vendor - TTS vendor instance (e.g., new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', sampleRate: 24000 }))
129
+ * @param vendor - TTS vendor instance (e.g., new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
86
130
  * @returns Agent with tracked sample rate type
87
131
  */
88
132
  withTts(vendor) {
@@ -166,6 +210,7 @@ class Agent {
166
210
  * key: '...',
167
211
  * modelId: '...',
168
212
  * voiceId: '...',
213
+ * baseUrl: 'wss://api.elevenlabs.io/v1',
169
214
  * sampleRate: 24000, // Required for HeyGen
170
215
  * }))
171
216
  * .withAvatar(new HeyGenAvatar({
@@ -200,6 +245,8 @@ class Agent {
200
245
  }
201
246
  /**
202
247
  * Returns a new Agent with the specified instructions.
248
+ *
249
+ * @deprecated Configure system messages on the LLM vendor instead.
203
250
  */
204
251
  withInstructions(instructions) {
205
252
  const newAgent = this._clone();
@@ -208,6 +255,8 @@ class Agent {
208
255
  }
209
256
  /**
210
257
  * Returns a new Agent with the specified greeting message.
258
+ *
259
+ * @deprecated Configure the greeting on the LLM or MLLM vendor instead.
211
260
  */
212
261
  withGreeting(greeting) {
213
262
  const newAgent = this._clone();
@@ -219,6 +268,8 @@ class Agent {
219
268
  *
220
269
  * Serializes to `llm.greeting_configs`. Agent-level values override any
221
270
  * vendor-level `greeting_configs` configured on the LLM vendor.
271
+ *
272
+ * @deprecated Configure greeting playback on the LLM vendor instead.
222
273
  */
223
274
  withGreetingConfigs(configs) {
224
275
  const newAgent = this._clone();
@@ -281,6 +332,8 @@ class Agent {
281
332
  * Returns a new Agent with the specified failure message.
282
333
  *
283
334
  * The failure message is played via TTS when the LLM call fails.
335
+ *
336
+ * @deprecated Configure the failure message on the LLM or MLLM vendor instead.
284
337
  */
285
338
  withFailureMessage(message) {
286
339
  const newAgent = this._clone();
@@ -290,6 +343,8 @@ class Agent {
290
343
  /**
291
344
  * Returns a new Agent with the specified maximum conversation history length.
292
345
  * Applies to the standard LLM pipeline only; the v2.7 MLLM core schema has no max_history field.
346
+ *
347
+ * @deprecated Configure max history on the LLM vendor instead.
293
348
  */
294
349
  withMaxHistory(maxHistory) {
295
350
  const newAgent = this._clone();
@@ -340,6 +395,12 @@ class Agent {
340
395
  get name() {
341
396
  return this._name;
342
397
  }
398
+ /**
399
+ * Get the AI Studio pipeline ID used as this agent's base configuration.
400
+ */
401
+ get pipelineId() {
402
+ return this._pipelineId;
403
+ }
343
404
  /**
344
405
  * Get the LLM configuration.
345
406
  */
@@ -462,6 +523,7 @@ class Agent {
462
523
  get config() {
463
524
  return {
464
525
  name: this._name,
526
+ pipelineId: this._pipelineId,
465
527
  instructions: this._instructions,
466
528
  turnDetection: this._turnDetection,
467
529
  interruption: this._interruption,
@@ -519,7 +581,7 @@ class Agent {
519
581
  * and RTM privileges (required for RTM-enabled sessions).
520
582
  */
521
583
  toProperties(opts) {
522
- var _a, _b, _c, _d, _e, _f, _g;
584
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
523
585
  // In MLLM mode the backend handles audio end-to-end; LLM, TTS, and ASR
524
586
  // are not required.
525
587
  const isMllmMode = ((_a = this._mllm) === null || _a === void 0 ? void 0 : _a.enable) === true || this._mllm !== undefined;
@@ -562,7 +624,6 @@ class Agent {
562
624
  idle_timeout: opts.idleTimeout,
563
625
  enable_string_uid: opts.enableStringUid,
564
626
  mllm: this._mllm,
565
- turn_detection: this._turnDetection,
566
627
  interruption: this._interruption,
567
628
  sal: this._sal,
568
629
  avatar: this._avatar,
@@ -586,21 +647,37 @@ class Agent {
586
647
  c.failure_message = this._failureMessage;
587
648
  }
588
649
  }
589
- return Object.assign(Object.assign({}, base), { mllm: mllmConfig });
650
+ return Object.assign(Object.assign({}, base), { mllm: mllmConfig, turn_detection: this._turnDetection });
590
651
  }
591
- if (!opts.skipVendorValidation) {
592
- if (!this._tts) {
593
- throw new Error("TTS configuration is required. Use withTts() to set it.");
594
- }
595
- if (!this._llm) {
596
- throw new Error("LLM configuration is required. Use withLlm() to set it.");
652
+ const skipCategories = new Set((_d = opts.skipVendorValidationCategories) !== null && _d !== void 0 ? _d : []);
653
+ const allowMissingCategories = new Set((_e = opts.allowMissingVendorCategories) !== null && _e !== void 0 ? _e : []);
654
+ if (opts.skipVendorValidation) {
655
+ for (const category of ["asr", "llm", "tts"]) {
656
+ skipCategories.add(category);
657
+ allowMissingCategories.add(category);
597
658
  }
598
659
  }
660
+ const skipLlmValidation = skipCategories.has("llm");
661
+ const skipTtsValidation = skipCategories.has("tts");
662
+ const allowMissingAsr = allowMissingCategories.has("asr");
663
+ const allowMissingLlm = allowMissingCategories.has("llm");
664
+ const allowMissingTts = allowMissingCategories.has("tts");
665
+ if (!this._tts && !(skipTtsValidation || allowMissingTts)) {
666
+ throw new Error("TTS configuration is required. Use withTts() to set it.");
667
+ }
668
+ if (!this._llm && !(skipLlmValidation || allowMissingLlm)) {
669
+ throw new Error("LLM configuration is required. Use withLlm() to set it.");
670
+ }
599
671
  const llmConfig = this._llm
600
672
  ? Object.assign(Object.assign({}, this._llm), { system_messages: this._instructions
601
673
  ? [{ role: "system", content: this._instructions }]
602
- : this._llm.system_messages, greeting_message: (_d = this._greeting) !== null && _d !== void 0 ? _d : this._llm.greeting_message, greeting_configs: (_e = this._greetingConfigs) !== null && _e !== void 0 ? _e : this._llm.greeting_configs, failure_message: (_f = this._failureMessage) !== null && _f !== void 0 ? _f : this._llm.failure_message, max_history: (_g = this._maxHistory) !== null && _g !== void 0 ? _g : this._llm.max_history }) : undefined;
603
- return Object.assign(Object.assign({}, base), { llm: llmConfig, tts: this._tts, asr: this._stt });
674
+ : this._llm.system_messages, greeting_message: (_f = this._greeting) !== null && _f !== void 0 ? _f : this._llm.greeting_message, greeting_configs: (_g = this._greetingConfigs) !== null && _g !== void 0 ? _g : this._llm.greeting_configs, failure_message: (_h = this._failureMessage) !== null && _h !== void 0 ? _h : this._llm.failure_message, max_history: (_j = this._maxHistory) !== null && _j !== void 0 ? _j : this._llm.max_history }) : undefined;
675
+ const asrConfig = this._stt !== undefined || !allowMissingAsr
676
+ ? this._resolveAsrConfig()
677
+ : undefined;
678
+ const turnDetectionConfig = this._resolveTurnDetectionConfig();
679
+ const ttsConfig = this._tts;
680
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, base), { turn_detection: turnDetectionConfig }), (llmConfig && { llm: llmConfig })), (ttsConfig && { tts: ttsConfig })), (asrConfig && { asr: asrConfig }));
604
681
  }
605
682
  /**
606
683
  * Creates a shallow copy of this Agent, preserving the TTSSampleRate type
@@ -614,6 +691,7 @@ class Agent {
614
691
  _clone() {
615
692
  const newAgent = new Agent();
616
693
  newAgent._name = this._name;
694
+ newAgent._pipelineId = this._pipelineId;
617
695
  newAgent._llm = this._llm;
618
696
  newAgent._tts = this._tts;
619
697
  newAgent._stt = this._stt;
@@ -635,6 +713,27 @@ class Agent {
635
713
  newAgent._greetingConfigs = this._greetingConfigs;
636
714
  return newAgent;
637
715
  }
716
+ _resolveAsrConfig() {
717
+ var _a;
718
+ const asrConfig = Object.assign({}, ((_a = this._stt) !== null && _a !== void 0 ? _a : {}));
719
+ if (this._stt === undefined) {
720
+ asrConfig.vendor = "ares";
721
+ }
722
+ delete asrConfig.language;
723
+ return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
724
+ }
725
+ _resolveTurnDetectionConfig() {
726
+ var _a, _b;
727
+ const turnDetection = Object.assign({}, ((_a = this._turnDetection) !== null && _a !== void 0 ? _a : {}));
728
+ const existingTurnDetectionLanguage = turnDetection.language;
729
+ const existingAsrLanguage = (_b = this._stt) === null || _b === void 0 ? void 0 : _b.language;
730
+ const language = existingTurnDetectionLanguage !== null && existingTurnDetectionLanguage !== void 0 ? existingTurnDetectionLanguage : (existingAsrLanguage !== undefined && isTurnDetectionLanguage(existingAsrLanguage)
731
+ ? existingAsrLanguage
732
+ : DEFAULT_TURN_DETECTION_LANGUAGE);
733
+ assertTurnDetectionLanguage(language);
734
+ turnDetection.language = language;
735
+ return turnDetection;
736
+ }
638
737
  }
639
738
  exports.Agent = Agent;
640
739
  function _parseNumericUid(uid, label) {
@@ -46,7 +46,7 @@ export interface AgentSessionOptions {
46
46
  enableStringUid?: boolean;
47
47
  /** Preset IDs to use as the base ASR/LLM/TTS configuration for this session */
48
48
  preset?: PresetInput;
49
- /** Published AI Studio pipeline ID to use as the base configuration for this session */
49
+ /** Published AI Studio pipeline ID to use as this session's base configuration. Overrides agent.pipelineId. */
50
50
  pipelineId?: string;
51
51
  /**
52
52
  * Token lifetime in seconds (default: 86400 = 24 hours, Agora maximum).
@@ -78,8 +78,8 @@ export interface AgentSessionOptions {
78
78
  * });
79
79
  *
80
80
  * const agent = new Agent({ name: 'support-assistant', instructions: 'You are a helpful voice assistant.' })
81
- * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini' }))
82
- * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', sampleRate: 24000 }))
81
+ * .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini', url: 'https://api.openai.com/v1/chat/completions' }))
82
+ * .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
83
83
  * .withStt(new DeepgramSTT({ apiKey: '...', language: 'en-US' }));
84
84
  *
85
85
  * const session = agent.createSession(client, {
@@ -188,6 +188,7 @@ export declare class AgentSession {
188
188
  */
189
189
  private _enrichAvatarParams;
190
190
  private _validateEnrichedAvatarConfig;
191
+ private _vendorValidationCategories;
191
192
  /**
192
193
  * Start the agent session.
193
194
  *