agora-agents 2.14.0 → 2.15.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.d.ts +0 -1
- package/dist/cjs/agentkit/Agent.js +39 -11
- package/dist/cjs/agentkit/index.d.ts +7 -7
- package/dist/cjs/agentkit/index.js +6 -4
- package/dist/cjs/agentkit/types.d.ts +51 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +12 -0
- package/dist/cjs/agentkit/vendors/cn.js +16 -1
- package/dist/cjs/agentkit/vendors/stt.d.ts +24 -0
- package/dist/cjs/agentkit/vendors/stt.js +31 -1
- package/dist/cjs/agentkit/vendors/tts.d.ts +0 -38
- package/dist/cjs/agentkit/vendors/tts.js +1 -24
- package/dist/cjs/api/types/Asr.d.ts +10 -1
- package/dist/cjs/api/types/ElevenLabsAsr.d.ts +10 -0
- package/dist/cjs/api/types/ElevenLabsAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/ElevenLabsAsrParams.js +3 -0
- package/dist/cjs/api/types/FishAudioAsr.d.ts +10 -0
- package/dist/cjs/api/types/FishAudioAsr.js +3 -0
- package/dist/cjs/api/types/FishAudioAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/FishAudioAsrParams.js +3 -0
- package/dist/cjs/api/types/QwenAsr.d.ts +10 -0
- package/dist/cjs/api/types/QwenAsr.js +3 -0
- package/dist/cjs/api/types/QwenAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/QwenAsrParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +1 -4
- package/dist/cjs/api/types/index.d.ts +6 -2
- package/dist/cjs/api/types/index.js +6 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +7 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/agentkit/Agent.d.mts +0 -1
- package/dist/esm/agentkit/Agent.mjs +39 -11
- package/dist/esm/agentkit/index.d.mts +7 -7
- package/dist/esm/agentkit/index.mjs +3 -3
- package/dist/esm/agentkit/types.d.mts +51 -6
- package/dist/esm/agentkit/vendors/cn.d.mts +12 -0
- package/dist/esm/agentkit/vendors/cn.mjs +14 -0
- package/dist/esm/agentkit/vendors/stt.d.mts +24 -0
- package/dist/esm/agentkit/vendors/stt.mjs +28 -0
- package/dist/esm/agentkit/vendors/tts.d.mts +0 -38
- package/dist/esm/agentkit/vendors/tts.mjs +0 -22
- package/dist/esm/api/types/Asr.d.mts +10 -1
- package/dist/esm/api/types/ElevenLabsAsr.d.mts +10 -0
- package/dist/esm/api/types/ElevenLabsAsrParams.d.mts +9 -0
- package/dist/esm/api/types/ElevenLabsAsrParams.mjs +2 -0
- package/dist/esm/api/types/FishAudioAsr.d.mts +10 -0
- package/dist/esm/api/types/FishAudioAsr.mjs +2 -0
- package/dist/esm/api/types/FishAudioAsrParams.d.mts +9 -0
- package/dist/esm/api/types/FishAudioAsrParams.mjs +2 -0
- package/dist/esm/api/types/QwenAsr.d.mts +10 -0
- package/dist/esm/api/types/QwenAsr.mjs +2 -0
- package/dist/esm/api/types/QwenAsrParams.d.mts +9 -0
- package/dist/esm/api/types/QwenAsrParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +1 -4
- package/dist/esm/api/types/index.d.mts +6 -2
- package/dist/esm/api/types/index.mjs +6 -2
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +4 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/types/HumeAiTts.d.ts +0 -9
- package/dist/cjs/api/types/HumeAiTtsParams.d.ts +0 -29
- package/dist/cjs/api/types/HumeAiTtsParams.js +0 -12
- package/dist/esm/api/types/HumeAiTts.d.mts +0 -9
- package/dist/esm/api/types/HumeAiTtsParams.d.mts +0 -29
- package/dist/esm/api/types/HumeAiTtsParams.mjs +0 -9
- /package/dist/cjs/api/types/{HumeAiTts.js → ElevenLabsAsr.js} +0 -0
- /package/dist/esm/api/types/{HumeAiTts.mjs → ElevenLabsAsr.mjs} +0 -0
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.15.0",
|
|
45
|
+
"User-Agent": "agora-agents/v2.15.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);
|
|
@@ -61,6 +61,41 @@ function assertTurnDetectionLanguage(value) {
|
|
|
61
61
|
throw new Error(`Invalid turnDetection.language: ${value}`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
/** Joins a language list into the comma-separated string the API expects. */
|
|
65
|
+
function toWireLanguage(language) {
|
|
66
|
+
return typeof language === "string" ? language : [...new Set(language)].join(",");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Validates `turnDetection` and resolves `language` to the wire string.
|
|
70
|
+
*
|
|
71
|
+
* - Defaults `language` to en-US.
|
|
72
|
+
* - Semantic EoS takes only one English or Chinese language. The types already
|
|
73
|
+
* enforce this; the runtime check covers untyped callers.
|
|
74
|
+
* - Several languages with no EoS mode set fall back to silence VAD.
|
|
75
|
+
*/
|
|
76
|
+
function resolveTurnDetectionConfig(config) {
|
|
77
|
+
var _a, _b;
|
|
78
|
+
const language = (_a = config === null || config === void 0 ? void 0 : config.language) !== null && _a !== void 0 ? _a : DEFAULT_TURN_DETECTION_LANGUAGE;
|
|
79
|
+
const languages = typeof language === "string" ? [language] : [...new Set(language)];
|
|
80
|
+
if (languages.length === 0) {
|
|
81
|
+
throw new Error("turnDetection.language must not be an empty list");
|
|
82
|
+
}
|
|
83
|
+
languages.forEach(assertTurnDetectionLanguage);
|
|
84
|
+
const endOfSpeech = (_b = config === null || config === void 0 ? void 0 : config.config) === null || _b === void 0 ? void 0 : _b.end_of_speech;
|
|
85
|
+
if ((endOfSpeech === null || endOfSpeech === void 0 ? void 0 : endOfSpeech.mode) === "semantic") {
|
|
86
|
+
if (typeof language !== "string") {
|
|
87
|
+
throw new Error("turnDetection.language cannot be a list when end_of_speech.mode is semantic; use one English or Chinese language, or use end_of_speech.mode vad. Otherwise the service silently uses VAD instead of semantic end of speech");
|
|
88
|
+
}
|
|
89
|
+
if (!/^(en|zh)-/.test(language)) {
|
|
90
|
+
throw new Error(`Semantic end_of_speech supports only English and Chinese languages; got turnDetection.language: ${language}. Otherwise the service silently uses VAD instead of semantic end of speech`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const resolved = Object.assign(Object.assign({}, config), { language: languages.join(",") });
|
|
94
|
+
if (languages.length > 1 && (endOfSpeech === null || endOfSpeech === void 0 ? void 0 : endOfSpeech.mode) === undefined) {
|
|
95
|
+
resolved.config = Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.config), { end_of_speech: Object.assign(Object.assign({}, endOfSpeech), { mode: "vad" }) });
|
|
96
|
+
}
|
|
97
|
+
return resolved;
|
|
98
|
+
}
|
|
64
99
|
/**
|
|
65
100
|
* Agent class representing a reusable agent configuration.
|
|
66
101
|
*
|
|
@@ -663,7 +698,9 @@ class Agent {
|
|
|
663
698
|
}
|
|
664
699
|
return Object.assign(Object.assign(Object.assign({}, base), { mllm: mllmConfig }), (!isOpenAIGPTLive &&
|
|
665
700
|
this._turnDetection !== undefined && {
|
|
666
|
-
turn_detection: this._turnDetection,
|
|
701
|
+
turn_detection: Object.assign(Object.assign({}, this._turnDetection), (this._turnDetection.language !== undefined && {
|
|
702
|
+
language: toWireLanguage(this._turnDetection.language),
|
|
703
|
+
})),
|
|
667
704
|
}));
|
|
668
705
|
}
|
|
669
706
|
const skipCategories = new Set((_c = opts.skipVendorValidationCategories) !== null && _c !== void 0 ? _c : []);
|
|
@@ -691,7 +728,7 @@ class Agent {
|
|
|
691
728
|
: this._instructions
|
|
692
729
|
? [{ role: "system", content: this._instructions }]
|
|
693
730
|
: undefined, greeting_message: (_e = this._llm.greeting_message) !== null && _e !== void 0 ? _e : this._greeting, greeting_configs: (_f = this._llm.greeting_configs) !== null && _f !== void 0 ? _f : this._greetingConfigs, failure_message: (_g = this._llm.failure_message) !== null && _g !== void 0 ? _g : this._failureMessage, max_history: (_h = this._llm.max_history) !== null && _h !== void 0 ? _h : this._maxHistory }) : undefined;
|
|
694
|
-
const turnDetectionConfig = this.
|
|
731
|
+
const turnDetectionConfig = resolveTurnDetectionConfig(this._turnDetection);
|
|
695
732
|
const asrConfig = this._stt !== undefined || !allowMissingAsr
|
|
696
733
|
? this._resolveAsrConfig(turnDetectionConfig)
|
|
697
734
|
: undefined;
|
|
@@ -759,15 +796,6 @@ class Agent {
|
|
|
759
796
|
asrConfig.language = turnDetectionConfig.language;
|
|
760
797
|
return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
|
|
761
798
|
}
|
|
762
|
-
_resolveTurnDetectionConfig() {
|
|
763
|
-
var _a;
|
|
764
|
-
const turnDetection = Object.assign({}, ((_a = this._turnDetection) !== null && _a !== void 0 ? _a : {}));
|
|
765
|
-
const existingTurnDetectionLanguage = turnDetection.language;
|
|
766
|
-
const language = existingTurnDetectionLanguage !== null && existingTurnDetectionLanguage !== void 0 ? existingTurnDetectionLanguage : DEFAULT_TURN_DETECTION_LANGUAGE;
|
|
767
|
-
assertTurnDetectionLanguage(language);
|
|
768
|
-
turnDetection.language = language;
|
|
769
|
-
return turnDetection;
|
|
770
|
-
}
|
|
771
799
|
}
|
|
772
800
|
exports.Agent = Agent;
|
|
773
801
|
function _parseNumericUid(uid, label) {
|
|
@@ -35,18 +35,18 @@ export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, Previ
|
|
|
35
35
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
36
36
|
export type { GenerateClientTokenOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
37
37
|
export { ExpiresIn, generateClientToken, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
|
|
38
|
-
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,
|
|
38
|
+
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, 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, RtzrAsr, RtzrAsrParams, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SemanticEndOfSpeechLanguage, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarParams, SpeakConfig, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionLanguages, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
|
|
39
39
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LemonSliceOptions, LiveAvatarAvatarOptions, ProtofaceOptions, TavusOptions, } from "./vendors/avatar.js";
|
|
40
40
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LemonSlice, LiveAvatarAvatar, Protoface, Tavus, } from "./vendors/avatar.js";
|
|
41
41
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
|
|
42
42
|
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, type BaseMllmOptions, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
43
|
-
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, FengmingSTTOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, MiniMaxDuplexTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunSTTOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
|
|
44
|
-
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, MiniMaxDuplexTTS, SensetimeAvatar, SpatiusAvatar, StepFunSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
|
|
43
|
+
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, FengmingSTTOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, MiniMaxDuplexTTSOptions, QwenSTTOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunSTTOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
|
|
44
|
+
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, MiniMaxDuplexTTS, QwenSTT, SensetimeAvatar, SpatiusAvatar, StepFunSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
|
|
45
45
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
|
|
46
46
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
|
|
47
47
|
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
48
48
|
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";
|
|
49
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, RTZRSTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
50
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, RTZRSTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
51
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions,
|
|
52
|
-
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GeminiTTS, GeminiTTSModels, GenericTTS, GoogleTTS, GradiumTTS,
|
|
49
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, ElevenLabsSTTOptions, FishAudioSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, RTZRSTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
50
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, ElevenLabsSTT, FishAudioSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, RTZRSTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
51
|
+
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, SmallestAITTSOptions, SonioxTTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
52
|
+
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GeminiTTS, GeminiTTSModels, GenericTTS, GoogleTTS, GradiumTTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SarvamTTSLanguage, SmallestAITTS, SonioxTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
|
|
@@ -21,9 +21,9 @@
|
|
|
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.
|
|
25
|
-
exports.
|
|
26
|
-
exports.XAiTTS = exports.TypecastTTS = exports.SonioxTTS = exports.SmallestAITTS = exports.SarvamTTSLanguage = exports.SarvamTTS = void 0;
|
|
24
|
+
exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.StepFunSTT = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.QwenSTT = exports.MiniMaxDuplexTTS = 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.Tavus = exports.Protoface = exports.LiveAvatarAvatar = exports.LemonSlice = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.generateClientToken = exports.ExpiresIn = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = void 0;
|
|
25
|
+
exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.GeminiTTSModels = exports.GeminiTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SmallestAISTT = exports.SarvamSTT = exports.RTZRSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.FishAudioSTT = exports.ElevenLabsSTT = 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 = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = void 0;
|
|
26
|
+
exports.XAiTTS = exports.TypecastTTS = exports.SonioxTTS = exports.SmallestAITTS = exports.SarvamTTSLanguage = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = void 0;
|
|
27
27
|
// Core classes
|
|
28
28
|
var Agent_js_1 = require("./Agent.js");
|
|
29
29
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
|
|
@@ -127,6 +127,7 @@ Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: functi
|
|
|
127
127
|
Object.defineProperty(exports, "MicrosoftCNTTS", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNTTS; } });
|
|
128
128
|
Object.defineProperty(exports, "MiniMaxCNTTS", { enumerable: true, get: function () { return cn_js_1.MiniMaxCNTTS; } });
|
|
129
129
|
Object.defineProperty(exports, "MiniMaxDuplexTTS", { enumerable: true, get: function () { return cn_js_1.MiniMaxDuplexTTS; } });
|
|
130
|
+
Object.defineProperty(exports, "QwenSTT", { enumerable: true, get: function () { return cn_js_1.QwenSTT; } });
|
|
130
131
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return cn_js_1.SensetimeAvatar; } });
|
|
131
132
|
Object.defineProperty(exports, "SpatiusAvatar", { enumerable: true, get: function () { return cn_js_1.SpatiusAvatar; } });
|
|
132
133
|
Object.defineProperty(exports, "StepFunSTT", { enumerable: true, get: function () { return cn_js_1.StepFunSTT; } });
|
|
@@ -168,6 +169,8 @@ Object.defineProperty(exports, "AmazonSTT", { enumerable: true, get: function ()
|
|
|
168
169
|
Object.defineProperty(exports, "AresSTT", { enumerable: true, get: function () { return stt_js_1.AresSTT; } });
|
|
169
170
|
Object.defineProperty(exports, "AssemblyAISTT", { enumerable: true, get: function () { return stt_js_1.AssemblyAISTT; } });
|
|
170
171
|
Object.defineProperty(exports, "DeepgramSTT", { enumerable: true, get: function () { return stt_js_1.DeepgramSTT; } });
|
|
172
|
+
Object.defineProperty(exports, "ElevenLabsSTT", { enumerable: true, get: function () { return stt_js_1.ElevenLabsSTT; } });
|
|
173
|
+
Object.defineProperty(exports, "FishAudioSTT", { enumerable: true, get: function () { return stt_js_1.FishAudioSTT; } });
|
|
171
174
|
Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
|
|
172
175
|
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
|
|
173
176
|
Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
|
|
@@ -191,7 +194,6 @@ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: funct
|
|
|
191
194
|
Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
|
|
192
195
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
|
|
193
196
|
Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return tts_js_1.GradiumTTS; } });
|
|
194
|
-
Object.defineProperty(exports, "HumeAITTS", { enumerable: true, get: function () { return tts_js_1.HumeAITTS; } });
|
|
195
197
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return tts_js_1.MicrosoftTTS; } });
|
|
196
198
|
Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return tts_js_1.MiniMaxTTS; } });
|
|
197
199
|
Object.defineProperty(exports, "MistralTTS", { enumerable: true, get: function () { return tts_js_1.MistralTTS; } });
|
|
@@ -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,
|
|
5
|
+
import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsAsrParams, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioAsrParams, 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, 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, QwenAsrParams, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, RtzrAsrParams as RtzrAsrParamsType, RtzrAsr as RtzrAsrType, 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) */
|
|
@@ -13,6 +13,18 @@ export type LlmStyle = Llm.Style;
|
|
|
13
13
|
* When using shorthand strings or minimal configs, the untyped variant is available.
|
|
14
14
|
*/
|
|
15
15
|
export type SttConfig = {
|
|
16
|
+
vendor: "elevenlabs";
|
|
17
|
+
language?: TurnDetectionLanguage;
|
|
18
|
+
params: ElevenLabsAsrParams;
|
|
19
|
+
} | {
|
|
20
|
+
vendor: "fishaudio";
|
|
21
|
+
language?: TurnDetectionLanguage;
|
|
22
|
+
params: FishAudioAsrParams;
|
|
23
|
+
} | {
|
|
24
|
+
vendor: "qwen";
|
|
25
|
+
language?: TurnDetectionLanguage;
|
|
26
|
+
params: QwenAsrParams;
|
|
27
|
+
} | {
|
|
16
28
|
vendor: "fengming";
|
|
17
29
|
language?: TurnDetectionLanguage;
|
|
18
30
|
keywords?: string[];
|
|
@@ -107,10 +119,45 @@ export type AvatarConfig = StartAgentsRequest.Properties.Avatar;
|
|
|
107
119
|
export type AvatarWireVendor = StartAgentsRequest.Properties.Avatar.Vendor;
|
|
108
120
|
/** BCP-47 language tag used by `turn_detection.language`. */
|
|
109
121
|
export type TurnDetectionLanguage = AsrLanguage;
|
|
110
|
-
/**
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Languages supported by semantic end-of-speech detection
|
|
124
|
+
* (`turn_detection.config.end_of_speech.mode = "semantic"`): English and Chinese only.
|
|
125
|
+
*/
|
|
126
|
+
export type SemanticEndOfSpeechLanguage = Extract<TurnDetectionLanguage, `en-${string}` | `zh-${string}`>;
|
|
127
|
+
/**
|
|
128
|
+
* One language, or a non-empty list of languages for multi-language sessions.
|
|
129
|
+
* A list is sent to `asr.language` as a comma-separated string.
|
|
130
|
+
*/
|
|
131
|
+
export type TurnDetectionLanguages = TurnDetectionLanguage | readonly [TurnDetectionLanguage, ...TurnDetectionLanguage[]];
|
|
132
|
+
type TurnDetectionBase = Omit<StartAgentsRequest.Properties.TurnDetection, "language" | "config">;
|
|
133
|
+
type GeneratedEndOfSpeech = StartAgentsRequest.Properties.TurnDetection.Config.EndOfSpeech;
|
|
134
|
+
/** Semantic EoS: only one English or Chinese language. */
|
|
135
|
+
type SemanticTurnDetectionConfig = TurnDetectionBase & {
|
|
136
|
+
config: TurnDetectionNestedConfig & {
|
|
137
|
+
end_of_speech: GeneratedEndOfSpeech & {
|
|
138
|
+
mode: "semantic";
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
language?: SemanticEndOfSpeechLanguage;
|
|
113
142
|
};
|
|
143
|
+
/** VAD or manual EoS (or unset): one language or a list of languages. */
|
|
144
|
+
type NonSemanticTurnDetectionConfig = TurnDetectionBase & {
|
|
145
|
+
config?: TurnDetectionNestedConfig & {
|
|
146
|
+
end_of_speech?: Omit<GeneratedEndOfSpeech, "mode"> & {
|
|
147
|
+
mode?: Exclude<EndOfSpeechMode, "semantic">;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
language?: TurnDetectionLanguages;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Turn detection configuration.
|
|
154
|
+
*
|
|
155
|
+
* `language` takes one BCP-47 tag or a list of tags. A list cannot be used with
|
|
156
|
+
* semantic end-of-speech: TypeScript reports an error at compile time, and the
|
|
157
|
+
* SDK also throws at runtime. When a list has more than one language and
|
|
158
|
+
* `end_of_speech.mode` is unset, the SDK sends `end_of_speech.mode = "vad"`.
|
|
159
|
+
*/
|
|
160
|
+
export type TurnDetectionConfig = NonSemanticTurnDetectionConfig | SemanticTurnDetectionConfig;
|
|
114
161
|
/** Detailed nested config for turn detection (`turn_detection.config`) */
|
|
115
162
|
export type TurnDetectionNestedConfig = StartAgentsRequest.Properties.TurnDetection.Config;
|
|
116
163
|
/** Start of Speech (SoS) detection configuration (`turn_detection.config.start_of_speech`) */
|
|
@@ -585,8 +632,6 @@ export type CartesiaTts = CartesiaTtsType;
|
|
|
585
632
|
export type CartesiaTtsParams = CartesiaTtsParamsType;
|
|
586
633
|
export type OpenAiTts = OpenAiTtsType;
|
|
587
634
|
export type OpenAiTtsParams = OpenAiTtsParamsType;
|
|
588
|
-
export type HumeAiTts = HumeAiTtsType;
|
|
589
|
-
export type HumeAiTtsParams = HumeAiTtsParamsType;
|
|
590
635
|
export type RimeTts = RimeTtsType;
|
|
591
636
|
export type RimeTtsParams = RimeTtsParamsType;
|
|
592
637
|
export type FishAudioTts = FishAudioTtsType;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import type { MinimaxDuplexTtsParams } from "../../api/index.js";
|
|
2
2
|
import type { AvatarConfig, LlmConfig, SttConfig, TtsConfig } from "../types.js";
|
|
3
3
|
import { BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, type BaseLlmOptions } from "./base.js";
|
|
4
|
+
/** Constructor options for mainland China Qwen ASR. */
|
|
5
|
+
export interface QwenSTTOptions {
|
|
6
|
+
apiKey: string;
|
|
7
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
8
|
+
additionalParams?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Qwen ASR for mainland China. */
|
|
11
|
+
export declare class QwenSTT extends BaseCNSTT {
|
|
12
|
+
private readonly options;
|
|
13
|
+
constructor(options: QwenSTTOptions);
|
|
14
|
+
toConfig(): SttConfig;
|
|
15
|
+
}
|
|
4
16
|
export interface FengmingSTTOptions {
|
|
5
17
|
/** Hotwords that improve recognition accuracy */
|
|
6
18
|
keywords?: string[];
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpatiusAvatar = exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.MiniMaxDuplexTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.StepFunSTT = exports.FengmingSTT = void 0;
|
|
3
|
+
exports.SpatiusAvatar = exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.MiniMaxDuplexTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.StepFunSTT = exports.FengmingSTT = exports.QwenSTT = void 0;
|
|
4
4
|
const base_js_1 = require("./base.js");
|
|
5
5
|
function requireString(value, field, vendor) {
|
|
6
6
|
if (typeof value !== "string" || value.length === 0) {
|
|
7
7
|
throw new Error(`${vendor} requires ${field}`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
+
/** Qwen ASR for mainland China. */
|
|
11
|
+
class QwenSTT extends base_js_1.BaseCNSTT {
|
|
12
|
+
constructor(options) {
|
|
13
|
+
super();
|
|
14
|
+
this.options = options;
|
|
15
|
+
requireString(options.apiKey, "apiKey", "QwenSTT");
|
|
16
|
+
}
|
|
17
|
+
toConfig() {
|
|
18
|
+
return {
|
|
19
|
+
vendor: "qwen",
|
|
20
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.QwenSTT = QwenSTT;
|
|
10
25
|
class FengmingSTT extends base_js_1.BaseCNSTT {
|
|
11
26
|
constructor(options = {}) {
|
|
12
27
|
var _a;
|
|
@@ -4,6 +4,30 @@
|
|
|
4
4
|
import { type DeepgramPresetModel } from "../presets.js";
|
|
5
5
|
import type { SttConfig, TurnDetectionLanguage } from "../types.js";
|
|
6
6
|
import { BaseSTT, type SampleRate } from "./base.js";
|
|
7
|
+
/** Constructor options for global ElevenLabs ASR. */
|
|
8
|
+
export interface ElevenLabsSTTOptions {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
11
|
+
additionalParams?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
/** ElevenLabs ASR for global deployments. */
|
|
14
|
+
export declare class ElevenLabsSTT extends BaseSTT {
|
|
15
|
+
private readonly options;
|
|
16
|
+
constructor(options: ElevenLabsSTTOptions);
|
|
17
|
+
toConfig(): SttConfig;
|
|
18
|
+
}
|
|
19
|
+
/** Constructor options for global Fish Audio ASR. */
|
|
20
|
+
export interface FishAudioSTTOptions {
|
|
21
|
+
apiKey: string;
|
|
22
|
+
/** Additional provider parameters. Explicit options take precedence. */
|
|
23
|
+
additionalParams?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/** Fish Audio ASR for global deployments. */
|
|
26
|
+
export declare class FishAudioSTT extends BaseSTT {
|
|
27
|
+
private readonly options;
|
|
28
|
+
constructor(options: FishAudioSTTOptions);
|
|
29
|
+
toConfig(): SttConfig;
|
|
30
|
+
}
|
|
7
31
|
/** Gemini transcription models. */
|
|
8
32
|
export declare const GeminiSTTModels: {
|
|
9
33
|
readonly Transcribe35Live: "gemini-3.5-transcribe-live";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type-safe STT (Speech-to-Text) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SmallestAISTT = exports.XAiSTT = exports.RTZRSTT = exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = exports.GeminiSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = void 0;
|
|
6
|
+
exports.SmallestAISTT = exports.XAiSTT = exports.RTZRSTT = exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = exports.GeminiSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.FishAudioSTT = exports.ElevenLabsSTT = void 0;
|
|
7
7
|
const presets_js_1 = require("../presets.js");
|
|
8
8
|
const base_js_1 = require("./base.js");
|
|
9
9
|
function _requireString(value, field, vendor) {
|
|
@@ -11,6 +11,36 @@ function _requireString(value, field, vendor) {
|
|
|
11
11
|
throw new Error(`${vendor} requires ${field}`);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
/** ElevenLabs ASR for global deployments. */
|
|
15
|
+
class ElevenLabsSTT extends base_js_1.BaseSTT {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
super();
|
|
18
|
+
this.options = options;
|
|
19
|
+
_requireString(options.apiKey, "apiKey", "ElevenLabsSTT");
|
|
20
|
+
}
|
|
21
|
+
toConfig() {
|
|
22
|
+
return {
|
|
23
|
+
vendor: "elevenlabs",
|
|
24
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.ElevenLabsSTT = ElevenLabsSTT;
|
|
29
|
+
/** Fish Audio ASR for global deployments. */
|
|
30
|
+
class FishAudioSTT extends base_js_1.BaseSTT {
|
|
31
|
+
constructor(options) {
|
|
32
|
+
super();
|
|
33
|
+
this.options = options;
|
|
34
|
+
_requireString(options.apiKey, "apiKey", "FishAudioSTT");
|
|
35
|
+
}
|
|
36
|
+
toConfig() {
|
|
37
|
+
return {
|
|
38
|
+
vendor: "fishaudio",
|
|
39
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FishAudioSTT = FishAudioSTT;
|
|
14
44
|
function isDeepgramManagedModel(model) {
|
|
15
45
|
return model !== undefined && presets_js_1.DeepgramPresetModels.includes(model.trim().toLowerCase());
|
|
16
46
|
}
|
|
@@ -399,44 +399,6 @@ export declare class TypecastTTS extends BaseTTS {
|
|
|
399
399
|
constructor(options: TypecastTTSOptions);
|
|
400
400
|
toConfig(): TtsConfig;
|
|
401
401
|
}
|
|
402
|
-
/**
|
|
403
|
-
* Constructor options for Hume AI TTS.
|
|
404
|
-
*/
|
|
405
|
-
export interface HumeAITTSOptions {
|
|
406
|
-
/** Hume AI API key */
|
|
407
|
-
key: string;
|
|
408
|
-
/** Configuration ID */
|
|
409
|
-
configId?: string;
|
|
410
|
-
/** Hume AI voice ID */
|
|
411
|
-
voiceId: string;
|
|
412
|
-
/** Base URL for the Hume AI API */
|
|
413
|
-
baseUrl?: string;
|
|
414
|
-
/** Voice provider type */
|
|
415
|
-
provider: "HUME_AI" | "CUSTOM_VOICE";
|
|
416
|
-
/** Playback speed of the generated speech */
|
|
417
|
-
speed?: number;
|
|
418
|
-
/** Duration of silence in seconds to add at the end of each utterance */
|
|
419
|
-
trailingSilence?: number;
|
|
420
|
-
/** Skip patterns for bracketed content */
|
|
421
|
-
skipPatterns?: number[];
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Hume AI TTS vendor.
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```typescript
|
|
428
|
-
* const tts = new HumeAITTS({
|
|
429
|
-
* key: process.env.HUME_API_KEY,
|
|
430
|
-
* voiceId: 'voice-id',
|
|
431
|
-
* provider: 'CUSTOM_VOICE',
|
|
432
|
-
* });
|
|
433
|
-
* ```
|
|
434
|
-
*/
|
|
435
|
-
export declare class HumeAITTS extends BaseTTS {
|
|
436
|
-
private readonly options;
|
|
437
|
-
constructor(options: HumeAITTSOptions);
|
|
438
|
-
toConfig(): TtsConfig;
|
|
439
|
-
}
|
|
440
402
|
/**
|
|
441
403
|
* Constructor options for Rime TTS.
|
|
442
404
|
*
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Type-safe TTS (Text-to-Speech) vendor classes.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SmallestAITTS = exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.SarvamTTSLanguage = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.
|
|
6
|
+
exports.SmallestAITTS = exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.SarvamTTSLanguage = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.TypecastTTS = exports.MistralTTS = exports.GradiumTTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = exports.GeminiTTS = exports.GeminiTTSModels = exports.SonioxTTS = void 0;
|
|
7
7
|
const SarvamTtsParams_js_1 = require("../../api/types/SarvamTtsParams.js");
|
|
8
8
|
const constants_js_1 = require("../constants.js");
|
|
9
9
|
const presets_js_1 = require("../presets.js");
|
|
@@ -292,29 +292,6 @@ class TypecastTTS extends base_js_1.BaseTTS {
|
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
exports.TypecastTTS = TypecastTTS;
|
|
295
|
-
/**
|
|
296
|
-
* Hume AI TTS vendor.
|
|
297
|
-
*
|
|
298
|
-
* @example
|
|
299
|
-
* ```typescript
|
|
300
|
-
* const tts = new HumeAITTS({
|
|
301
|
-
* key: process.env.HUME_API_KEY,
|
|
302
|
-
* voiceId: 'voice-id',
|
|
303
|
-
* provider: 'CUSTOM_VOICE',
|
|
304
|
-
* });
|
|
305
|
-
* ```
|
|
306
|
-
*/
|
|
307
|
-
class HumeAITTS extends base_js_1.BaseTTS {
|
|
308
|
-
constructor(options) {
|
|
309
|
-
super();
|
|
310
|
-
this.options = options;
|
|
311
|
-
}
|
|
312
|
-
toConfig() {
|
|
313
|
-
const { key, configId, voiceId, baseUrl, provider, speed, trailingSilence, skipPatterns } = this.options;
|
|
314
|
-
return Object.assign({ vendor: "humeai", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ key, voice_id: voiceId }, (baseUrl && { base_url: baseUrl })), { provider }), (speed !== undefined && { speed })), (trailingSilence !== undefined && { trailing_silence: trailingSilence })), (configId && { config_id: configId })) }, (skipPatterns && { skip_patterns: skipPatterns }));
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
exports.HumeAITTS = HumeAITTS;
|
|
318
295
|
/**
|
|
319
296
|
* Rime TTS vendor.
|
|
320
297
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Gemini | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Rtzr | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect | Agora.Asr.Smallestai | Agora.Asr.Stepfun;
|
|
2
|
+
export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Gemini | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Rtzr | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect | Agora.Asr.Smallestai | Agora.Asr.Stepfun | Agora.Asr.Elevenlabs | Agora.Asr.Fishaudio | Agora.Asr.Qwen;
|
|
3
3
|
export declare namespace Asr {
|
|
4
4
|
interface Ares extends Agora.AresAsr {
|
|
5
5
|
vendor: "ares";
|
|
@@ -58,4 +58,13 @@ export declare namespace Asr {
|
|
|
58
58
|
interface Stepfun extends Agora.StepfunAsr {
|
|
59
59
|
vendor: "stepfun";
|
|
60
60
|
}
|
|
61
|
+
interface Elevenlabs extends Agora.ElevenLabsAsr {
|
|
62
|
+
vendor: "elevenlabs";
|
|
63
|
+
}
|
|
64
|
+
interface Fishaudio extends Agora.FishAudioAsr {
|
|
65
|
+
vendor: "fishaudio";
|
|
66
|
+
}
|
|
67
|
+
interface Qwen extends Agora.QwenAsr {
|
|
68
|
+
vendor: "qwen";
|
|
69
|
+
}
|
|
61
70
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Agora from "../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* ElevenLabs ASR configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface ElevenLabsAsr {
|
|
6
|
+
language?: Agora.AsrLanguage;
|
|
7
|
+
params: Agora.ElevenLabsAsrParams;
|
|
8
|
+
/** Accepts any additional properties */
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Agora from "../index.js";
|
|
2
|
-
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.MinimaxDuplex | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.
|
|
2
|
+
export type Tts = Agora.Tts.Tencent | Agora.Tts.Bytedance | Agora.Tts.Microsoft | Agora.Tts.Elevenlabs | Agora.Tts.Minimax | Agora.Tts.MinimaxDuplex | Agora.Tts.Murf | Agora.Tts.Cartesia | Agora.Tts.Openai | Agora.Tts.Rime | Agora.Tts.Fishaudio | Agora.Tts.Google | Agora.Tts.Gemini | Agora.Tts.Amazon | Agora.Tts.Sarvam | Agora.Tts.GenericHttp | Agora.Tts.Xai | Agora.Tts.Deepgram | Agora.Tts.Cosyvoice | Agora.Tts.BytedanceDuplex | Agora.Tts.Stepfun | Agora.Tts.Gradium | Agora.Tts.Mistral | Agora.Tts.Typecast | Agora.Tts.Smallestai | Agora.Tts.Soniox;
|
|
3
3
|
export declare namespace Tts {
|
|
4
4
|
interface Tencent extends Agora.TencentTts {
|
|
5
5
|
vendor: "tencent";
|
|
@@ -28,9 +28,6 @@ export declare namespace Tts {
|
|
|
28
28
|
interface Openai extends Agora.OpenAiTts {
|
|
29
29
|
vendor: "openai";
|
|
30
30
|
}
|
|
31
|
-
interface Humeai extends Agora.HumeAiTts {
|
|
32
|
-
vendor: "humeai";
|
|
33
|
-
}
|
|
34
31
|
interface Rime extends Agora.RimeTts {
|
|
35
32
|
vendor: "rime";
|
|
36
33
|
}
|