agora-agents 2.9.0 → 2.10.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/agentkit/Agent.js +3 -3
- package/dist/cjs/agentkit/index.d.ts +8 -10
- package/dist/cjs/agentkit/index.js +10 -8
- package/dist/cjs/agentkit/preview/client.d.ts +6 -18
- package/dist/cjs/agentkit/preview/client.js +17 -84
- package/dist/cjs/agentkit/preview/index.d.ts +4 -2
- package/dist/cjs/agentkit/preview/index.js +4 -2
- package/dist/cjs/agentkit/preview/vendors.d.ts +8 -104
- package/dist/cjs/agentkit/preview/vendors.js +14 -115
- package/dist/cjs/agentkit/types.d.ts +10 -4
- package/dist/cjs/agentkit/vendors/base.d.ts +15 -4
- package/dist/cjs/agentkit/vendors/base.js +16 -5
- package/dist/cjs/agentkit/vendors/cn.js +2 -2
- package/dist/cjs/agentkit/vendors/llm.js +2 -2
- package/dist/cjs/agentkit/vendors/mllm.d.ts +92 -10
- package/dist/cjs/agentkit/vendors/mllm.js +115 -18
- package/dist/cjs/agentkit/vendors/stt.d.ts +41 -0
- package/dist/cjs/agentkit/vendors/stt.js +18 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +27 -0
- package/dist/cjs/agentkit/vendors/tts.js +16 -1
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +11 -5
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +3 -1
- package/dist/cjs/api/types/AnamAvatarParams.d.ts +42 -0
- package/dist/cjs/api/types/AnamAvatarParams.js +18 -0
- package/dist/cjs/api/types/Asr.d.ts +4 -1
- package/dist/cjs/api/types/LlmTool.d.ts +7 -0
- package/dist/cjs/api/types/McpServer.d.ts +24 -0
- package/dist/cjs/api/types/McpServer.js +3 -0
- package/dist/cjs/api/types/Mllm.d.ts +14 -0
- package/dist/cjs/api/types/SmallestAiAsr.d.ts +11 -0
- package/dist/cjs/api/types/SmallestAiAsr.js +3 -0
- package/dist/cjs/api/types/SmallestAiAsrParams.d.ts +49 -0
- package/dist/cjs/api/types/SmallestAiAsrParams.js +3 -0
- package/dist/cjs/api/types/SmallestAiTts.d.ts +9 -0
- package/dist/cjs/api/types/SmallestAiTts.js +3 -0
- package/dist/cjs/api/types/SmallestAiTtsParams.d.ts +31 -0
- package/dist/cjs/api/types/SmallestAiTtsParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +4 -1
- package/dist/cjs/api/types/index.d.ts +6 -0
- package/dist/cjs/api/types/index.js +6 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +6 -3
- 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.mjs +2 -2
- package/dist/esm/agentkit/index.d.mts +8 -10
- package/dist/esm/agentkit/index.mjs +3 -4
- package/dist/esm/agentkit/preview/client.d.mts +6 -18
- package/dist/esm/agentkit/preview/client.mjs +17 -84
- package/dist/esm/agentkit/preview/index.d.mts +4 -2
- package/dist/esm/agentkit/preview/index.mjs +2 -1
- package/dist/esm/agentkit/preview/vendors.d.mts +8 -104
- package/dist/esm/agentkit/preview/vendors.mjs +5 -112
- package/dist/esm/agentkit/types.d.mts +10 -4
- package/dist/esm/agentkit/vendors/base.d.mts +15 -4
- package/dist/esm/agentkit/vendors/base.mjs +16 -5
- package/dist/esm/agentkit/vendors/cn.mjs +2 -2
- package/dist/esm/agentkit/vendors/llm.mjs +2 -2
- package/dist/esm/agentkit/vendors/mllm.d.mts +92 -10
- package/dist/esm/agentkit/vendors/mllm.mjs +111 -16
- package/dist/esm/agentkit/vendors/stt.d.mts +41 -0
- package/dist/esm/agentkit/vendors/stt.mjs +16 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +27 -0
- package/dist/esm/agentkit/vendors/tts.mjs +14 -0
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +11 -5
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +3 -1
- package/dist/esm/api/types/AnamAvatarParams.d.mts +42 -0
- package/dist/esm/api/types/AnamAvatarParams.mjs +15 -0
- package/dist/esm/api/types/Asr.d.mts +4 -1
- package/dist/esm/api/types/LlmTool.d.mts +7 -0
- package/dist/esm/api/types/McpServer.d.mts +24 -0
- package/dist/esm/api/types/McpServer.mjs +2 -0
- package/dist/esm/api/types/Mllm.d.mts +14 -0
- package/dist/esm/api/types/SmallestAiAsr.d.mts +11 -0
- package/dist/esm/api/types/SmallestAiAsr.mjs +2 -0
- package/dist/esm/api/types/SmallestAiAsrParams.d.mts +49 -0
- package/dist/esm/api/types/SmallestAiAsrParams.mjs +2 -0
- package/dist/esm/api/types/SmallestAiTts.d.mts +9 -0
- package/dist/esm/api/types/SmallestAiTts.mjs +2 -0
- package/dist/esm/api/types/SmallestAiTtsParams.d.mts +31 -0
- package/dist/esm/api/types/SmallestAiTtsParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +4 -1
- package/dist/esm/api/types/index.d.mts +6 -0
- package/dist/esm/api/types/index.mjs +6 -0
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
import { Area } from "../core/domain/index.mjs";
|
|
9
9
|
import { AgentSession } from "./AgentSession.mjs";
|
|
10
10
|
import { AudioScenario } from "./constants.mjs";
|
|
11
|
-
import { isOpenAIGPTLiveConfig } from "./preview/vendors.mjs";
|
|
12
11
|
import { generateConvoAIToken } from "./token.mjs";
|
|
12
|
+
import { isOpenAIGPTLiveConfig } from "./vendors/mllm.mjs";
|
|
13
13
|
const DEFAULT_TURN_DETECTION_LANGUAGE = "en-US";
|
|
14
14
|
function toGeneratedMllm(config) {
|
|
15
|
-
//
|
|
15
|
+
// GPT Live is not yet present in the generated schema enum. Keep the assertion at
|
|
16
16
|
// this wire boundary so the public and builder APIs remain accurately typed.
|
|
17
17
|
return config;
|
|
18
18
|
}
|
|
@@ -31,23 +31,21 @@ export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPre
|
|
|
31
31
|
export { AgentPresets, normalizePresetInput } from "./presets.mjs";
|
|
32
32
|
export type { PreviewFeature, PreviewRoute } from "./preview/client.mjs";
|
|
33
33
|
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./preview/client.mjs";
|
|
34
|
-
export type { GeminiLiveModel, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, } from "./preview/vendors.mjs";
|
|
35
|
-
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, OpenAIGPTLive, } from "./preview/vendors.mjs";
|
|
36
34
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.mjs";
|
|
37
35
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.mjs";
|
|
38
36
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.mjs";
|
|
39
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, 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, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.mjs";
|
|
37
|
+
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, McpServer, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, 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, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.mjs";
|
|
40
38
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.mjs";
|
|
41
39
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.mjs";
|
|
42
40
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.mjs";
|
|
43
|
-
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.mjs";
|
|
41
|
+
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, type BaseMllmOptions, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.mjs";
|
|
44
42
|
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, FengmingSTTOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.mjs";
|
|
45
43
|
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.mjs";
|
|
46
44
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.mjs";
|
|
47
45
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.mjs";
|
|
48
|
-
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.mjs";
|
|
49
|
-
export { AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
50
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.mjs";
|
|
51
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
52
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.mjs";
|
|
53
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
46
|
+
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.mjs";
|
|
47
|
+
export { AzureOpenAIRealtime, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLive, GeminiLiveModels, GeminiThinkingLevels, OpenAIGPTLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
48
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.mjs";
|
|
49
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
50
|
+
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, SmallestAITTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.mjs";
|
|
51
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SmallestAITTS, TypecastTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
@@ -27,7 +27,6 @@ export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, G
|
|
|
27
27
|
export { REDACTED, redactHeadersForDebug, redactSecrets } from "./debug.mjs";
|
|
28
28
|
export { AgentPresets, normalizePresetInput } from "./presets.mjs";
|
|
29
29
|
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./preview/client.mjs";
|
|
30
|
-
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, OpenAIGPTLive, } from "./preview/vendors.mjs";
|
|
31
30
|
// Token generation
|
|
32
31
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.mjs";
|
|
33
32
|
// Avatar vendor classes
|
|
@@ -38,8 +37,8 @@ export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS
|
|
|
38
37
|
// LLM vendor classes
|
|
39
38
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.mjs";
|
|
40
39
|
// MLLM vendor classes
|
|
41
|
-
export { AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
40
|
+
export { AzureOpenAIRealtime, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLive, GeminiLiveModels, GeminiThinkingLevels, OpenAIGPTLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.mjs";
|
|
42
41
|
// STT vendor classes
|
|
43
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
42
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.mjs";
|
|
44
43
|
// TTS vendor classes
|
|
45
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
44
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SmallestAITTS, TypecastTTS, XAiTTS, } from "./vendors/tts.mjs";
|
|
@@ -31,8 +31,9 @@ export declare const PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
31
31
|
* preview endpoint.
|
|
32
32
|
*/
|
|
33
33
|
export declare const PreviewFeatures: {
|
|
34
|
-
/** Gemini
|
|
34
|
+
/** @deprecated Gemini Live now uses the production endpoint. */
|
|
35
35
|
readonly GeminiLive: "gemini-live";
|
|
36
|
+
/** @deprecated GPT Live now uses the production endpoint. */
|
|
36
37
|
readonly LiveModels: "live-models";
|
|
37
38
|
};
|
|
38
39
|
/** A preview provider family gate value. */
|
|
@@ -51,23 +52,10 @@ export interface PreviewRoute {
|
|
|
51
52
|
export declare function previewRequestHeaders(features: readonly PreviewFeature[], headers?: Record<string, string>): Record<string, string>;
|
|
52
53
|
/** Build generated resource clients for one preview session. */
|
|
53
54
|
export declare function createPreviewRoute(client: AgoraClient, features: readonly PreviewFeature[]): PreviewRoute;
|
|
54
|
-
export declare function requiredPreviewFeatures(
|
|
55
|
+
export declare function requiredPreviewFeatures(_properties: Agora.StartAgentsRequest.Properties): PreviewFeature[];
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* `Agent` fills `mllm.greeting_message` from an agent-level `greeting` whenever
|
|
60
|
-
* the vendor has not set that key — correct for every GA vendor, but the
|
|
61
|
-
* preview Gemini models read `greeting`, so the value would land in a field
|
|
62
|
-
* they ignore and the agent would silently never greet.
|
|
63
|
-
*
|
|
64
|
-
* Rather than teach the shared builder about preview providers, the translation
|
|
65
|
-
* lives here and disappears with this directory at GA. The vendor's own value
|
|
66
|
-
* wins; the production-spelled one is the fallback, which also migrates a
|
|
67
|
-
* hand-written `greeting_message` onto the preview key so an existing config
|
|
68
|
-
* keeps working after only swapping the model.
|
|
69
|
-
*
|
|
70
|
-
* Mutates `properties.mllm` in place. Safe because every SDK hands this a fresh
|
|
71
|
-
* copy of the MLLM config rather than the Agent's stored one.
|
|
57
|
+
* Normalizes the historical Gemini preview greeting field for production.
|
|
58
|
+
* Kept under its old name so callers importing this compatibility helper do
|
|
59
|
+
* not need to change code when moving an existing request to production.
|
|
72
60
|
*/
|
|
73
61
|
export declare function applyPreviewShape(properties: Agora.StartAgentsRequest.Properties): void;
|
|
@@ -22,7 +22,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
22
22
|
};
|
|
23
23
|
import { AgentManagementClient } from "../../api/resources/agentManagement/client/Client.mjs";
|
|
24
24
|
import { AgentsClient } from "../../api/resources/agents/client/Client.mjs";
|
|
25
|
-
import { GEMINI_PREVIEW_MLLM_URL, isOpenAIGPTLiveConfig } from "./vendors.mjs";
|
|
26
25
|
/** Base URL that serves the preview providers. */
|
|
27
26
|
export const PREVIEW_API_BASE_URL = "https://partner.ai.agora.io/preview/api/conversational-ai-agent";
|
|
28
27
|
/**
|
|
@@ -39,8 +38,9 @@ export const PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
39
38
|
* preview endpoint.
|
|
40
39
|
*/
|
|
41
40
|
export const PreviewFeatures = {
|
|
42
|
-
/** Gemini
|
|
41
|
+
/** @deprecated Gemini Live now uses the production endpoint. */
|
|
43
42
|
GeminiLive: "gemini-live",
|
|
43
|
+
/** @deprecated GPT Live now uses the production endpoint. */
|
|
44
44
|
LiveModels: "live-models",
|
|
45
45
|
};
|
|
46
46
|
/**
|
|
@@ -67,96 +67,29 @@ export function createPreviewRoute(client, features) {
|
|
|
67
67
|
features: [...features],
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* body rather than from the vendor classes — so hand-written configs are
|
|
75
|
-
* covered too.
|
|
76
|
-
*/
|
|
77
|
-
const PREVIEW_MLLM_MODELS = new Set([
|
|
70
|
+
export function requiredPreviewFeatures(_properties) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
const PRODUCTION_GEMINI_MLLM_MODELS = new Set([
|
|
78
74
|
"models/gemini-3.8-live",
|
|
79
75
|
"models/gemini-3.8-live-extended-thinking",
|
|
80
76
|
]);
|
|
81
77
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* a WebSocket endpoint.
|
|
86
|
-
*
|
|
87
|
-
* This is the second recognition path, and it exists because keying only off
|
|
88
|
-
* {@link PREVIEW_MLLM_MODELS} makes an unrecognised model name fail silently:
|
|
89
|
-
* {@link applyPreviewShape} would stop retargeting `greeting_message`, the
|
|
90
|
-
* greeting would land in a field these models ignore, and the agent would
|
|
91
|
-
* simply never greet. A model name we have not listed yet is reachable by
|
|
92
|
-
* following this SDK's own advice to override `model` when Google renames one
|
|
93
|
-
* ahead of a release, so the failure has to not be silent.
|
|
94
|
-
*/
|
|
95
|
-
function hasPreviewMllmEnvelope(mllm) {
|
|
96
|
-
return (typeof mllm.api_key === "string" && typeof mllm.url === "string" && mllm.url.startsWith(GEMINI_PREVIEW_MLLM_URL));
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Whether an MLLM config targets a preview model — by name, or by the wire
|
|
100
|
-
* envelope only the preview vendor classes produce.
|
|
101
|
-
*/
|
|
102
|
-
function isPreviewMllm(mllm) {
|
|
103
|
-
var _a;
|
|
104
|
-
if (!mllm || mllm.vendor !== "gemini") {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
const model = (_a = mllm.params) === null || _a === void 0 ? void 0 : _a.model;
|
|
108
|
-
if (typeof model === "string" && PREVIEW_MLLM_MODELS.has(model)) {
|
|
109
|
-
return true;
|
|
110
|
-
}
|
|
111
|
-
return hasPreviewMllmEnvelope(mllm);
|
|
112
|
-
}
|
|
113
|
-
export function requiredPreviewFeatures(properties) {
|
|
114
|
-
var _a;
|
|
115
|
-
const features = new Set();
|
|
116
|
-
const asrVendor = (_a = properties.asr) === null || _a === void 0 ? void 0 : _a.vendor;
|
|
117
|
-
if (asrVendor !== undefined && PREVIEW_ASR_VENDORS.has(asrVendor)) {
|
|
118
|
-
features.add(PreviewFeatures.GeminiLive);
|
|
119
|
-
}
|
|
120
|
-
if (isOpenAIGPTLiveConfig(properties.mllm)) {
|
|
121
|
-
features.add(PreviewFeatures.LiveModels);
|
|
122
|
-
}
|
|
123
|
-
if (isPreviewMllm(properties.mllm)) {
|
|
124
|
-
features.add(PreviewFeatures.GeminiLive);
|
|
125
|
-
}
|
|
126
|
-
return [...features];
|
|
127
|
-
}
|
|
128
|
-
const PREVIEW_MLLM_FIELD_RENAMES = new Map([["greeting_message", "greeting"]]);
|
|
129
|
-
/**
|
|
130
|
-
* Retargets MLLM fields that the shared builder wrote using production
|
|
131
|
-
* spellings, so a preview config follows the preview route's structure.
|
|
132
|
-
*
|
|
133
|
-
* `Agent` fills `mllm.greeting_message` from an agent-level `greeting` whenever
|
|
134
|
-
* the vendor has not set that key — correct for every GA vendor, but the
|
|
135
|
-
* preview Gemini models read `greeting`, so the value would land in a field
|
|
136
|
-
* they ignore and the agent would silently never greet.
|
|
137
|
-
*
|
|
138
|
-
* Rather than teach the shared builder about preview providers, the translation
|
|
139
|
-
* lives here and disappears with this directory at GA. The vendor's own value
|
|
140
|
-
* wins; the production-spelled one is the fallback, which also migrates a
|
|
141
|
-
* hand-written `greeting_message` onto the preview key so an existing config
|
|
142
|
-
* keeps working after only swapping the model.
|
|
143
|
-
*
|
|
144
|
-
* Mutates `properties.mllm` in place. Safe because every SDK hands this a fresh
|
|
145
|
-
* copy of the MLLM config rather than the Agent's stored one.
|
|
78
|
+
* Normalizes the historical Gemini preview greeting field for production.
|
|
79
|
+
* Kept under its old name so callers importing this compatibility helper do
|
|
80
|
+
* not need to change code when moving an existing request to production.
|
|
146
81
|
*/
|
|
147
82
|
export function applyPreviewShape(properties) {
|
|
83
|
+
var _a;
|
|
148
84
|
const mllm = properties.mllm;
|
|
149
|
-
if (!mllm ||
|
|
85
|
+
if (!mllm ||
|
|
86
|
+
mllm.vendor !== "gemini" ||
|
|
87
|
+
typeof ((_a = mllm.params) === null || _a === void 0 ? void 0 : _a.model) !== "string" ||
|
|
88
|
+
!PRODUCTION_GEMINI_MLLM_MODELS.has(mllm.params.model)) {
|
|
150
89
|
return;
|
|
151
90
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
if (value === undefined) {
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
if (mllm[preview] === undefined) {
|
|
158
|
-
mllm[preview] = value;
|
|
159
|
-
}
|
|
160
|
-
delete mllm[production];
|
|
91
|
+
if (mllm.greeting_message === undefined && mllm.greeting !== undefined) {
|
|
92
|
+
mllm.greeting_message = mllm.greeting;
|
|
161
93
|
}
|
|
94
|
+
delete mllm.greeting;
|
|
162
95
|
}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* Preview routing stays here while provider implementations can graduate to
|
|
5
5
|
* the production vendor modules independently.
|
|
6
6
|
*/
|
|
7
|
+
export type { OpenAIGPTLiveOptions } from "../vendors/mllm.mjs";
|
|
8
|
+
export { OpenAIGPTLive } from "../vendors/mllm.mjs";
|
|
7
9
|
export type { GeminiSTTModel, GeminiSTTOptions } from "../vendors/stt.mjs";
|
|
8
10
|
export { GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode } from "../vendors/stt.mjs";
|
|
9
11
|
export type { PreviewFeature, PreviewRoute } from "./client.mjs";
|
|
10
12
|
export { applyPreviewShape, createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.mjs";
|
|
11
|
-
export type { GeminiLiveModel, GeminiPreviewVoice, GeminiThinkingLevel,
|
|
12
|
-
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels,
|
|
13
|
+
export type { GeminiLiveModel, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, } from "./vendors.mjs";
|
|
14
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, } from "./vendors.mjs";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Preview routing stays here while provider implementations can graduate to
|
|
5
5
|
* the production vendor modules independently.
|
|
6
6
|
*/
|
|
7
|
+
export { OpenAIGPTLive } from "../vendors/mllm.mjs";
|
|
7
8
|
export { GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode } from "../vendors/stt.mjs";
|
|
8
9
|
export { applyPreviewShape, createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.mjs";
|
|
9
|
-
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels,
|
|
10
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, } from "./vendors.mjs";
|
|
@@ -1,105 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
import type { McpServersItem, MllmConfig, MllmTurnDetectionConfig } from "../types.mjs";
|
|
10
|
-
import { BaseMLLM } from "../vendors/base.mjs";
|
|
11
|
-
import type { GeminiLiveOptions } from "../vendors/mllm.mjs";
|
|
12
|
-
export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
|
|
13
|
-
export declare function isOpenAIGPTLiveConfig(config: unknown): boolean;
|
|
14
|
-
/** GPT Live v3 alpha options. Not for production traffic. */
|
|
15
|
-
export interface OpenAIGPTLiveOptions {
|
|
16
|
-
apiKey: string;
|
|
17
|
-
/** Full WebSocket URL, used verbatim except OpenAI's legacy /v1/live route. */
|
|
18
|
-
url?: string;
|
|
19
|
-
/** @deprecated Use prompt. Serialized as prompt; an explicit prompt wins. */
|
|
20
|
-
instructions?: string;
|
|
21
|
-
greeting?: string;
|
|
22
|
-
failureMessage?: string;
|
|
23
|
-
inputModalities?: string[];
|
|
24
|
-
outputModalities?: string[];
|
|
25
|
-
messages?: Record<string, unknown>[];
|
|
26
|
-
/** MCP servers exposed to GPT Live. Requires Agent.withTools(). */
|
|
27
|
-
mcpServers?: McpServersItem[];
|
|
28
|
-
/** Additional provider fields; explicit options take precedence. */
|
|
29
|
-
params?: Record<string, unknown>;
|
|
30
|
-
/** @deprecated Unsupported in v3; setting this raises an error. */
|
|
31
|
-
inputAudioTranscription?: Record<string, unknown>;
|
|
32
|
-
/** @deprecated Ignored with a warning; v3 performs endpointing internally. */
|
|
33
|
-
turnDetection?: MllmTurnDetectionConfig;
|
|
34
|
-
/** Defaults to gpt-live-1. */
|
|
35
|
-
model?: string;
|
|
36
|
-
/** Output voice; provider default marin. Custom voice objects require PR #1522; use params after rollout. */
|
|
37
|
-
voice?: string;
|
|
38
|
-
/** Session instructions. */
|
|
39
|
-
prompt?: string;
|
|
40
|
-
/** Host when url is omitted; default wss://api.openai.com. */
|
|
41
|
-
baseUrl?: string;
|
|
42
|
-
/** WebSocket path; default /v1/live/sessions. */
|
|
43
|
-
path?: string;
|
|
44
|
-
/** Optional OpenAI-Alpha selector for preview contracts. Omitted by default. */
|
|
45
|
-
alphaSelector?: string;
|
|
46
|
-
/** Extra provider request headers as a JSON string; protocol headers win. */
|
|
47
|
-
headers?: string;
|
|
48
|
-
/** Assistant silence boundary in ms; provider default 600. Zero disables inference. */
|
|
49
|
-
outputIdleEndMs?: number;
|
|
50
|
-
/** Caller silence boundary in ms; provider default 1500. */
|
|
51
|
-
inputIdleEndMs?: number;
|
|
52
|
-
/** Speech amplitude threshold on the 16-bit scale; provider default 50. */
|
|
53
|
-
outputSilencePeak?: number;
|
|
54
|
-
/** Graph PCM sample rate; provider default 24000. */
|
|
55
|
-
outputSampleRate?: number;
|
|
56
|
-
/** Initial audio cushion; provider default 0. Negative disables pacing. */
|
|
57
|
-
outputBufferMs?: number;
|
|
58
|
-
/** Mic append batching in ms. Join default 0; extension class default 100. */
|
|
59
|
-
inputBatchMs?: number;
|
|
60
|
-
/** Advertise graph tools; provider default false. Does not control delegate built-ins. */
|
|
61
|
-
toolEnabled?: boolean;
|
|
62
|
-
/** Tool delegation mode; provider default responses. Fixed for the session. */
|
|
63
|
-
delegation?: "client" | "responses";
|
|
64
|
-
/** Tool delegate model; provider default gpt-5.6-sol. */
|
|
65
|
-
responsesModel?: string;
|
|
66
|
-
/** Interrupt playback on caller speech; provider default false. */
|
|
67
|
-
interruptOnUserTurn?: boolean;
|
|
68
|
-
/** Unmodelled v3 session fields. Cannot override model, delegation, audio, instructions or input. */
|
|
69
|
-
sessionParams?: Record<string, unknown>;
|
|
70
|
-
}
|
|
71
|
-
export declare class OpenAIGPTLive extends BaseMLLM {
|
|
72
|
-
private readonly options;
|
|
73
|
-
constructor(options: OpenAIGPTLiveOptions);
|
|
74
|
-
toConfig(): MllmConfig;
|
|
75
|
-
}
|
|
76
|
-
export declare const GeminiLiveModels: {
|
|
77
|
-
/** Public ID for the low-latency voice model. */
|
|
78
|
-
readonly Live38: "models/gemini-3.8-live";
|
|
79
|
-
/** Public ID for the reasoning voice model. */
|
|
80
|
-
readonly Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking";
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* The model name the Gemini MLLM sends by default.
|
|
84
|
-
*
|
|
85
|
-
* Low-latency Gemini voice is the default.
|
|
86
|
-
*/
|
|
87
|
-
export declare const GEMINI_MLLM_DEFAULT_MODEL: string;
|
|
88
|
-
/**
|
|
89
|
-
* A preview Gemini MLLM model. Any string is accepted for launch flexibility;
|
|
90
|
-
* the `models/` prefix on the 3.8 IDs is preserved on the wire.
|
|
91
|
-
*/
|
|
92
|
-
export type GeminiLiveModel = (typeof GeminiLiveModels)[keyof typeof GeminiLiveModels] | (string & {});
|
|
93
|
-
/** Reasoning budget for Gemini extended thinking. */
|
|
94
|
-
export declare const GeminiThinkingLevels: readonly ["low", "medium", "high"];
|
|
95
|
-
/** Reasoning budget: `"low"` | `"medium"` | `"high"`. */
|
|
96
|
-
export type GeminiThinkingLevel = (typeof GeminiThinkingLevels)[number];
|
|
97
|
-
/**
|
|
98
|
-
* A Gemini output voice. Known voices autocomplete; any string is accepted so a
|
|
99
|
-
* newly published voice can be used before this SDK is updated.
|
|
100
|
-
*/
|
|
101
|
-
export type GeminiPreviewVoice = "Puck" | "Charon" | "Kore" | "Fenrir" | "Aoede" | "Leda" | "Orus" | "Zephyr" | (string & {});
|
|
102
|
-
/** Default endpoint for the preview Gemini MLLMs. */
|
|
103
|
-
export declare const GEMINI_PREVIEW_MLLM_URL = "https://generativelanguage.googleapis.com";
|
|
104
|
-
/** Builds the 3.8 preview wire config from the existing GeminiLive options. */
|
|
1
|
+
/** Legacy preview import aliases for production MLLM implementations. */
|
|
2
|
+
import type { MllmConfig } from "../types.mjs";
|
|
3
|
+
import { type GeminiLiveOptions } from "../vendors/mllm.mjs";
|
|
4
|
+
/** Legacy preview import aliases for the production GPT Live implementation. */
|
|
5
|
+
/** Gemini 3.8 names remain available from the historical preview path. */
|
|
6
|
+
export type { GeminiLiveModel, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, } from "../vendors/mllm.mjs";
|
|
7
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, isOpenAIGPTLiveConfig, OPENAI_GPT_LIVE_VENDOR, OpenAIGPTLive, } from "../vendors/mllm.mjs";
|
|
8
|
+
/** @deprecated Use `new GeminiLive(options).toConfig()`. */
|
|
105
9
|
export declare function buildGeminiPreviewConfig(options: GeminiLiveOptions): MllmConfig;
|
|
@@ -1,114 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* camelCase constructor options in, snake_case wire config out — so they work
|
|
6
|
-
* with the corresponding Agent builder method. AgentSession routes them to the
|
|
7
|
-
* preview endpoint automatically.
|
|
8
|
-
*/
|
|
9
|
-
import { BaseMLLM } from "../vendors/base.mjs";
|
|
10
|
-
// =============================================================================
|
|
11
|
-
// OpenAI GPT Live (MLLM)
|
|
12
|
-
// =============================================================================
|
|
13
|
-
export const OPENAI_GPT_LIVE_VENDOR = "openai_gpt_live";
|
|
14
|
-
export function isOpenAIGPTLiveConfig(config) {
|
|
15
|
-
return (config === null || config === void 0 ? void 0 : config.vendor) === OPENAI_GPT_LIVE_VENDOR;
|
|
16
|
-
}
|
|
17
|
-
function normalizeMcpServers(servers) {
|
|
18
|
-
return servers.map((server) => (Object.assign({ transport: "streamable_http" }, server)));
|
|
19
|
-
}
|
|
20
|
-
export class OpenAIGPTLive extends BaseMLLM {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
super();
|
|
23
|
-
this.options = options;
|
|
24
|
-
if (!options.apiKey)
|
|
25
|
-
throw new Error("OpenAIGPTLive requires apiKey");
|
|
26
|
-
}
|
|
27
|
-
toConfig() {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
const o = this.options;
|
|
30
|
-
const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: "gpt-live-1" }, o.params), (o.instructions !== undefined && { prompt: o.instructions })), (o.model !== undefined && { model: o.model })), (o.voice !== undefined && { voice: o.voice })), (o.prompt !== undefined && { prompt: o.prompt })), (o.baseUrl !== undefined && { base_url: o.baseUrl })), (o.path !== undefined && { path: o.path })), (o.alphaSelector !== undefined && { alpha_selector: o.alphaSelector })), (o.headers !== undefined && { headers: o.headers })), (o.outputIdleEndMs !== undefined && { output_idle_end_ms: o.outputIdleEndMs })), (o.inputIdleEndMs !== undefined && { input_idle_end_ms: o.inputIdleEndMs })), (o.outputSilencePeak !== undefined && { output_silence_peak: o.outputSilencePeak })), (o.outputSampleRate !== undefined && { output_sample_rate: o.outputSampleRate })), (o.outputBufferMs !== undefined && { output_buffer_ms: o.outputBufferMs })), (o.inputBatchMs !== undefined && { input_batch_ms: o.inputBatchMs })), (o.toolEnabled !== undefined && { tool_enabled: o.toolEnabled })), (o.delegation !== undefined && { delegation: o.delegation })), (o.responsesModel !== undefined && { responses_model: o.responsesModel })), (o.interruptOnUserTurn !== undefined && { interrupt_on_user_turn: o.interruptOnUserTurn })), (o.sessionParams !== undefined && { session_params: o.sessionParams }));
|
|
31
|
-
if (o.inputAudioTranscription !== undefined || "input_audio_transcription" in params) {
|
|
32
|
-
throw new Error("GPT Live v3 does not support input_audio_transcription");
|
|
33
|
-
}
|
|
34
|
-
if (o.turnDetection !== undefined || "turn_detection" in params) {
|
|
35
|
-
console.warn("GPT Live v3 ignores turn_detection; endpointing is internal");
|
|
36
|
-
delete params.turn_detection;
|
|
37
|
-
}
|
|
38
|
-
if (params.delegation !== undefined && params.delegation !== "client" && params.delegation !== "responses") {
|
|
39
|
-
throw new Error("GPT Live delegation must be client or responses");
|
|
40
|
-
}
|
|
41
|
-
if (params.headers !== undefined) {
|
|
42
|
-
let headers;
|
|
43
|
-
try {
|
|
44
|
-
headers = JSON.parse(String(params.headers));
|
|
45
|
-
}
|
|
46
|
-
catch (_c) {
|
|
47
|
-
throw new Error("GPT Live headers must be a JSON object string");
|
|
48
|
-
}
|
|
49
|
-
if (headers === null || typeof headers !== "object" || Array.isArray(headers)) {
|
|
50
|
-
throw new Error("GPT Live headers must be a JSON object string");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
const session = params.session_params === undefined ? {} : params.session_params;
|
|
54
|
-
if (session === null || typeof session !== "object" || Array.isArray(session)) {
|
|
55
|
-
throw new Error("GPT Live session_params must be an object");
|
|
56
|
-
}
|
|
57
|
-
for (const key of ["model", "delegation", "audio", "instructions", "input"]) {
|
|
58
|
-
if (key in session)
|
|
59
|
-
throw new Error(`GPT Live session_params cannot override ${key}`);
|
|
60
|
-
}
|
|
61
|
-
let url = o.url ||
|
|
62
|
-
`${String((_a = params.base_url) !== null && _a !== void 0 ? _a : "wss://api.openai.com").replace(/\/+$/, "")}/${String((_b = params.path) !== null && _b !== void 0 ? _b : "/v1/live/sessions").replace(/^\/+/, "")}`;
|
|
63
|
-
if (!/^wss?:\/\/[^/]/i.test(url)) {
|
|
64
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
65
|
-
}
|
|
66
|
-
let parsed;
|
|
67
|
-
try {
|
|
68
|
-
parsed = new URL(url);
|
|
69
|
-
}
|
|
70
|
-
catch (_d) {
|
|
71
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
72
|
-
}
|
|
73
|
-
if ((parsed.protocol !== "ws:" && parsed.protocol !== "wss:") || !parsed.hostname) {
|
|
74
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
75
|
-
}
|
|
76
|
-
if (parsed.hostname === "api.openai.com" && parsed.pathname === "/v1/live") {
|
|
77
|
-
parsed.pathname = "/v1/live/sessions";
|
|
78
|
-
url = parsed.toString();
|
|
79
|
-
}
|
|
80
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: OPENAI_GPT_LIVE_VENDOR, api_key: o.apiKey, url,
|
|
81
|
-
params }, (o.greeting !== undefined && { greeting_message: o.greeting })), (o.failureMessage !== undefined && { failure_message: o.failureMessage })), (o.inputModalities !== undefined && { input_modalities: o.inputModalities })), (o.outputModalities !== undefined && { output_modalities: o.outputModalities })), (o.messages !== undefined && { messages: o.messages })), (o.mcpServers !== undefined && { mcp_servers: normalizeMcpServers(o.mcpServers) }));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// Google preview MLLMs use a separate feature gate from GPT Live.
|
|
85
|
-
export const GeminiLiveModels = {
|
|
86
|
-
/** Public ID for the low-latency voice model. */
|
|
87
|
-
Live38: "models/gemini-3.8-live",
|
|
88
|
-
/** Public ID for the reasoning voice model. */
|
|
89
|
-
Live38ExtendedThinking: "models/gemini-3.8-live-extended-thinking",
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* The model name the Gemini MLLM sends by default.
|
|
93
|
-
*
|
|
94
|
-
* Low-latency Gemini voice is the default.
|
|
95
|
-
*/
|
|
96
|
-
export const GEMINI_MLLM_DEFAULT_MODEL = GeminiLiveModels.Live38;
|
|
97
|
-
/** Reasoning budget for Gemini extended thinking. */
|
|
98
|
-
export const GeminiThinkingLevels = ["low", "medium", "high"];
|
|
99
|
-
/** Default endpoint for the preview Gemini MLLMs. */
|
|
100
|
-
export const GEMINI_PREVIEW_MLLM_URL = "https://generativelanguage.googleapis.com";
|
|
101
|
-
/** Builds the 3.8 preview wire config from the existing GeminiLive options. */
|
|
1
|
+
/** Legacy preview import aliases for production MLLM implementations. */
|
|
2
|
+
import { GeminiLive } from "../vendors/mllm.mjs";
|
|
3
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, isOpenAIGPTLiveConfig, OPENAI_GPT_LIVE_VENDOR, OpenAIGPTLive, } from "../vendors/mllm.mjs";
|
|
4
|
+
/** @deprecated Use `new GeminiLive(options).toConfig()`. */
|
|
102
5
|
export function buildGeminiPreviewConfig(options) {
|
|
103
|
-
|
|
104
|
-
const model = (requestedModel === null || requestedModel === void 0 ? void 0 : requestedModel.trim()) || GEMINI_MLLM_DEFAULT_MODEL;
|
|
105
|
-
const reasoningModel = model === GeminiLiveModels.Live38ExtendedThinking;
|
|
106
|
-
const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { model,
|
|
107
|
-
voice }), (reasoningModel && thinkingLevel !== undefined && { thinking_level: thinkingLevel })), (languageCodes && { language_codes: [...languageCodes] })), (instructions && { instructions })), (transcribeAgent !== undefined && { transcribe_agent: transcribeAgent })), (transcribeUser !== undefined && { transcribe_user: transcribeUser })), (affectiveDialog !== undefined && { affective_dialog: affectiveDialog })), (proactiveAudio !== undefined && { proactive_audio: proactiveAudio })), (httpOptions && { http_options: httpOptions }));
|
|
108
|
-
if (!reasoningModel) {
|
|
109
|
-
delete params.thinking_level;
|
|
110
|
-
}
|
|
111
|
-
delete params.api_key;
|
|
112
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "gemini", api_key: apiKey, url,
|
|
113
|
-
params }, (messages && { messages })), (greetingMessage && { greeting: greetingMessage })), (failureMessage && { failure_message: failureMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (turnDetection && { turn_detection: turnDetection }));
|
|
6
|
+
return new GeminiLive(options).toConfig();
|
|
114
7
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
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, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GeminiAsrParams as GeminiAsrParamsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, 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, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, TypecastTtsParams as TypecastTtsParamsType, TypecastTts as TypecastTtsType, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } 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, GeminiAsrParams as GeminiAsrParamsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, McpServer as McpServerType, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, 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, SmallestAiAsrParams as SmallestAiAsrParamsType, SmallestAiAsr as SmallestAiAsrType, SmallestAiTtsParams as SmallestAiTtsParamsType, SmallestAiTts as SmallestAiTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, TypecastTtsParams as TypecastTtsParamsType, TypecastTts as TypecastTtsType, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } 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) */
|
|
@@ -90,11 +90,11 @@ export type LlmTool = LlmToolType;
|
|
|
90
90
|
export type LlmToolExecution = LlmToolExecutionType;
|
|
91
91
|
export type LlmToolFunction = LlmToolFunctionType;
|
|
92
92
|
export type LlmToolServer = LlmToolServerType;
|
|
93
|
-
/** MLLM configuration, including
|
|
93
|
+
/** MLLM configuration, including production vendors not present in the generated schema yet. */
|
|
94
94
|
export type MllmConfig = Omit<Mllm, "vendor"> & {
|
|
95
95
|
vendor?: Mllm.Vendor | "openai_gpt_live";
|
|
96
96
|
};
|
|
97
|
-
/** MLLM wire vendor name, including
|
|
97
|
+
/** MLLM wire vendor name, including schema compatibility extensions. */
|
|
98
98
|
export type MllmVendor = Exclude<MllmConfig["vendor"], undefined>;
|
|
99
99
|
/** Avatar configuration */
|
|
100
100
|
export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
|
|
@@ -228,7 +228,9 @@ export type LlmGreetingConfigs = Llm.GreetingConfigs;
|
|
|
228
228
|
/** Greeting broadcast ASR policy: `"merge_reply"` | `"context"` */
|
|
229
229
|
export type LlmGreetingConfigsMode = Llm.GreetingConfigs.UninterruptibleAsrPolicy;
|
|
230
230
|
/** MCP server config item (`llm.mcp_servers[]` or `mllm.mcp_servers[]`) */
|
|
231
|
-
export type
|
|
231
|
+
export type McpServer = McpServerType;
|
|
232
|
+
/** @deprecated Use {@link McpServer}. */
|
|
233
|
+
export type McpServersItem = McpServer & Record<string, unknown>;
|
|
232
234
|
/** Full agent configuration (alias for StartAgentsRequest.Properties) */
|
|
233
235
|
export type AgentConfig = StartAgentsRequest.Properties;
|
|
234
236
|
/** Agent configuration update (for runtime updates) */
|
|
@@ -561,6 +563,8 @@ export interface SarvamAsrParams {
|
|
|
561
563
|
*/
|
|
562
564
|
export type XAiAsr = XAiAsrType;
|
|
563
565
|
export type XAiAsrParams = XAiAsrParamsType;
|
|
566
|
+
export type SmallestAiAsr = SmallestAiAsrType;
|
|
567
|
+
export type SmallestAiAsrParams = SmallestAiAsrParamsType;
|
|
564
568
|
/** Google Gemini STT parameters generated from the API schema. */
|
|
565
569
|
export type GeminiAsrParams = GeminiAsrParamsType;
|
|
566
570
|
export type MicrosoftTts = MicrosoftTtsType;
|
|
@@ -595,6 +599,8 @@ export type SarvamTts = SarvamTtsType;
|
|
|
595
599
|
export type SarvamTtsParams = SarvamTtsParamsType;
|
|
596
600
|
export type XAiTts = XAiTtsType;
|
|
597
601
|
export type XAiTtsParams = XAiTtsParamsType;
|
|
602
|
+
export type SmallestAiTts = SmallestAiTtsType;
|
|
603
|
+
export type SmallestAiTtsParams = SmallestAiTtsParamsType;
|
|
598
604
|
export type TypecastTts = TypecastTtsType;
|
|
599
605
|
export type TypecastTtsParams = TypecastTtsParamsType;
|
|
600
606
|
export type SpatiusAvatarParams = SpatiusAvatarParamsType;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* that converts TypeScript-friendly constructor params (camelCase) into the
|
|
6
6
|
* Agora API format (snake_case).
|
|
7
7
|
*/
|
|
8
|
-
import type { AvatarConfig, LlmConfig, LlmGreetingConfigs, LlmTool, McpServersItem, MllmConfig, SttConfig, TtsConfig } from "../types.mjs";
|
|
8
|
+
import type { AvatarConfig, LlmConfig, LlmGreetingConfigs, LlmTool, McpServer, McpServersItem, MllmConfig, SttConfig, TtsConfig } from "../types.mjs";
|
|
9
9
|
/**
|
|
10
10
|
* Common options shared by all LLM vendor classes.
|
|
11
11
|
* These map directly to top-level fields on `LlmConfig` that are not
|
|
@@ -47,6 +47,13 @@ export interface BaseLlmOptions {
|
|
|
47
47
|
/** Inline synchronous REST tools exposed to the LLM for function calling. Requires `withTools(true)`. */
|
|
48
48
|
tools?: LlmTool[];
|
|
49
49
|
}
|
|
50
|
+
/** Tool configuration shared by all MLLM vendor helpers. */
|
|
51
|
+
export interface BaseMllmOptions {
|
|
52
|
+
/** MCP servers exposed to the MLLM. Requires `Agent.withTools()`. */
|
|
53
|
+
mcpServers?: McpServer[];
|
|
54
|
+
/** Inline synchronous REST tools exposed to the MLLM. Requires `Agent.withTools()`. */
|
|
55
|
+
tools?: LlmTool[];
|
|
56
|
+
}
|
|
50
57
|
type VendorScope = "global" | "cn";
|
|
51
58
|
/**
|
|
52
59
|
* Standard audio sample rates supported by Agora platform.
|
|
@@ -169,7 +176,11 @@ export declare abstract class BaseCNSTT extends ScopedBaseSTT<"cn"> {
|
|
|
169
176
|
*/
|
|
170
177
|
declare abstract class ScopedBaseMLLM<TScope extends VendorScope> {
|
|
171
178
|
readonly areaScope: TScope;
|
|
172
|
-
|
|
179
|
+
private readonly _mcpServers?;
|
|
180
|
+
private readonly _tools?;
|
|
181
|
+
constructor(areaScope: TScope, options?: BaseMllmOptions);
|
|
182
|
+
protected get mcpServers(): McpServer[] | undefined;
|
|
183
|
+
protected get tools(): LlmTool[] | undefined;
|
|
173
184
|
/**
|
|
174
185
|
* Converts the vendor configuration to the Agora API format.
|
|
175
186
|
*/
|
|
@@ -177,11 +188,11 @@ declare abstract class ScopedBaseMLLM<TScope extends VendorScope> {
|
|
|
177
188
|
}
|
|
178
189
|
/** Base class for global MLLM vendors. */
|
|
179
190
|
export declare abstract class BaseMLLM extends ScopedBaseMLLM<"global"> {
|
|
180
|
-
constructor();
|
|
191
|
+
constructor(options?: BaseMllmOptions);
|
|
181
192
|
}
|
|
182
193
|
/** Base class for Chinese mainland MLLM vendors. */
|
|
183
194
|
export declare abstract class BaseCNMLLM extends ScopedBaseMLLM<"cn"> {
|
|
184
|
-
constructor();
|
|
195
|
+
constructor(options?: BaseMllmOptions);
|
|
185
196
|
}
|
|
186
197
|
/**
|
|
187
198
|
* Base class for Avatar vendors with required sample rate.
|