agora-agents 2.9.0 → 2.11.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 +4 -3
- package/dist/cjs/agentkit/index.d.ts +10 -10
- package/dist/cjs/agentkit/index.js +13 -8
- package/dist/cjs/agentkit/preview/client.d.ts +5 -17
- package/dist/cjs/agentkit/preview/client.js +18 -84
- package/dist/cjs/agentkit/preview/gemini-tts.d.ts +31 -0
- package/dist/cjs/agentkit/preview/gemini-tts.js +32 -0
- package/dist/cjs/agentkit/preview/index.d.ts +6 -2
- package/dist/cjs/agentkit/preview/index.js +7 -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 +12 -5
- 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 +4 -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 +3 -2
- package/dist/esm/agentkit/index.d.mts +10 -10
- package/dist/esm/agentkit/index.mjs +4 -4
- package/dist/esm/agentkit/preview/client.d.mts +5 -17
- package/dist/esm/agentkit/preview/client.mjs +18 -84
- package/dist/esm/agentkit/preview/gemini-tts.d.mts +31 -0
- package/dist/esm/agentkit/preview/gemini-tts.mjs +28 -0
- package/dist/esm/agentkit/preview/index.d.mts +6 -2
- package/dist/esm/agentkit/preview/index.mjs +3 -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 +12 -5
- 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 +4 -2
- package/dist/esm/index.mjs +3 -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.11.0",
|
|
45
|
+
"User-Agent": "agora-agents/v2.11.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
|
}
|
|
@@ -696,6 +696,7 @@ class Agent {
|
|
|
696
696
|
const asrConfig = this._stt !== undefined || !allowMissingAsr
|
|
697
697
|
? this._resolveAsrConfig(turnDetectionConfig)
|
|
698
698
|
: undefined;
|
|
699
|
+
// Preview TTS extends the production schema; narrow only at the generated wire boundary.
|
|
699
700
|
const ttsConfig = this._tts;
|
|
700
701
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, base), { turn_detection: turnDetectionConfig }), (llmConfig && { llm: llmConfig })), (ttsConfig && { tts: ttsConfig })), (asrConfig && { asr: asrConfig }));
|
|
701
702
|
}
|
|
@@ -31,23 +31,23 @@ 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 {
|
|
35
|
-
export {
|
|
34
|
+
export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./preview/gemini-tts.js";
|
|
35
|
+
export { GeminiTTS, GeminiTTSModels } from "./preview/gemini-tts.js";
|
|
36
36
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
37
37
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
38
38
|
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";
|
|
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, 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
40
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
|
|
41
41
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
|
|
42
42
|
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";
|
|
43
|
+
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, type BaseMllmOptions, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
44
44
|
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
45
|
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
46
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
|
|
47
47
|
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";
|
|
48
|
+
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
49
|
+
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";
|
|
50
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
51
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SmallestAISTT, 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, SmallestAITTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
53
|
+
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.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.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.GeminiTTSModels = exports.GeminiTTS = 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 = exports.VertexAILLM = exports.OpenAI = 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,12 +85,9 @@ 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
|
|
89
|
-
Object.defineProperty(exports, "
|
|
90
|
-
Object.defineProperty(exports, "
|
|
91
|
-
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return vendors_js_1.GeminiLiveModels; } });
|
|
92
|
-
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return vendors_js_1.GeminiThinkingLevels; } });
|
|
93
|
-
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return vendors_js_1.OpenAIGPTLive; } });
|
|
88
|
+
var gemini_tts_js_1 = require("./preview/gemini-tts.js");
|
|
89
|
+
Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
|
|
90
|
+
Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
|
|
94
91
|
// Token generation
|
|
95
92
|
var token_js_1 = require("./token.js");
|
|
96
93
|
Object.defineProperty(exports, "ExpiresIn", { enumerable: true, get: function () { return token_js_1.ExpiresIn; } });
|
|
@@ -150,7 +147,13 @@ Object.defineProperty(exports, "VertexAILLM", { enumerable: true, get: function
|
|
|
150
147
|
// MLLM vendor classes
|
|
151
148
|
var mllm_js_1 = require("./vendors/mllm.js");
|
|
152
149
|
Object.defineProperty(exports, "AzureOpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.AzureOpenAIRealtime; } });
|
|
150
|
+
Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_MLLM_DEFAULT_MODEL; } });
|
|
151
|
+
Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_MLLM_URL; } });
|
|
152
|
+
Object.defineProperty(exports, "GEMINI_PREVIEW_MLLM_URL", { enumerable: true, get: function () { return mllm_js_1.GEMINI_PREVIEW_MLLM_URL; } });
|
|
153
153
|
Object.defineProperty(exports, "GeminiLive", { enumerable: true, get: function () { return mllm_js_1.GeminiLive; } });
|
|
154
|
+
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return mllm_js_1.GeminiLiveModels; } });
|
|
155
|
+
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return mllm_js_1.GeminiThinkingLevels; } });
|
|
156
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return mllm_js_1.OpenAIGPTLive; } });
|
|
154
157
|
Object.defineProperty(exports, "OpenAIRealtime", { enumerable: true, get: function () { return mllm_js_1.OpenAIRealtime; } });
|
|
155
158
|
Object.defineProperty(exports, "QwenOmni", { enumerable: true, get: function () { return mllm_js_1.QwenOmni; } });
|
|
156
159
|
Object.defineProperty(exports, "VertexAI", { enumerable: true, get: function () { return mllm_js_1.VertexAI; } });
|
|
@@ -168,6 +171,7 @@ Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function ()
|
|
|
168
171
|
Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function () { return stt_js_1.MicrosoftSTT; } });
|
|
169
172
|
Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
|
|
170
173
|
Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return stt_js_1.SarvamSTT; } });
|
|
174
|
+
Object.defineProperty(exports, "SmallestAISTT", { enumerable: true, get: function () { return stt_js_1.SmallestAISTT; } });
|
|
171
175
|
Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return stt_js_1.SpeechmaticsSTT; } });
|
|
172
176
|
Object.defineProperty(exports, "XAiSTT", { enumerable: true, get: function () { return stt_js_1.XAiSTT; } });
|
|
173
177
|
// TTS vendor classes
|
|
@@ -188,5 +192,6 @@ Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () {
|
|
|
188
192
|
Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
|
|
189
193
|
Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
|
|
190
194
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
|
|
195
|
+
Object.defineProperty(exports, "SmallestAITTS", { enumerable: true, get: function () { return tts_js_1.SmallestAITTS; } });
|
|
191
196
|
Object.defineProperty(exports, "TypecastTTS", { enumerable: true, get: function () { return tts_js_1.TypecastTTS; } });
|
|
192
197
|
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
|
-
/** Gemini preview
|
|
34
|
+
/** Gemini TTS preview gate; Gemini ASR and Live use production. */
|
|
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. */
|
|
@@ -53,21 +54,8 @@ export declare function previewRequestHeaders(features: readonly PreviewFeature[
|
|
|
53
54
|
export declare function createPreviewRoute(client: AgoraClient, features: readonly PreviewFeature[]): PreviewRoute;
|
|
54
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;
|
|
@@ -29,7 +29,6 @@ exports.requiredPreviewFeatures = requiredPreviewFeatures;
|
|
|
29
29
|
exports.applyPreviewShape = applyPreviewShape;
|
|
30
30
|
const Client_js_1 = require("../../api/resources/agentManagement/client/Client.js");
|
|
31
31
|
const Client_js_2 = require("../../api/resources/agents/client/Client.js");
|
|
32
|
-
const vendors_js_1 = require("./vendors.js");
|
|
33
32
|
/** Base URL that serves the preview providers. */
|
|
34
33
|
exports.PREVIEW_API_BASE_URL = "https://partner.ai.agora.io/preview/api/conversational-ai-agent";
|
|
35
34
|
/**
|
|
@@ -46,8 +45,9 @@ exports.PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
46
45
|
* preview endpoint.
|
|
47
46
|
*/
|
|
48
47
|
exports.PreviewFeatures = {
|
|
49
|
-
/** Gemini preview
|
|
48
|
+
/** Gemini TTS preview gate; Gemini ASR and Live use production. */
|
|
50
49
|
GeminiLive: "gemini-live",
|
|
50
|
+
/** @deprecated GPT Live now uses the production endpoint. */
|
|
51
51
|
LiveModels: "live-models",
|
|
52
52
|
};
|
|
53
53
|
/**
|
|
@@ -74,96 +74,30 @@ function createPreviewRoute(client, features) {
|
|
|
74
74
|
features: [...features],
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
/** ASR vendor served only by the preview endpoint. */
|
|
78
|
-
const PREVIEW_ASR_VENDORS = new Set();
|
|
79
|
-
/**
|
|
80
|
-
* Returns the preview features a start request needs, derived from the request
|
|
81
|
-
* body rather than from the vendor classes — so hand-written configs are
|
|
82
|
-
* covered too.
|
|
83
|
-
*/
|
|
84
|
-
const PREVIEW_MLLM_MODELS = new Set([
|
|
85
|
-
"models/gemini-3.8-live",
|
|
86
|
-
"models/gemini-3.8-live-extended-thinking",
|
|
87
|
-
]);
|
|
88
|
-
/**
|
|
89
|
-
* Whether a config carries the envelope the preview MLLM vendor classes emit:
|
|
90
|
-
* a top-level `mllm.api_key`, and a `url` on the Gemini Developer API host.
|
|
91
|
-
* GeminiLive configurations for older model IDs use a different URL: `""` or
|
|
92
|
-
* a WebSocket endpoint.
|
|
93
|
-
*
|
|
94
|
-
* This is the second recognition path, and it exists because keying only off
|
|
95
|
-
* {@link PREVIEW_MLLM_MODELS} makes an unrecognised model name fail silently:
|
|
96
|
-
* {@link applyPreviewShape} would stop retargeting `greeting_message`, the
|
|
97
|
-
* greeting would land in a field these models ignore, and the agent would
|
|
98
|
-
* simply never greet. A model name we have not listed yet is reachable by
|
|
99
|
-
* following this SDK's own advice to override `model` when Google renames one
|
|
100
|
-
* ahead of a release, so the failure has to not be silent.
|
|
101
|
-
*/
|
|
102
|
-
function hasPreviewMllmEnvelope(mllm) {
|
|
103
|
-
return (typeof mllm.api_key === "string" && typeof mllm.url === "string" && mllm.url.startsWith(vendors_js_1.GEMINI_PREVIEW_MLLM_URL));
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Whether an MLLM config targets a preview model — by name, or by the wire
|
|
107
|
-
* envelope only the preview vendor classes produce.
|
|
108
|
-
*/
|
|
109
|
-
function isPreviewMllm(mllm) {
|
|
110
|
-
var _a;
|
|
111
|
-
if (!mllm || mllm.vendor !== "gemini") {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
const model = (_a = mllm.params) === null || _a === void 0 ? void 0 : _a.model;
|
|
115
|
-
if (typeof model === "string" && PREVIEW_MLLM_MODELS.has(model)) {
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
118
|
-
return hasPreviewMllmEnvelope(mllm);
|
|
119
|
-
}
|
|
120
77
|
function requiredPreviewFeatures(properties) {
|
|
121
78
|
var _a;
|
|
122
|
-
|
|
123
|
-
const asrVendor = (_a = properties.asr) === null || _a === void 0 ? void 0 : _a.vendor;
|
|
124
|
-
if (asrVendor !== undefined && PREVIEW_ASR_VENDORS.has(asrVendor)) {
|
|
125
|
-
features.add(exports.PreviewFeatures.GeminiLive);
|
|
126
|
-
}
|
|
127
|
-
if ((0, vendors_js_1.isOpenAIGPTLiveConfig)(properties.mllm)) {
|
|
128
|
-
features.add(exports.PreviewFeatures.LiveModels);
|
|
129
|
-
}
|
|
130
|
-
if (isPreviewMllm(properties.mllm)) {
|
|
131
|
-
features.add(exports.PreviewFeatures.GeminiLive);
|
|
132
|
-
}
|
|
133
|
-
return [...features];
|
|
79
|
+
return ((_a = properties.tts) === null || _a === void 0 ? void 0 : _a.vendor) === "gemini" ? [exports.PreviewFeatures.GeminiLive] : [];
|
|
134
80
|
}
|
|
135
|
-
const
|
|
81
|
+
const PRODUCTION_GEMINI_MLLM_MODELS = new Set([
|
|
82
|
+
"models/gemini-3.8-live",
|
|
83
|
+
"models/gemini-3.8-live-extended-thinking",
|
|
84
|
+
]);
|
|
136
85
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
* `Agent` fills `mllm.greeting_message` from an agent-level `greeting` whenever
|
|
141
|
-
* the vendor has not set that key — correct for every GA vendor, but the
|
|
142
|
-
* preview Gemini models read `greeting`, so the value would land in a field
|
|
143
|
-
* they ignore and the agent would silently never greet.
|
|
144
|
-
*
|
|
145
|
-
* Rather than teach the shared builder about preview providers, the translation
|
|
146
|
-
* lives here and disappears with this directory at GA. The vendor's own value
|
|
147
|
-
* wins; the production-spelled one is the fallback, which also migrates a
|
|
148
|
-
* hand-written `greeting_message` onto the preview key so an existing config
|
|
149
|
-
* keeps working after only swapping the model.
|
|
150
|
-
*
|
|
151
|
-
* Mutates `properties.mllm` in place. Safe because every SDK hands this a fresh
|
|
152
|
-
* copy of the MLLM config rather than the Agent's stored one.
|
|
86
|
+
* Normalizes the historical Gemini preview greeting field for production.
|
|
87
|
+
* Kept under its old name so callers importing this compatibility helper do
|
|
88
|
+
* not need to change code when moving an existing request to production.
|
|
153
89
|
*/
|
|
154
90
|
function applyPreviewShape(properties) {
|
|
91
|
+
var _a;
|
|
155
92
|
const mllm = properties.mllm;
|
|
156
|
-
if (!mllm ||
|
|
93
|
+
if (!mllm ||
|
|
94
|
+
mllm.vendor !== "gemini" ||
|
|
95
|
+
typeof ((_a = mllm.params) === null || _a === void 0 ? void 0 : _a.model) !== "string" ||
|
|
96
|
+
!PRODUCTION_GEMINI_MLLM_MODELS.has(mllm.params.model)) {
|
|
157
97
|
return;
|
|
158
98
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
if (value === undefined) {
|
|
162
|
-
continue;
|
|
163
|
-
}
|
|
164
|
-
if (mllm[preview] === undefined) {
|
|
165
|
-
mllm[preview] = value;
|
|
166
|
-
}
|
|
167
|
-
delete mllm[production];
|
|
99
|
+
if (mllm.greeting_message === undefined && mllm.greeting !== undefined) {
|
|
100
|
+
mllm.greeting_message = mllm.greeting;
|
|
168
101
|
}
|
|
102
|
+
delete mllm.greeting;
|
|
169
103
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseTTS } from "../vendors/base.js";
|
|
2
|
+
/** Gemini 3.8 Flash TTS preview model. */
|
|
3
|
+
export declare const GeminiTTSModels: {
|
|
4
|
+
readonly Flash38: "gemini-3.8-flash-tts";
|
|
5
|
+
};
|
|
6
|
+
export type GeminiTTSModel = (typeof GeminiTTSModels)[keyof typeof GeminiTTSModels] | (string & {});
|
|
7
|
+
export interface GeminiTTSOptions {
|
|
8
|
+
apiKey: string;
|
|
9
|
+
/** Sent verbatim; defaults to Gemini 3.8 Flash TTS. */
|
|
10
|
+
model?: GeminiTTSModel;
|
|
11
|
+
/** Defaults to Puck. */
|
|
12
|
+
voice?: string;
|
|
13
|
+
/** Natural-language speaking instructions. Omitted unless supplied. */
|
|
14
|
+
style?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Preview wire shape, kept separate from the generated production schema. */
|
|
17
|
+
export interface GeminiTTSConfig {
|
|
18
|
+
vendor: "gemini";
|
|
19
|
+
params: {
|
|
20
|
+
api_key: string;
|
|
21
|
+
model: string;
|
|
22
|
+
voice: string;
|
|
23
|
+
style?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/** Preview-only TTS. AgentSession selects the gemini-live gate automatically. */
|
|
27
|
+
export declare class GeminiTTS extends BaseTTS {
|
|
28
|
+
private readonly options;
|
|
29
|
+
constructor(options: GeminiTTSOptions);
|
|
30
|
+
toConfig(): GeminiTTSConfig;
|
|
31
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeminiTTS = exports.GeminiTTSModels = void 0;
|
|
4
|
+
const base_js_1 = require("../vendors/base.js");
|
|
5
|
+
/** Gemini 3.8 Flash TTS preview model. */
|
|
6
|
+
exports.GeminiTTSModels = {
|
|
7
|
+
Flash38: "gemini-3.8-flash-tts",
|
|
8
|
+
};
|
|
9
|
+
/** Preview-only TTS. AgentSession selects the gemini-live gate automatically. */
|
|
10
|
+
class GeminiTTS extends base_js_1.BaseTTS {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
super();
|
|
13
|
+
for (const field of ["apiKey", "model", "voice"]) {
|
|
14
|
+
const value = options[field];
|
|
15
|
+
if ((field === "apiKey" || value !== undefined) && (typeof value !== "string" || !value.trim())) {
|
|
16
|
+
throw new Error(`GeminiTTS requires ${field}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (options.style !== undefined && typeof options.style !== "string") {
|
|
20
|
+
throw new Error("GeminiTTS style must be a string");
|
|
21
|
+
}
|
|
22
|
+
this.options = Object.assign({}, options);
|
|
23
|
+
}
|
|
24
|
+
toConfig() {
|
|
25
|
+
const { apiKey, model = exports.GeminiTTSModels.Flash38, voice = "Puck", style } = this.options;
|
|
26
|
+
return {
|
|
27
|
+
vendor: "gemini",
|
|
28
|
+
params: Object.assign({ api_key: apiKey, model, voice }, (style !== undefined && { style })),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.GeminiTTS = GeminiTTS;
|
|
@@ -4,9 +4,13 @@
|
|
|
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
12
|
export { applyPreviewShape, createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.js";
|
|
11
|
-
export type {
|
|
12
|
-
export {
|
|
13
|
+
export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./gemini-tts.js";
|
|
14
|
+
export { GeminiTTS, GeminiTTSModels } from "./gemini-tts.js";
|
|
15
|
+
export type { GeminiLiveModel, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, } from "./vendors.js";
|
|
16
|
+
export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, } from "./vendors.js";
|
|
@@ -6,7 +6,9 @@
|
|
|
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.GeminiTTSModels = exports.GeminiTTS = 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; } });
|
|
@@ -19,9 +21,12 @@ Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get
|
|
|
19
21
|
Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: function () { return client_js_1.PreviewFeatures; } });
|
|
20
22
|
Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
|
|
21
23
|
Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
|
|
24
|
+
var gemini_tts_js_1 = require("./gemini-tts.js");
|
|
25
|
+
Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
|
|
26
|
+
Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
|
|
22
27
|
var vendors_js_1 = require("./vendors.js");
|
|
23
28
|
Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_DEFAULT_MODEL; } });
|
|
29
|
+
Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_URL; } });
|
|
24
30
|
Object.defineProperty(exports, "GEMINI_PREVIEW_MLLM_URL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_PREVIEW_MLLM_URL; } });
|
|
25
31
|
Object.defineProperty(exports, "GeminiLiveModels", { enumerable: true, get: function () { return vendors_js_1.GeminiLiveModels; } });
|
|
26
32
|
Object.defineProperty(exports, "GeminiThinkingLevels", { enumerable: true, get: function () { return vendors_js_1.GeminiThinkingLevels; } });
|
|
27
|
-
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return vendors_js_1.OpenAIGPTLive; } });
|
|
@@ -1,105 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
import type { McpServersItem, MllmConfig, MllmTurnDetectionConfig } from "../types.js";
|
|
10
|
-
import { BaseMLLM } from "../vendors/base.js";
|
|
11
|
-
import type { GeminiLiveOptions } from "../vendors/mllm.js";
|
|
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.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()`. */
|
|
105
9
|
export declare function buildGeminiPreviewConfig(options: GeminiLiveOptions): MllmConfig;
|