agora-agents 2.8.1 → 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/AgentSession.js +1 -0
- package/dist/cjs/agentkit/index.d.ts +8 -10
- package/dist/cjs/agentkit/index.js +10 -4
- package/dist/cjs/agentkit/preview/client.d.ts +7 -5
- package/dist/cjs/agentkit/preview/client.js +23 -15
- package/dist/cjs/agentkit/preview/index.d.ts +5 -3
- package/dist/cjs/agentkit/preview/index.js +9 -2
- package/dist/cjs/agentkit/preview/vendors.d.ts +9 -74
- package/dist/cjs/agentkit/preview/vendors.js +16 -85
- 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 +97 -10
- package/dist/cjs/agentkit/vendors/mllm.js +122 -14
- 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 +10 -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/AgentSession.mjs +2 -1
- 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 +7 -5
- package/dist/esm/agentkit/preview/client.mjs +22 -15
- package/dist/esm/agentkit/preview/index.d.mts +5 -3
- package/dist/esm/agentkit/preview/index.mjs +3 -2
- package/dist/esm/agentkit/preview/vendors.d.mts +9 -74
- package/dist/esm/agentkit/preview/vendors.mjs +6 -82
- 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 +97 -10
- package/dist/esm/agentkit/vendors/mllm.mjs +119 -13
- 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
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
|
|
|
41
41
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
42
42
|
"X-Fern-Language": "JavaScript",
|
|
43
43
|
"X-Fern-SDK-Name": "agora-agents",
|
|
44
|
-
"X-Fern-SDK-Version": "v2.
|
|
45
|
-
"User-Agent": "agora-agents/v2.
|
|
44
|
+
"X-Fern-SDK-Version": "v2.10.0",
|
|
45
|
+
"User-Agent": "agora-agents/v2.10.0",
|
|
46
46
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
47
47
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
48
48
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -11,11 +11,11 @@ exports.Agent = void 0;
|
|
|
11
11
|
const index_js_1 = require("../core/domain/index.js");
|
|
12
12
|
const AgentSession_js_1 = require("./AgentSession.js");
|
|
13
13
|
const constants_js_1 = require("./constants.js");
|
|
14
|
-
const vendors_js_1 = require("./preview/vendors.js");
|
|
15
14
|
const token_js_1 = require("./token.js");
|
|
15
|
+
const mllm_js_1 = require("./vendors/mllm.js");
|
|
16
16
|
const DEFAULT_TURN_DETECTION_LANGUAGE = "en-US";
|
|
17
17
|
function toGeneratedMllm(config) {
|
|
18
|
-
//
|
|
18
|
+
// GPT Live is not yet present in the generated schema enum. Keep the assertion at
|
|
19
19
|
// this wire boundary so the public and builder APIs remain accurately typed.
|
|
20
20
|
return config;
|
|
21
21
|
}
|
|
@@ -658,7 +658,7 @@ class Agent {
|
|
|
658
658
|
c.failure_message = this._failureMessage;
|
|
659
659
|
}
|
|
660
660
|
}
|
|
661
|
-
const isOpenAIGPTLive = (0,
|
|
661
|
+
const isOpenAIGPTLive = (0, mllm_js_1.isOpenAIGPTLiveConfig)(mllmConfig);
|
|
662
662
|
if (isOpenAIGPTLive && this._turnDetection !== undefined) {
|
|
663
663
|
console.warn("GPT Live v3 ignores agent-level turn_detection; endpointing is internal");
|
|
664
664
|
}
|
|
@@ -436,6 +436,7 @@ class AgentSession {
|
|
|
436
436
|
});
|
|
437
437
|
const enrichedProperties = this._enrichAvatarParams(resolved.properties, expiresIn);
|
|
438
438
|
this._validateEnrichedAvatarConfig(enrichedProperties);
|
|
439
|
+
(0, client_js_1.applyPreviewShape)(enrichedProperties);
|
|
439
440
|
this._previewFeatures = (0, client_js_1.requiredPreviewFeatures)(enrichedProperties);
|
|
440
441
|
if (this._previewFeatures.length > 0) {
|
|
441
442
|
const route = (0, client_js_1.createPreviewRoute)(this._client, this._previewFeatures);
|
|
@@ -31,23 +31,21 @@ export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPre
|
|
|
31
31
|
export { AgentPresets, normalizePresetInput } from "./presets.js";
|
|
32
32
|
export type { PreviewFeature, PreviewRoute } from "./preview/client.js";
|
|
33
33
|
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./preview/client.js";
|
|
34
|
-
export type { OpenAIGPTLiveOptions } from "./preview/vendors.js";
|
|
35
|
-
export { OpenAIGPTLive } from "./preview/vendors.js";
|
|
36
34
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
37
35
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
38
36
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
|
|
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.js";
|
|
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.js";
|
|
40
38
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
|
|
41
39
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
|
|
42
40
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
|
|
43
|
-
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
41
|
+
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, type BaseMllmOptions, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
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.js";
|
|
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.js";
|
|
46
44
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
|
|
47
45
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
|
|
48
|
-
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
49
|
-
export { AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.js";
|
|
50
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
51
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
52
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
53
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
|
|
46
|
+
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
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.js";
|
|
48
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
49
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
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.js";
|
|
51
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SmallestAITTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.normalizePresetInput = exports.AgentPresets = exports.redactSecrets = exports.redactHeadersForDebug = exports.REDACTED = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SilenceActionValues = exports.SalModeValues = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.Geofence = exports.FillerWordsSelectionRule = exports.DataChannel = exports.CredentialMode = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
|
|
24
|
-
exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.
|
|
25
|
-
exports.XAiTTS = exports.TypecastTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.GeminiLive = exports.
|
|
24
|
+
exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = void 0;
|
|
25
|
+
exports.XAiTTS = exports.TypecastTTS = exports.SmallestAITTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SmallestAISTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GeminiLive = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.AzureOpenAIRealtime = void 0;
|
|
26
26
|
// Core classes
|
|
27
27
|
var Agent_js_1 = require("./Agent.js");
|
|
28
28
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
|
|
@@ -85,8 +85,6 @@ Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get
|
|
|
85
85
|
Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: function () { return client_js_1.PreviewFeatures; } });
|
|
86
86
|
Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
|
|
87
87
|
Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
|
|
88
|
-
var vendors_js_1 = require("./preview/vendors.js");
|
|
89
|
-
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return vendors_js_1.OpenAIGPTLive; } });
|
|
90
88
|
// Token generation
|
|
91
89
|
var token_js_1 = require("./token.js");
|
|
92
90
|
Object.defineProperty(exports, "ExpiresIn", { enumerable: true, get: function () { return token_js_1.ExpiresIn; } });
|
|
@@ -146,7 +144,13 @@ Object.defineProperty(exports, "VertexAILLM", { enumerable: true, get: function
|
|
|
146
144
|
// MLLM vendor classes
|
|
147
145
|
var mllm_js_1 = require("./vendors/mllm.js");
|
|
148
146
|
Object.defineProperty(exports, "AzureOpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.AzureOpenAIRealtime; } });
|
|
147
|
+
Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_MLLM_DEFAULT_MODEL; } });
|
|
148
|
+
Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_MLLM_URL; } });
|
|
149
|
+
Object.defineProperty(exports, "GEMINI_PREVIEW_MLLM_URL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_PREVIEW_MLLM_URL; } });
|
|
149
150
|
Object.defineProperty(exports, "GeminiLive", { enumerable: true, get: function () { return mllm_js_1.GeminiLive; } });
|
|
151
|
+
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return mllm_js_1.GeminiLiveModels; } });
|
|
152
|
+
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return mllm_js_1.GeminiThinkingLevels; } });
|
|
153
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return mllm_js_1.OpenAIGPTLive; } });
|
|
150
154
|
Object.defineProperty(exports, "OpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.OpenAIRealtime; } });
|
|
151
155
|
Object.defineProperty(exports, "QwenOmni", { enumerable: true, get: function () { return mllm_js_1.QwenOmni; } });
|
|
152
156
|
Object.defineProperty(exports, "VertexAI", { enumerable: true, get: function () { return mllm_js_1.VertexAI; } });
|
|
@@ -164,6 +168,7 @@ Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function ()
|
|
|
164
168
|
Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function () { return stt_js_1.MicrosoftSTT; } });
|
|
165
169
|
Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
|
|
166
170
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return stt_js_1.SarvamSTT; } });
|
|
171
|
+
Object.defineProperty(exports, "SmallestAISTT", { enumerable: true, get: function () { return stt_js_1.SmallestAISTT; } });
|
|
167
172
|
Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return stt_js_1.SpeechmaticsSTT; } });
|
|
168
173
|
Object.defineProperty(exports, "XAiSTT", { enumerable: true, get: function () { return stt_js_1.XAiSTT; } });
|
|
169
174
|
// TTS vendor classes
|
|
@@ -184,5 +189,6 @@ Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () {
|
|
|
184
189
|
Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
|
|
185
190
|
Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
|
|
186
191
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
|
|
192
|
+
Object.defineProperty(exports, "SmallestAITTS", { enumerable: true, get: function () { return tts_js_1.SmallestAITTS; } });
|
|
187
193
|
Object.defineProperty(exports, "TypecastTTS", { enumerable: true, get: function () { return tts_js_1.TypecastTTS; } });
|
|
188
194
|
Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
|
|
@@ -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
|
-
/** @deprecated 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,9 +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;
|
|
55
|
+
export declare function requiredPreviewFeatures(_properties: Agora.StartAgentsRequest.Properties): PreviewFeature[];
|
|
54
56
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
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.
|
|
58
60
|
*/
|
|
59
|
-
export declare function
|
|
61
|
+
export declare function applyPreviewShape(properties: Agora.StartAgentsRequest.Properties): void;
|
|
@@ -26,9 +26,9 @@ exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_B
|
|
|
26
26
|
exports.previewRequestHeaders = previewRequestHeaders;
|
|
27
27
|
exports.createPreviewRoute = createPreviewRoute;
|
|
28
28
|
exports.requiredPreviewFeatures = requiredPreviewFeatures;
|
|
29
|
+
exports.applyPreviewShape = applyPreviewShape;
|
|
29
30
|
const Client_js_1 = require("../../api/resources/agentManagement/client/Client.js");
|
|
30
31
|
const Client_js_2 = require("../../api/resources/agents/client/Client.js");
|
|
31
|
-
const vendors_js_1 = require("./vendors.js");
|
|
32
32
|
/** Base URL that serves the preview providers. */
|
|
33
33
|
exports.PREVIEW_API_BASE_URL = "https://partner.ai.agora.io/preview/api/conversational-ai-agent";
|
|
34
34
|
/**
|
|
@@ -45,8 +45,9 @@ exports.PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
45
45
|
* preview endpoint.
|
|
46
46
|
*/
|
|
47
47
|
exports.PreviewFeatures = {
|
|
48
|
-
/** @deprecated Gemini
|
|
48
|
+
/** @deprecated Gemini Live now uses the production endpoint. */
|
|
49
49
|
GeminiLive: "gemini-live",
|
|
50
|
+
/** @deprecated GPT Live now uses the production endpoint. */
|
|
50
51
|
LiveModels: "live-models",
|
|
51
52
|
};
|
|
52
53
|
/**
|
|
@@ -73,22 +74,29 @@ function createPreviewRoute(client, features) {
|
|
|
73
74
|
features: [...features],
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
function requiredPreviewFeatures(_properties) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const PRODUCTION_GEMINI_MLLM_MODELS = new Set([
|
|
81
|
+
"models/gemini-3.8-live",
|
|
82
|
+
"models/gemini-3.8-live-extended-thinking",
|
|
83
|
+
]);
|
|
78
84
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
85
|
+
* Normalizes the historical Gemini preview greeting field for production.
|
|
86
|
+
* Kept under its old name so callers importing this compatibility helper do
|
|
87
|
+
* not need to change code when moving an existing request to production.
|
|
82
88
|
*/
|
|
83
|
-
function
|
|
89
|
+
function applyPreviewShape(properties) {
|
|
84
90
|
var _a;
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
const mllm = properties.mllm;
|
|
92
|
+
if (!mllm ||
|
|
93
|
+
mllm.vendor !== "gemini" ||
|
|
94
|
+
typeof ((_a = mllm.params) === null || _a === void 0 ? void 0 : _a.model) !== "string" ||
|
|
95
|
+
!PRODUCTION_GEMINI_MLLM_MODELS.has(mllm.params.model)) {
|
|
96
|
+
return;
|
|
89
97
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
98
|
+
if (mllm.greeting_message === undefined && mllm.greeting !== undefined) {
|
|
99
|
+
mllm.greeting_message = mllm.greeting;
|
|
92
100
|
}
|
|
93
|
-
|
|
101
|
+
delete mllm.greeting;
|
|
94
102
|
}
|
|
@@ -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.js";
|
|
8
|
+
export { OpenAIGPTLive } from "../vendors/mllm.js";
|
|
7
9
|
export type { GeminiSTTModel, GeminiSTTOptions } from "../vendors/stt.js";
|
|
8
10
|
export { GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode } from "../vendors/stt.js";
|
|
9
11
|
export type { PreviewFeature, PreviewRoute } from "./client.js";
|
|
10
|
-
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.js";
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
12
|
+
export { applyPreviewShape, createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.js";
|
|
13
|
+
export type { GeminiLiveModel, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, } from "./vendors.js";
|
|
14
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, } from "./vendors.js";
|
|
@@ -6,12 +6,15 @@
|
|
|
6
6
|
* the production vendor modules independently.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.applyPreviewShape = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.OpenAIGPTLive = void 0;
|
|
10
|
+
var mllm_js_1 = require("../vendors/mllm.js");
|
|
11
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return mllm_js_1.OpenAIGPTLive; } });
|
|
10
12
|
var stt_js_1 = require("../vendors/stt.js");
|
|
11
13
|
Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
|
|
12
14
|
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
|
|
13
15
|
Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
|
|
14
16
|
var client_js_1 = require("./client.js");
|
|
17
|
+
Object.defineProperty(exports, "applyPreviewShape", { enumerable: true, get: function () { return client_js_1.applyPreviewShape; } });
|
|
15
18
|
Object.defineProperty(exports, "createPreviewRoute", { enumerable: true, get: function () { return client_js_1.createPreviewRoute; } });
|
|
16
19
|
Object.defineProperty(exports, "PREVIEW_API_BASE_URL", { enumerable: true, get: function () { return client_js_1.PREVIEW_API_BASE_URL; } });
|
|
17
20
|
Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get: function () { return client_js_1.PREVIEW_FEATURE_HEADER; } });
|
|
@@ -19,4 +22,8 @@ Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: funct
|
|
|
19
22
|
Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
|
|
20
23
|
Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
|
|
21
24
|
var vendors_js_1 = require("./vendors.js");
|
|
22
|
-
Object.defineProperty(exports, "
|
|
25
|
+
Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_DEFAULT_MODEL; } });
|
|
26
|
+
Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_URL; } });
|
|
27
|
+
Object.defineProperty(exports, "GEMINI_PREVIEW_MLLM_URL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_PREVIEW_MLLM_URL; } });
|
|
28
|
+
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return vendors_js_1.GeminiLiveModels; } });
|
|
29
|
+
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return vendors_js_1.GeminiThinkingLevels; } });
|
|
@@ -1,74 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { BaseMLLM } from "../vendors/base.js";
|
|
11
|
-
export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
|
|
12
|
-
export declare function isOpenAIGPTLiveConfig(config: unknown): boolean;
|
|
13
|
-
/** GPT Live v3 alpha options. Not for production traffic. */
|
|
14
|
-
export interface OpenAIGPTLiveOptions {
|
|
15
|
-
apiKey: string;
|
|
16
|
-
/** Full WebSocket URL, used verbatim except OpenAI's legacy /v1/live route. */
|
|
17
|
-
url?: string;
|
|
18
|
-
/** @deprecated Use prompt. Serialized as prompt; an explicit prompt wins. */
|
|
19
|
-
instructions?: string;
|
|
20
|
-
greeting?: string;
|
|
21
|
-
failureMessage?: string;
|
|
22
|
-
inputModalities?: string[];
|
|
23
|
-
outputModalities?: string[];
|
|
24
|
-
messages?: Record<string, unknown>[];
|
|
25
|
-
/** MCP servers exposed to GPT Live. Requires Agent.withTools(). */
|
|
26
|
-
mcpServers?: McpServersItem[];
|
|
27
|
-
/** Additional provider fields; explicit options take precedence. */
|
|
28
|
-
params?: Record<string, unknown>;
|
|
29
|
-
/** @deprecated Unsupported in v3; setting this raises an error. */
|
|
30
|
-
inputAudioTranscription?: Record<string, unknown>;
|
|
31
|
-
/** @deprecated Ignored with a warning; v3 performs endpointing internally. */
|
|
32
|
-
turnDetection?: MllmTurnDetectionConfig;
|
|
33
|
-
/** Defaults to gpt-live-1. */
|
|
34
|
-
model?: string;
|
|
35
|
-
/** Output voice; provider default marin. Custom voice objects require PR #1522; use params after rollout. */
|
|
36
|
-
voice?: string;
|
|
37
|
-
/** Session instructions. */
|
|
38
|
-
prompt?: string;
|
|
39
|
-
/** Host when url is omitted; default wss://api.openai.com. */
|
|
40
|
-
baseUrl?: string;
|
|
41
|
-
/** WebSocket path; default /v1/live/sessions. */
|
|
42
|
-
path?: string;
|
|
43
|
-
/** Optional OpenAI-Alpha selector for preview contracts. Omitted by default. */
|
|
44
|
-
alphaSelector?: string;
|
|
45
|
-
/** Extra provider request headers as a JSON string; protocol headers win. */
|
|
46
|
-
headers?: string;
|
|
47
|
-
/** Assistant silence boundary in ms; provider default 600. Zero disables inference. */
|
|
48
|
-
outputIdleEndMs?: number;
|
|
49
|
-
/** Caller silence boundary in ms; provider default 1500. */
|
|
50
|
-
inputIdleEndMs?: number;
|
|
51
|
-
/** Speech amplitude threshold on the 16-bit scale; provider default 50. */
|
|
52
|
-
outputSilencePeak?: number;
|
|
53
|
-
/** Graph PCM sample rate; provider default 24000. */
|
|
54
|
-
outputSampleRate?: number;
|
|
55
|
-
/** Initial audio cushion; provider default 0. Negative disables pacing. */
|
|
56
|
-
outputBufferMs?: number;
|
|
57
|
-
/** Mic append batching in ms. Join default 0; extension class default 100. */
|
|
58
|
-
inputBatchMs?: number;
|
|
59
|
-
/** Advertise graph tools; provider default false. Does not control delegate built-ins. */
|
|
60
|
-
toolEnabled?: boolean;
|
|
61
|
-
/** Tool delegation mode; provider default responses. Fixed for the session. */
|
|
62
|
-
delegation?: "client" | "responses";
|
|
63
|
-
/** Tool delegate model; provider default gpt-5.6-sol. */
|
|
64
|
-
responsesModel?: string;
|
|
65
|
-
/** Interrupt playback on caller speech; provider default false. */
|
|
66
|
-
interruptOnUserTurn?: boolean;
|
|
67
|
-
/** Unmodelled v3 session fields. Cannot override model, delegation, audio, instructions or input. */
|
|
68
|
-
sessionParams?: Record<string, unknown>;
|
|
69
|
-
}
|
|
70
|
-
export declare class OpenAIGPTLive extends BaseMLLM {
|
|
71
|
-
private readonly options;
|
|
72
|
-
constructor(options: OpenAIGPTLiveOptions);
|
|
73
|
-
toConfig(): MllmConfig;
|
|
74
|
-
}
|
|
1
|
+
/** Legacy preview import aliases for production MLLM implementations. */
|
|
2
|
+
import type { MllmConfig } from "../types.js";
|
|
3
|
+
import { type GeminiLiveOptions } from "../vendors/mllm.js";
|
|
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.js";
|
|
7
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, isOpenAIGPTLiveConfig, OPENAI_GPT_LIVE_VENDOR, OpenAIGPTLive, } from "../vendors/mllm.js";
|
|
8
|
+
/** @deprecated Use `new GeminiLive(options).toConfig()`. */
|
|
9
|
+
export declare function buildGeminiPreviewConfig(options: GeminiLiveOptions): MllmConfig;
|
|
@@ -1,88 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Preview provider vendor classes.
|
|
4
|
-
*
|
|
5
|
-
* These follow the same shape as the GA vendor classes in `vendors/` —
|
|
6
|
-
* camelCase constructor options in, snake_case wire config out — so they work
|
|
7
|
-
* with the corresponding Agent builder method. AgentSession routes them to the
|
|
8
|
-
* preview endpoint automatically.
|
|
9
|
-
*/
|
|
2
|
+
/** Legacy preview import aliases for production MLLM implementations. */
|
|
10
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.OpenAIGPTLive = exports.OPENAI_GPT_LIVE_VENDOR = void 0;
|
|
12
|
-
exports.
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
exports
|
|
18
|
-
function
|
|
19
|
-
|
|
4
|
+
exports.OpenAIGPTLive = exports.OPENAI_GPT_LIVE_VENDOR = exports.isOpenAIGPTLiveConfig = exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = void 0;
|
|
5
|
+
exports.buildGeminiPreviewConfig = buildGeminiPreviewConfig;
|
|
6
|
+
const mllm_js_1 = require("../vendors/mllm.js");
|
|
7
|
+
var mllm_js_2 = require("../vendors/mllm.js");
|
|
8
|
+
Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return mllm_js_2.GEMINI_MLLM_DEFAULT_MODEL; } });
|
|
9
|
+
Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return mllm_js_2.GEMINI_MLLM_URL; } });
|
|
10
|
+
Object.defineProperty(exports, "GEMINI_PREVIEW_MLLM_URL", { enumerable: true, get: function () { return mllm_js_2.GEMINI_PREVIEW_MLLM_URL; } });
|
|
11
|
+
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return mllm_js_2.GeminiLiveModels; } });
|
|
12
|
+
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return mllm_js_2.GeminiThinkingLevels; } });
|
|
13
|
+
Object.defineProperty(exports, "isOpenAIGPTLiveConfig", { enumerable: true, get: function () { return mllm_js_2.isOpenAIGPTLiveConfig; } });
|
|
14
|
+
Object.defineProperty(exports, "OPENAI_GPT_LIVE_VENDOR", { enumerable: true, get: function () { return mllm_js_2.OPENAI_GPT_LIVE_VENDOR; } });
|
|
15
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return mllm_js_2.OpenAIGPTLive; } });
|
|
16
|
+
/** @deprecated Use `new GeminiLive(options).toConfig()`. */
|
|
17
|
+
function buildGeminiPreviewConfig(options) {
|
|
18
|
+
return new mllm_js_1.GeminiLive(options).toConfig();
|
|
20
19
|
}
|
|
21
|
-
function normalizeMcpServers(servers) {
|
|
22
|
-
return servers.map((server) => (Object.assign({ transport: "streamable_http" }, server)));
|
|
23
|
-
}
|
|
24
|
-
class OpenAIGPTLive extends base_js_1.BaseMLLM {
|
|
25
|
-
constructor(options) {
|
|
26
|
-
super();
|
|
27
|
-
this.options = options;
|
|
28
|
-
if (!options.apiKey)
|
|
29
|
-
throw new Error("OpenAIGPTLive requires apiKey");
|
|
30
|
-
}
|
|
31
|
-
toConfig() {
|
|
32
|
-
var _a, _b;
|
|
33
|
-
const o = this.options;
|
|
34
|
-
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 }));
|
|
35
|
-
if (o.inputAudioTranscription !== undefined || "input_audio_transcription" in params) {
|
|
36
|
-
throw new Error("GPT Live v3 does not support input_audio_transcription");
|
|
37
|
-
}
|
|
38
|
-
if (o.turnDetection !== undefined || "turn_detection" in params) {
|
|
39
|
-
console.warn("GPT Live v3 ignores turn_detection; endpointing is internal");
|
|
40
|
-
delete params.turn_detection;
|
|
41
|
-
}
|
|
42
|
-
if (params.delegation !== undefined && params.delegation !== "client" && params.delegation !== "responses") {
|
|
43
|
-
throw new Error("GPT Live delegation must be client or responses");
|
|
44
|
-
}
|
|
45
|
-
if (params.headers !== undefined) {
|
|
46
|
-
let headers;
|
|
47
|
-
try {
|
|
48
|
-
headers = JSON.parse(String(params.headers));
|
|
49
|
-
}
|
|
50
|
-
catch (_c) {
|
|
51
|
-
throw new Error("GPT Live headers must be a JSON object string");
|
|
52
|
-
}
|
|
53
|
-
if (headers === null || typeof headers !== "object" || Array.isArray(headers)) {
|
|
54
|
-
throw new Error("GPT Live headers must be a JSON object string");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const session = params.session_params === undefined ? {} : params.session_params;
|
|
58
|
-
if (session === null || typeof session !== "object" || Array.isArray(session)) {
|
|
59
|
-
throw new Error("GPT Live session_params must be an object");
|
|
60
|
-
}
|
|
61
|
-
for (const key of ["model", "delegation", "audio", "instructions", "input"]) {
|
|
62
|
-
if (key in session)
|
|
63
|
-
throw new Error(`GPT Live session_params cannot override ${key}`);
|
|
64
|
-
}
|
|
65
|
-
let url = o.url ||
|
|
66
|
-
`${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(/^\/+/, "")}`;
|
|
67
|
-
if (!/^wss?:\/\/[^/]/i.test(url)) {
|
|
68
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
69
|
-
}
|
|
70
|
-
let parsed;
|
|
71
|
-
try {
|
|
72
|
-
parsed = new URL(url);
|
|
73
|
-
}
|
|
74
|
-
catch (_d) {
|
|
75
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
76
|
-
}
|
|
77
|
-
if ((parsed.protocol !== "ws:" && parsed.protocol !== "wss:") || !parsed.hostname) {
|
|
78
|
-
throw new Error("GPT Live url must be a full ws:// or wss:// endpoint");
|
|
79
|
-
}
|
|
80
|
-
if (parsed.hostname === "api.openai.com" && parsed.pathname === "/v1/live") {
|
|
81
|
-
parsed.pathname = "/v1/live/sessions";
|
|
82
|
-
url = parsed.toString();
|
|
83
|
-
}
|
|
84
|
-
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: exports.OPENAI_GPT_LIVE_VENDOR, api_key: o.apiKey, url,
|
|
85
|
-
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) }));
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
exports.OpenAIGPTLive = OpenAIGPTLive;
|
|
@@ -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.js";
|
|
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.js";
|
|
6
6
|
import type { AgentThinkAgentManagementRequest } from "../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.js";
|
|
7
7
|
import type { PresetInput } from "./presets.js";
|
|
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.js";
|
|
8
|
+
import type { AvatarConfig, LlmConfig, LlmGreetingConfigs, LlmTool, McpServer, McpServersItem, MllmConfig, SttConfig, TtsConfig } from "../types.js";
|
|
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.
|