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.
- package/README.md +38 -9
- package/dist/cjs/AgoraPoolClient.js +7 -2
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.js +16 -8
- package/dist/cjs/agentkit/Agent.d.ts +56 -11
- package/dist/cjs/agentkit/Agent.js +114 -15
- package/dist/cjs/agentkit/AgentSession.d.ts +4 -3
- package/dist/cjs/agentkit/AgentSession.js +39 -10
- package/dist/cjs/agentkit/__tests__/type-safety.test.js +23 -3
- package/dist/cjs/agentkit/constants.d.ts +5 -4
- package/dist/cjs/agentkit/constants.js +5 -4
- package/dist/cjs/agentkit/index.d.ts +1 -1
- package/dist/cjs/agentkit/presets.d.ts +30 -0
- package/dist/cjs/agentkit/presets.js +9 -2
- package/dist/cjs/agentkit/types.d.ts +50 -35
- package/dist/cjs/agentkit/vendors/avatar.d.ts +3 -1
- package/dist/cjs/agentkit/vendors/avatar.js +3 -1
- package/dist/cjs/agentkit/vendors/llm.d.ts +18 -8
- package/dist/cjs/agentkit/vendors/llm.js +83 -15
- package/dist/cjs/agentkit/vendors/mllm.d.ts +16 -0
- package/dist/cjs/agentkit/vendors/mllm.js +11 -7
- package/dist/cjs/agentkit/vendors/stt.d.ts +29 -11
- package/dist/cjs/agentkit/vendors/stt.js +74 -53
- package/dist/cjs/agentkit/vendors/tts.d.ts +70 -22
- package/dist/cjs/agentkit/vendors/tts.js +67 -34
- package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -2
- package/dist/cjs/api/resources/agents/client/Client.js +3 -2
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +8 -331
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +0 -107
- package/dist/cjs/api/types/AmazonAsr.d.ts +10 -0
- package/dist/cjs/api/types/AmazonAsr.js +3 -0
- package/dist/cjs/api/types/AmazonAsrParams.d.ts +19 -0
- package/dist/cjs/api/types/AmazonAsrParams.js +3 -0
- package/dist/cjs/api/types/AmazonTtsParams.d.ts +19 -5
- package/dist/cjs/api/types/AmazonTtsParams.js +11 -0
- package/dist/cjs/api/types/AresAsr.d.ts +10 -0
- package/dist/cjs/api/types/AresAsr.js +3 -0
- package/dist/cjs/api/types/AresAsrParams.d.ts +4 -0
- package/dist/cjs/api/types/AresAsrParams.js +3 -0
- package/dist/cjs/api/types/Asr.d.ts +31 -0
- package/dist/cjs/api/types/Asr.js +3 -0
- package/dist/cjs/api/types/AsrLanguage.d.ts +36 -0
- package/dist/cjs/api/types/AsrLanguage.js +39 -0
- package/dist/cjs/api/types/AssemblyAiAsr.d.ts +10 -0
- package/dist/cjs/api/types/AssemblyAiAsr.js +3 -0
- package/dist/cjs/api/types/AssemblyAiAsrParams.d.ts +13 -0
- package/dist/cjs/api/types/AssemblyAiAsrParams.js +3 -0
- package/dist/cjs/api/types/CartesiaTtsOutputFormat.d.ts +11 -0
- package/dist/cjs/api/types/CartesiaTtsOutputFormat.js +3 -0
- package/dist/cjs/api/types/CartesiaTtsParams.d.ts +9 -4
- package/dist/cjs/api/types/CartesiaTtsVoice.d.ts +2 -0
- package/dist/cjs/api/types/DeepgramAsr.d.ts +12 -0
- package/dist/cjs/api/types/DeepgramAsr.js +3 -0
- package/dist/cjs/api/types/DeepgramAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/DeepgramAsrParams.js +3 -0
- package/dist/cjs/api/types/DeepgramTtsParams.d.ts +2 -2
- package/dist/cjs/api/types/ElevenLabsTtsParams.d.ts +13 -1
- package/dist/cjs/api/types/FishAudioTtsParams.d.ts +5 -1
- package/dist/cjs/api/types/GoogleAsr.d.ts +10 -0
- package/dist/cjs/api/types/GoogleAsr.js +3 -0
- package/dist/cjs/api/types/GoogleAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/GoogleAsrParams.js +3 -0
- package/dist/cjs/api/types/GoogleTtsAudioConfig.d.ts +11 -0
- package/dist/cjs/api/types/GoogleTtsAudioConfig.js +3 -0
- package/dist/cjs/api/types/GoogleTtsParams.d.ts +7 -8
- package/dist/cjs/api/types/GoogleTtsVoiceSelectionParams.d.ts +9 -0
- package/dist/cjs/api/types/GoogleTtsVoiceSelectionParams.js +3 -0
- package/dist/cjs/api/types/HumeAiTtsParams.d.ts +21 -1
- package/dist/cjs/api/types/HumeAiTtsParams.js +9 -0
- package/dist/cjs/api/types/Llm.d.ts +58 -0
- package/dist/cjs/api/types/Llm.js +15 -0
- package/dist/cjs/api/types/LlmParams.d.ts +11 -0
- package/dist/cjs/api/types/LlmParams.js +3 -0
- package/dist/cjs/api/types/MicrosoftAsr.d.ts +10 -0
- package/dist/cjs/api/types/MicrosoftAsr.js +3 -0
- package/dist/cjs/api/types/MicrosoftAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/MicrosoftAsrParams.js +3 -0
- package/dist/cjs/api/types/MicrosoftTtsParams.d.ts +6 -0
- package/dist/cjs/api/types/MinimaxTtsParams.d.ts +4 -0
- package/dist/cjs/api/types/Mllm.d.ts +44 -0
- package/dist/cjs/api/types/Mllm.js +14 -0
- package/dist/cjs/api/types/MllmHttpOptions.d.ts +9 -0
- package/dist/cjs/api/types/MllmHttpOptions.js +3 -0
- package/dist/cjs/api/types/MllmInputAudioTranscription.d.ts +13 -0
- package/dist/cjs/api/types/MllmInputAudioTranscription.js +3 -0
- package/dist/cjs/api/types/MllmParams.d.ts +28 -0
- package/dist/cjs/api/types/MllmParams.js +3 -0
- package/dist/cjs/api/types/MllmTurnDetection.d.ts +65 -0
- package/dist/cjs/api/types/MllmTurnDetection.js +33 -0
- package/dist/cjs/api/types/MurfTtsParams.d.ts +17 -5
- package/dist/cjs/api/types/OpenAiAsr.d.ts +10 -0
- package/dist/cjs/api/types/OpenAiAsr.js +3 -0
- package/dist/cjs/api/types/OpenAiAsrParams.d.ts +11 -0
- package/dist/cjs/api/types/OpenAiAsrParams.js +3 -0
- package/dist/cjs/api/types/OpenAiInputAudioTranscription.d.ts +13 -0
- package/dist/cjs/api/types/OpenAiInputAudioTranscription.js +3 -0
- package/dist/cjs/api/types/OpenAiTtsParams.d.ts +9 -1
- package/dist/cjs/api/types/RimeTtsParams.d.ts +7 -3
- package/dist/cjs/api/types/SarvamAsr.d.ts +10 -0
- package/dist/cjs/api/types/SarvamAsr.js +3 -0
- package/dist/cjs/api/types/SarvamAsrParams.d.ts +11 -0
- package/dist/cjs/api/types/SarvamAsrParams.js +3 -0
- package/dist/cjs/api/types/SarvamTtsParams.d.ts +29 -2
- package/dist/cjs/api/types/SarvamTtsParams.js +18 -0
- package/dist/cjs/api/types/SpeechmaticsAsr.d.ts +10 -0
- package/dist/cjs/api/types/SpeechmaticsAsr.js +3 -0
- package/dist/cjs/api/types/SpeechmaticsAsrParams.d.ts +13 -0
- package/dist/cjs/api/types/SpeechmaticsAsrParams.js +3 -0
- package/dist/cjs/api/types/index.d.ts +31 -0
- package/dist/cjs/api/types/index.js +31 -0
- package/dist/cjs/core/base64.js +5 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/AgoraPoolClient.mjs +7 -2
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.mjs +16 -8
- package/dist/esm/agentkit/Agent.d.mts +56 -11
- package/dist/esm/agentkit/Agent.mjs +114 -15
- package/dist/esm/agentkit/AgentSession.d.mts +4 -3
- package/dist/esm/agentkit/AgentSession.mjs +40 -11
- package/dist/esm/agentkit/__tests__/type-safety.test.mjs +23 -3
- package/dist/esm/agentkit/constants.d.mts +5 -4
- package/dist/esm/agentkit/constants.mjs +5 -4
- package/dist/esm/agentkit/index.d.mts +1 -1
- package/dist/esm/agentkit/presets.d.mts +30 -0
- package/dist/esm/agentkit/presets.mjs +9 -6
- package/dist/esm/agentkit/types.d.mts +50 -35
- package/dist/esm/agentkit/vendors/avatar.d.mts +3 -1
- package/dist/esm/agentkit/vendors/avatar.mjs +3 -1
- package/dist/esm/agentkit/vendors/llm.d.mts +18 -8
- package/dist/esm/agentkit/vendors/llm.mjs +83 -15
- package/dist/esm/agentkit/vendors/mllm.d.mts +16 -0
- package/dist/esm/agentkit/vendors/mllm.mjs +11 -7
- package/dist/esm/agentkit/vendors/stt.d.mts +29 -11
- package/dist/esm/agentkit/vendors/stt.mjs +74 -53
- package/dist/esm/agentkit/vendors/tts.d.mts +70 -22
- package/dist/esm/agentkit/vendors/tts.mjs +67 -34
- package/dist/esm/api/resources/agents/client/Client.d.mts +3 -2
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -2
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +8 -331
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +0 -107
- package/dist/esm/api/types/AmazonAsr.d.mts +10 -0
- package/dist/esm/api/types/AmazonAsr.mjs +2 -0
- package/dist/esm/api/types/AmazonAsrParams.d.mts +19 -0
- package/dist/esm/api/types/AmazonAsrParams.mjs +2 -0
- package/dist/esm/api/types/AmazonTtsParams.d.mts +19 -5
- package/dist/esm/api/types/AmazonTtsParams.mjs +10 -1
- package/dist/esm/api/types/AresAsr.d.mts +10 -0
- package/dist/esm/api/types/AresAsr.mjs +2 -0
- package/dist/esm/api/types/AresAsrParams.d.mts +4 -0
- package/dist/esm/api/types/AresAsrParams.mjs +2 -0
- package/dist/esm/api/types/Asr.d.mts +31 -0
- package/dist/esm/api/types/Asr.mjs +2 -0
- package/dist/esm/api/types/AsrLanguage.d.mts +36 -0
- package/dist/esm/api/types/AsrLanguage.mjs +36 -0
- package/dist/esm/api/types/AssemblyAiAsr.d.mts +10 -0
- package/dist/esm/api/types/AssemblyAiAsr.mjs +2 -0
- package/dist/esm/api/types/AssemblyAiAsrParams.d.mts +13 -0
- package/dist/esm/api/types/AssemblyAiAsrParams.mjs +2 -0
- package/dist/esm/api/types/CartesiaTtsOutputFormat.d.mts +11 -0
- package/dist/esm/api/types/CartesiaTtsOutputFormat.mjs +2 -0
- package/dist/esm/api/types/CartesiaTtsParams.d.mts +9 -4
- package/dist/esm/api/types/CartesiaTtsVoice.d.mts +2 -0
- package/dist/esm/api/types/DeepgramAsr.d.mts +12 -0
- package/dist/esm/api/types/DeepgramAsr.mjs +2 -0
- package/dist/esm/api/types/DeepgramAsrParams.d.mts +17 -0
- package/dist/esm/api/types/DeepgramAsrParams.mjs +2 -0
- package/dist/esm/api/types/DeepgramTtsParams.d.mts +2 -2
- package/dist/esm/api/types/ElevenLabsTtsParams.d.mts +13 -1
- package/dist/esm/api/types/FishAudioTtsParams.d.mts +5 -1
- package/dist/esm/api/types/GoogleAsr.d.mts +10 -0
- package/dist/esm/api/types/GoogleAsr.mjs +2 -0
- package/dist/esm/api/types/GoogleAsrParams.d.mts +17 -0
- package/dist/esm/api/types/GoogleAsrParams.mjs +2 -0
- package/dist/esm/api/types/GoogleTtsAudioConfig.d.mts +11 -0
- package/dist/esm/api/types/GoogleTtsAudioConfig.mjs +2 -0
- package/dist/esm/api/types/GoogleTtsParams.d.mts +7 -8
- package/dist/esm/api/types/GoogleTtsVoiceSelectionParams.d.mts +9 -0
- package/dist/esm/api/types/GoogleTtsVoiceSelectionParams.mjs +2 -0
- package/dist/esm/api/types/HumeAiTtsParams.d.mts +21 -1
- package/dist/esm/api/types/HumeAiTtsParams.mjs +8 -1
- package/dist/esm/api/types/Llm.d.mts +58 -0
- package/dist/esm/api/types/Llm.mjs +12 -0
- package/dist/esm/api/types/LlmParams.d.mts +11 -0
- package/dist/esm/api/types/LlmParams.mjs +2 -0
- package/dist/esm/api/types/MicrosoftAsr.d.mts +10 -0
- package/dist/esm/api/types/MicrosoftAsr.mjs +2 -0
- package/dist/esm/api/types/MicrosoftAsrParams.d.mts +15 -0
- package/dist/esm/api/types/MicrosoftAsrParams.mjs +2 -0
- package/dist/esm/api/types/MicrosoftTtsParams.d.mts +6 -0
- package/dist/esm/api/types/MinimaxTtsParams.d.mts +4 -0
- package/dist/esm/api/types/Mllm.d.mts +44 -0
- package/dist/esm/api/types/Mllm.mjs +11 -0
- package/dist/esm/api/types/MllmHttpOptions.d.mts +9 -0
- package/dist/esm/api/types/MllmHttpOptions.mjs +2 -0
- package/dist/esm/api/types/MllmInputAudioTranscription.d.mts +13 -0
- package/dist/esm/api/types/MllmInputAudioTranscription.mjs +2 -0
- package/dist/esm/api/types/MllmParams.d.mts +28 -0
- package/dist/esm/api/types/MllmParams.mjs +2 -0
- package/dist/esm/api/types/MllmTurnDetection.d.mts +65 -0
- package/dist/esm/api/types/MllmTurnDetection.mjs +30 -0
- package/dist/esm/api/types/MurfTtsParams.d.mts +17 -5
- package/dist/esm/api/types/OpenAiAsr.d.mts +10 -0
- package/dist/esm/api/types/OpenAiAsr.mjs +2 -0
- package/dist/esm/api/types/OpenAiAsrParams.d.mts +11 -0
- package/dist/esm/api/types/OpenAiAsrParams.mjs +2 -0
- package/dist/esm/api/types/OpenAiInputAudioTranscription.d.mts +13 -0
- package/dist/esm/api/types/OpenAiInputAudioTranscription.mjs +2 -0
- package/dist/esm/api/types/OpenAiTtsParams.d.mts +9 -1
- package/dist/esm/api/types/RimeTtsParams.d.mts +7 -3
- package/dist/esm/api/types/SarvamAsr.d.mts +10 -0
- package/dist/esm/api/types/SarvamAsr.mjs +2 -0
- package/dist/esm/api/types/SarvamAsrParams.d.mts +11 -0
- package/dist/esm/api/types/SarvamAsrParams.mjs +2 -0
- package/dist/esm/api/types/SarvamTtsParams.d.mts +29 -2
- package/dist/esm/api/types/SarvamTtsParams.mjs +17 -1
- package/dist/esm/api/types/SpeechmaticsAsr.d.mts +10 -0
- package/dist/esm/api/types/SpeechmaticsAsr.mjs +2 -0
- package/dist/esm/api/types/SpeechmaticsAsrParams.d.mts +13 -0
- package/dist/esm/api/types/SpeechmaticsAsrParams.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +31 -0
- package/dist/esm/api/types/index.mjs +31 -0
- package/dist/esm/core/base64.mjs +5 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- 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({
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
49
|
+
export declare const MllmTurnDetectionModeValues: typeof MllmTurnDetectionNS.Mode;
|
|
49
50
|
/** MLLM turn-detection mode: Agora VAD. */
|
|
50
|
-
export declare const MllmTurnDetectionModeAgoraVad:
|
|
51
|
+
export declare const MllmTurnDetectionModeAgoraVad: MllmTurnDetectionNS.Mode;
|
|
51
52
|
/** MLLM turn-detection mode: server/vendor VAD. */
|
|
52
|
-
export declare const MllmTurnDetectionModeServerVad:
|
|
53
|
+
export declare const MllmTurnDetectionModeServerVad: MllmTurnDetectionNS.Mode;
|
|
53
54
|
/** MLLM turn-detection mode: semantic VAD. */
|
|
54
|
-
export declare const MllmTurnDetectionModeSemanticVad:
|
|
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 =
|
|
50
|
+
export const MllmTurnDetectionModeValues = MllmTurnDetectionNS.Mode;
|
|
50
51
|
/** MLLM turn-detection mode: Agora VAD. */
|
|
51
|
-
export const MllmTurnDetectionModeAgoraVad =
|
|
52
|
+
export const MllmTurnDetectionModeAgoraVad = MllmTurnDetectionNS.Mode.AgoraVad;
|
|
52
53
|
/** MLLM turn-detection mode: server/vendor VAD. */
|
|
53
|
-
export const MllmTurnDetectionModeServerVad =
|
|
54
|
+
export const MllmTurnDetectionModeServerVad = MllmTurnDetectionNS.Mode.ServerVad;
|
|
54
55
|
/** MLLM turn-detection mode: semantic VAD. */
|
|
55
|
-
export const MllmTurnDetectionModeSemanticVad =
|
|
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
|
-
|
|
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 =
|
|
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?:
|
|
17
|
+
language?: TurnDetectionLanguage;
|
|
18
18
|
params: SpeechmaticsParams;
|
|
19
19
|
} | {
|
|
20
20
|
vendor: "deepgram";
|
|
21
|
-
language?:
|
|
22
|
-
params
|
|
21
|
+
language?: TurnDetectionLanguage;
|
|
22
|
+
params: DeepgramParams;
|
|
23
23
|
} | {
|
|
24
24
|
vendor: "microsoft";
|
|
25
|
-
language?:
|
|
25
|
+
language?: TurnDetectionLanguage;
|
|
26
26
|
params: MicrosoftAsrParams;
|
|
27
27
|
} | {
|
|
28
28
|
vendor: "openai";
|
|
29
|
-
language?:
|
|
29
|
+
language?: TurnDetectionLanguage;
|
|
30
30
|
params: OpenAiAsrParams;
|
|
31
31
|
} | {
|
|
32
32
|
vendor: "google";
|
|
33
|
-
language?:
|
|
33
|
+
language?: TurnDetectionLanguage;
|
|
34
34
|
params: GoogleAsrParams;
|
|
35
35
|
} | {
|
|
36
36
|
vendor: "amazon";
|
|
37
|
-
language?:
|
|
37
|
+
language?: TurnDetectionLanguage;
|
|
38
38
|
params: AmazonAsrParams;
|
|
39
39
|
} | {
|
|
40
40
|
vendor: "assemblyai";
|
|
41
|
-
language?:
|
|
42
|
-
params
|
|
41
|
+
language?: TurnDetectionLanguage;
|
|
42
|
+
params: AssemblyAiParams;
|
|
43
43
|
} | {
|
|
44
44
|
vendor: "ares";
|
|
45
|
-
language?:
|
|
45
|
+
language?: TurnDetectionLanguage;
|
|
46
46
|
params?: AresParams;
|
|
47
47
|
} | {
|
|
48
48
|
vendor: "sarvam";
|
|
49
|
-
language?:
|
|
50
|
-
params
|
|
51
|
-
} |
|
|
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 =
|
|
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 =
|
|
59
|
+
export type MllmConfig = Mllm;
|
|
60
60
|
/** MLLM vendor (openai, gemini, vertexai, xai) */
|
|
61
|
-
export type MllmVendor =
|
|
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 =
|
|
137
|
+
export type MllmTurnDetectionConfig = MllmTurnDetection;
|
|
136
138
|
/** MLLM turn-detection mode (`agora_vad` | `server_vad` | `semantic_vad`) */
|
|
137
|
-
export type MllmTurnDetectionMode =
|
|
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 =
|
|
183
|
+
export type LlmGreetingConfigs = Record<string, unknown>;
|
|
182
184
|
/** Greeting broadcast mode: `"single_every"` | `"single_first"` */
|
|
183
|
-
export type LlmGreetingConfigsMode =
|
|
185
|
+
export type LlmGreetingConfigsMode = string;
|
|
184
186
|
/** MCP server config item (`llm.mcp_servers[]`) */
|
|
185
|
-
export type McpServersItem =
|
|
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
|
|
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
|
-
}) |
|
|
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
|
-
|
|
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
|
-
/**
|
|
427
|
-
|
|
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
|
|
437
|
-
|
|
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
|
-
|
|
464
|
+
access_key_id: string;
|
|
450
465
|
/** AWS Secret Access Key (required) */
|
|
451
|
-
|
|
466
|
+
secret_access_key: string;
|
|
452
467
|
/** AWS region (e.g., 'us-east-1') (required) */
|
|
453
468
|
region: string;
|
|
454
469
|
/** Language code */
|
|
455
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
124
|
-
url
|
|
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
|
|
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
|
|
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
|
-
|
|
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;
|