agora-agents 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/agentkit/Agent.d.ts +49 -9
- package/dist/cjs/agentkit/Agent.js +92 -7
- package/dist/cjs/agentkit/AgentSession.d.ts +3 -3
- package/dist/cjs/agentkit/AgentSession.js +8 -7
- 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/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/index.d.ts +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/agentkit/Agent.d.mts +49 -9
- package/dist/esm/agentkit/Agent.mjs +92 -7
- package/dist/esm/agentkit/AgentSession.d.mts +3 -3
- package/dist/esm/agentkit/AgentSession.mjs +8 -7
- 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/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/index.d.mts +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +3 -2
|
@@ -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;
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type-safe LLM (Large Language Model) vendor classes.
|
|
3
3
|
*/
|
|
4
|
+
import { OpenAIPresetModels } from "../presets.mjs";
|
|
4
5
|
import { BaseLLM } from "./base.mjs";
|
|
6
|
+
function requireString(value, field, vendor) {
|
|
7
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
8
|
+
throw new Error(`${vendor} requires ${field}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function requireNumber(value, field, vendor) {
|
|
12
|
+
if (typeof value !== "number" || Number.isNaN(value)) {
|
|
13
|
+
throw new Error(`${vendor} requires ${field}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function requireRecord(value, field, vendor) {
|
|
17
|
+
if (value == null || typeof value !== "object" || Array.isArray(value)) {
|
|
18
|
+
throw new Error(`${vendor} requires ${field}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function isOpenAIManagedModel(model) {
|
|
22
|
+
return OpenAIPresetModels.includes(model.trim().toLowerCase());
|
|
23
|
+
}
|
|
5
24
|
/**
|
|
6
25
|
* OpenAI LLM vendor (and OpenAI-compatible APIs).
|
|
7
26
|
*
|
|
@@ -10,12 +29,28 @@ import { BaseLLM } from "./base.mjs";
|
|
|
10
29
|
* const llm = new OpenAI({
|
|
11
30
|
* apiKey: process.env.OPENAI_API_KEY,
|
|
12
31
|
* model: 'gpt-4o',
|
|
32
|
+
* url: 'https://api.openai.com/v1/chat/completions',
|
|
13
33
|
* });
|
|
14
34
|
* ```
|
|
15
35
|
*/
|
|
16
36
|
export class OpenAI extends BaseLLM {
|
|
17
37
|
constructor(options) {
|
|
18
38
|
super(options);
|
|
39
|
+
requireString(options.model, "model", "OpenAI");
|
|
40
|
+
if (options.apiKey) {
|
|
41
|
+
requireString(options.url, "url", "OpenAI");
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (!isOpenAIManagedModel(options.model)) {
|
|
45
|
+
throw new Error("OpenAI requires apiKey unless using a supported Agora-managed model");
|
|
46
|
+
}
|
|
47
|
+
if (options.url) {
|
|
48
|
+
throw new Error("OpenAI Agora-managed mode does not allow url");
|
|
49
|
+
}
|
|
50
|
+
if (options.vendor) {
|
|
51
|
+
throw new Error("OpenAI Agora-managed mode does not allow vendor");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
19
54
|
this.options = options;
|
|
20
55
|
}
|
|
21
56
|
toConfig() {
|
|
@@ -41,6 +76,10 @@ export class OpenAI extends BaseLLM {
|
|
|
41
76
|
export class AzureOpenAI extends BaseLLM {
|
|
42
77
|
constructor(options) {
|
|
43
78
|
super(options);
|
|
79
|
+
requireString(options.apiKey, "apiKey", "AzureOpenAI");
|
|
80
|
+
requireString(options.model, "model", "AzureOpenAI");
|
|
81
|
+
requireString(options.resourceName, "resourceName", "AzureOpenAI");
|
|
82
|
+
requireString(options.deploymentName, "deploymentName", "AzureOpenAI");
|
|
44
83
|
this.options = options;
|
|
45
84
|
}
|
|
46
85
|
toConfig() {
|
|
@@ -75,18 +114,26 @@ export class AzureOpenAI extends BaseLLM {
|
|
|
75
114
|
* const llm = new Anthropic({
|
|
76
115
|
* apiKey: process.env.ANTHROPIC_API_KEY,
|
|
77
116
|
* model: 'claude-3-5-sonnet-20241022',
|
|
117
|
+
* url: 'https://api.anthropic.com/v1/messages',
|
|
118
|
+
* headers: { 'anthropic-version': '2023-06-01' },
|
|
119
|
+
* maxTokens: 1024,
|
|
78
120
|
* });
|
|
79
121
|
* ```
|
|
80
122
|
*/
|
|
81
123
|
export class Anthropic extends BaseLLM {
|
|
82
124
|
constructor(options) {
|
|
83
125
|
super(options);
|
|
126
|
+
requireString(options.apiKey, "apiKey", "Anthropic");
|
|
127
|
+
requireString(options.model, "model", "Anthropic");
|
|
128
|
+
requireString(options.url, "url", "Anthropic");
|
|
129
|
+
requireRecord(options.headers, "headers", "Anthropic");
|
|
130
|
+
requireNumber(options.maxTokens, "maxTokens", "Anthropic");
|
|
84
131
|
this.options = options;
|
|
85
132
|
}
|
|
86
133
|
toConfig() {
|
|
87
134
|
const { apiKey, model, url, maxHistory, maxTokens, temperature, topP, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
|
|
88
135
|
return {
|
|
89
|
-
url
|
|
136
|
+
url,
|
|
90
137
|
api_key: apiKey,
|
|
91
138
|
// model is the default; params entries extend it; named fields win.
|
|
92
139
|
params: Object.assign(Object.assign(Object.assign(Object.assign({ model }, params), (maxTokens !== undefined && { max_tokens: maxTokens })), (temperature !== undefined && { temperature })), (topP !== undefined && { top_p: topP })),
|
|
@@ -119,6 +166,8 @@ export class Anthropic extends BaseLLM {
|
|
|
119
166
|
export class Gemini extends BaseLLM {
|
|
120
167
|
constructor(options) {
|
|
121
168
|
super(options);
|
|
169
|
+
requireString(options.apiKey, "apiKey", "Gemini");
|
|
170
|
+
requireString(options.model, "model", "Gemini");
|
|
122
171
|
this.options = options;
|
|
123
172
|
}
|
|
124
173
|
toConfig() {
|
|
@@ -143,10 +192,10 @@ export class Gemini extends BaseLLM {
|
|
|
143
192
|
};
|
|
144
193
|
}
|
|
145
194
|
}
|
|
146
|
-
function openAIStyleConfig(options,
|
|
147
|
-
var _a, _b
|
|
195
|
+
function openAIStyleConfig(options, vendor) {
|
|
196
|
+
var _a, _b;
|
|
148
197
|
return {
|
|
149
|
-
url:
|
|
198
|
+
url: options.url,
|
|
150
199
|
api_key: options.apiKey,
|
|
151
200
|
params: Object.assign(Object.assign(Object.assign(Object.assign({ model: options.model }, options.params), (options.temperature !== undefined && { temperature: options.temperature })), (options.topP !== undefined && { top_p: options.topP })), (options.maxTokens !== undefined && { max_tokens: options.maxTokens })),
|
|
152
201
|
headers: options.headers,
|
|
@@ -154,10 +203,10 @@ function openAIStyleConfig(options, defaultUrl, vendor) {
|
|
|
154
203
|
system_messages: options.systemMessages,
|
|
155
204
|
greeting_message: options.greetingMessage,
|
|
156
205
|
failure_message: options.failureMessage,
|
|
157
|
-
input_modalities: (
|
|
206
|
+
input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"],
|
|
158
207
|
output_modalities: options.outputModalities,
|
|
159
208
|
style: "openai",
|
|
160
|
-
vendor: (
|
|
209
|
+
vendor: (_b = options.vendor) !== null && _b !== void 0 ? _b : vendor,
|
|
161
210
|
greeting_configs: options.greetingConfigs,
|
|
162
211
|
template_variables: options.templateVariables,
|
|
163
212
|
mcp_servers: options.mcpServers,
|
|
@@ -167,25 +216,34 @@ export class Groq extends BaseLLM {
|
|
|
167
216
|
constructor(options) {
|
|
168
217
|
super(options);
|
|
169
218
|
this.options = options;
|
|
219
|
+
requireString(options.apiKey, "apiKey", "Groq");
|
|
220
|
+
requireString(options.model, "model", "Groq");
|
|
221
|
+
requireString(options.url, "url", "Groq");
|
|
170
222
|
}
|
|
171
223
|
toConfig() {
|
|
172
|
-
return openAIStyleConfig(this.options
|
|
224
|
+
return openAIStyleConfig(this.options);
|
|
173
225
|
}
|
|
174
226
|
}
|
|
175
227
|
export class CustomLLM extends BaseLLM {
|
|
176
228
|
constructor(options) {
|
|
177
229
|
super(options);
|
|
178
230
|
this.options = options;
|
|
231
|
+
requireString(options.apiKey, "apiKey", "CustomLLM");
|
|
232
|
+
requireString(options.model, "model", "CustomLLM");
|
|
233
|
+
requireString(options.url, "url", "CustomLLM");
|
|
179
234
|
}
|
|
180
235
|
toConfig() {
|
|
181
|
-
|
|
182
|
-
return openAIStyleConfig(this.options, (_a = this.options.url) !== null && _a !== void 0 ? _a : "", "custom");
|
|
236
|
+
return openAIStyleConfig(this.options, "custom");
|
|
183
237
|
}
|
|
184
238
|
}
|
|
185
239
|
export class VertexAILLM extends BaseLLM {
|
|
186
240
|
constructor(options) {
|
|
187
241
|
super(options);
|
|
188
242
|
this.options = options;
|
|
243
|
+
requireString(options.apiKey, "apiKey", "VertexAILLM");
|
|
244
|
+
requireString(options.model, "model", "VertexAILLM");
|
|
245
|
+
requireString(options.projectId, "projectId", "VertexAILLM");
|
|
246
|
+
requireString(options.location, "location", "VertexAILLM");
|
|
189
247
|
}
|
|
190
248
|
toConfig() {
|
|
191
249
|
var _a, _b;
|
|
@@ -193,7 +251,7 @@ export class VertexAILLM extends BaseLLM {
|
|
|
193
251
|
return {
|
|
194
252
|
url: (_a = o.url) !== null && _a !== void 0 ? _a : "https://aiplatform.googleapis.com/v1/projects",
|
|
195
253
|
api_key: o.apiKey,
|
|
196
|
-
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: o.model, project_id: o.projectId, location: o.location }, o.params), (o.temperature !== undefined && { temperature: o.temperature })), (o.topP !== undefined && {
|
|
254
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: o.model, project_id: o.projectId, location: o.location }, o.params), (o.temperature !== undefined && { temperature: o.temperature })), (o.topP !== undefined && { top_p: o.topP })), (o.topK !== undefined && { top_k: o.topK })), (o.maxOutputTokens !== undefined && { max_output_tokens: o.maxOutputTokens })),
|
|
197
255
|
headers: o.headers,
|
|
198
256
|
max_history: o.maxHistory,
|
|
199
257
|
system_messages: o.systemMessages,
|
|
@@ -213,14 +271,21 @@ export class AmazonBedrock extends BaseLLM {
|
|
|
213
271
|
constructor(options) {
|
|
214
272
|
super(options);
|
|
215
273
|
this.options = options;
|
|
274
|
+
requireString(options.accessKey, "accessKey", "AmazonBedrock");
|
|
275
|
+
requireString(options.secretKey, "secretKey", "AmazonBedrock");
|
|
276
|
+
requireString(options.region, "region", "AmazonBedrock");
|
|
277
|
+
requireString(options.model, "model", "AmazonBedrock");
|
|
216
278
|
}
|
|
217
279
|
toConfig() {
|
|
218
280
|
var _a;
|
|
219
281
|
const o = this.options;
|
|
220
282
|
return {
|
|
221
|
-
url: o.
|
|
222
|
-
|
|
223
|
-
|
|
283
|
+
url: `https://bedrock-runtime.${o.region}.amazonaws.com/model/${o.model}/converse-stream`,
|
|
284
|
+
access_key: o.accessKey,
|
|
285
|
+
secret_key: o.secretKey,
|
|
286
|
+
region: o.region,
|
|
287
|
+
model: o.model,
|
|
288
|
+
params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, o.params), (o.maxTokens !== undefined && { max_tokens: o.maxTokens })), (o.temperature !== undefined && { temperature: o.temperature })), (o.topP !== undefined && { top_p: o.topP })), (o.topK !== undefined && { top_k: o.topK })),
|
|
224
289
|
headers: o.headers,
|
|
225
290
|
max_history: o.maxHistory,
|
|
226
291
|
system_messages: o.systemMessages,
|
|
@@ -228,7 +293,7 @@ export class AmazonBedrock extends BaseLLM {
|
|
|
228
293
|
failure_message: o.failureMessage,
|
|
229
294
|
input_modalities: (_a = o.inputModalities) !== null && _a !== void 0 ? _a : ["text"],
|
|
230
295
|
output_modalities: this.outputModalities,
|
|
231
|
-
style: "
|
|
296
|
+
style: "bedrock",
|
|
232
297
|
vendor: this.vendor,
|
|
233
298
|
greeting_configs: this.greetingConfigs,
|
|
234
299
|
template_variables: this.templateVariables,
|
|
@@ -240,6 +305,9 @@ export class Dify extends BaseLLM {
|
|
|
240
305
|
constructor(options) {
|
|
241
306
|
super(options);
|
|
242
307
|
this.options = options;
|
|
308
|
+
requireString(options.apiKey, "apiKey", "Dify");
|
|
309
|
+
requireString(options.url, "url", "Dify");
|
|
310
|
+
requireString(options.model, "model", "Dify");
|
|
243
311
|
}
|
|
244
312
|
toConfig() {
|
|
245
313
|
var _a;
|
|
@@ -247,7 +315,7 @@ export class Dify extends BaseLLM {
|
|
|
247
315
|
return {
|
|
248
316
|
url: o.url,
|
|
249
317
|
api_key: o.apiKey,
|
|
250
|
-
params: Object.assign(Object.assign(Object.assign({}, o.params), (o.user !== undefined && { user: o.user })), (o.conversationId !== undefined && { conversation_id: o.conversationId })),
|
|
318
|
+
params: Object.assign(Object.assign(Object.assign({ model: o.model }, o.params), (o.user !== undefined && { user: o.user })), (o.conversationId !== undefined && { conversation_id: o.conversationId })),
|
|
251
319
|
headers: o.headers,
|
|
252
320
|
max_history: o.maxHistory,
|
|
253
321
|
system_messages: o.systemMessages,
|
|
@@ -15,6 +15,12 @@ export interface OpenAIRealtimeOptions {
|
|
|
15
15
|
apiKey: string;
|
|
16
16
|
/** Model name (e.g., 'gpt-4o-realtime-preview') */
|
|
17
17
|
model?: string;
|
|
18
|
+
/** Voice identifier for audio output */
|
|
19
|
+
voice?: string;
|
|
20
|
+
/** System instructions that define agent behavior */
|
|
21
|
+
instructions?: string;
|
|
22
|
+
/** Audio transcription settings */
|
|
23
|
+
inputAudioTranscription?: Record<string, unknown>;
|
|
18
24
|
/** WebSocket URL for real-time communication */
|
|
19
25
|
url?: string;
|
|
20
26
|
/** Agent greeting message */
|
|
@@ -63,6 +69,11 @@ export interface GeminiLiveOptions {
|
|
|
63
69
|
instructions?: string;
|
|
64
70
|
/** Voice name (e.g., 'Aoede', 'Charon') */
|
|
65
71
|
voice?: string;
|
|
72
|
+
affectiveDialog?: boolean;
|
|
73
|
+
proactiveAudio?: boolean;
|
|
74
|
+
transcribeAgent?: boolean;
|
|
75
|
+
transcribeUser?: boolean;
|
|
76
|
+
httpOptions?: Record<string, unknown>;
|
|
66
77
|
/** Agent greeting message */
|
|
67
78
|
greetingMessage?: string;
|
|
68
79
|
/** Input modalities (e.g., ['audio'], ['audio', 'text']) */
|
|
@@ -116,6 +127,11 @@ export interface VertexAIOptions {
|
|
|
116
127
|
instructions?: string;
|
|
117
128
|
/** Voice name (e.g., 'Aoede', 'Charon') */
|
|
118
129
|
voice?: string;
|
|
130
|
+
affectiveDialog?: boolean;
|
|
131
|
+
proactiveAudio?: boolean;
|
|
132
|
+
transcribeAgent?: boolean;
|
|
133
|
+
transcribeUser?: boolean;
|
|
134
|
+
httpOptions?: Record<string, unknown>;
|
|
119
135
|
/** Agent greeting message */
|
|
120
136
|
greetingMessage?: string;
|
|
121
137
|
/** Input modalities (e.g., ['audio'], ['audio', 'text']) */
|