agora-agents 2.13.1 → 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/AgentSession.js +8 -5
- package/dist/cjs/agentkit/index.d.ts +8 -7
- package/dist/cjs/agentkit/index.js +9 -4
- package/dist/cjs/agentkit/types.d.ts +51 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +46 -0
- package/dist/cjs/agentkit/vendors/cn.js +48 -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 +22 -38
- package/dist/cjs/agentkit/vendors/tts.js +17 -24
- package/dist/cjs/api/types/Asr.d.ts +13 -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/MinimaxDuplexTts.d.ts +13 -0
- package/dist/cjs/api/types/MinimaxDuplexTts.js +3 -0
- package/dist/cjs/api/types/MinimaxDuplexTtsParams.d.ts +87 -0
- package/dist/cjs/api/types/MinimaxDuplexTtsParams.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/{HumeAiTts.d.ts → SonioxTts.d.ts} +3 -3
- package/dist/cjs/api/types/SonioxTts.js +3 -0
- package/dist/cjs/api/types/SonioxTtsParams.d.ts +29 -0
- package/dist/cjs/api/types/SonioxTtsParams.js +3 -0
- package/dist/cjs/api/types/StepfunAsr.d.ts +10 -0
- package/dist/cjs/api/types/StepfunAsr.js +3 -0
- package/dist/cjs/api/types/StepfunAsrParams.d.ts +9 -0
- package/dist/cjs/api/types/StepfunAsrParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +7 -4
- package/dist/cjs/api/types/index.d.ts +12 -2
- package/dist/cjs/api/types/index.js +12 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +10 -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/AgentSession.mjs +8 -5
- package/dist/esm/agentkit/index.d.mts +8 -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 +46 -0
- package/dist/esm/agentkit/vendors/cn.mjs +44 -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 +22 -38
- package/dist/esm/agentkit/vendors/tts.mjs +15 -22
- package/dist/esm/api/types/Asr.d.mts +13 -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/MinimaxDuplexTts.d.mts +13 -0
- package/dist/esm/api/types/MinimaxDuplexTts.mjs +2 -0
- package/dist/esm/api/types/MinimaxDuplexTtsParams.d.mts +87 -0
- package/dist/esm/api/types/MinimaxDuplexTtsParams.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/{HumeAiTts.d.mts → SonioxTts.d.mts} +3 -3
- package/dist/esm/api/types/SonioxTts.mjs +2 -0
- package/dist/esm/api/types/SonioxTtsParams.d.mts +29 -0
- package/dist/esm/api/types/SonioxTtsParams.mjs +2 -0
- package/dist/esm/api/types/StepfunAsr.d.mts +10 -0
- package/dist/esm/api/types/StepfunAsr.mjs +2 -0
- package/dist/esm/api/types/StepfunAsrParams.d.mts +9 -0
- package/dist/esm/api/types/StepfunAsrParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +7 -4
- package/dist/esm/api/types/index.d.mts +12 -2
- package/dist/esm/api/types/index.mjs +12 -2
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +5 -5
- 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/HumeAiTtsParams.d.ts +0 -29
- package/dist/cjs/api/types/HumeAiTtsParams.js +0 -12
- 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) {
|
|
@@ -233,6 +233,7 @@ class AgentSession {
|
|
|
233
233
|
* @throws {Error} If configuration is invalid
|
|
234
234
|
*/
|
|
235
235
|
_validateAvatarConfig() {
|
|
236
|
+
var _a;
|
|
236
237
|
const agentConfig = this._agent.config;
|
|
237
238
|
const avatar = agentConfig.avatar;
|
|
238
239
|
const tts = this._agent.tts;
|
|
@@ -264,11 +265,13 @@ class AgentSession {
|
|
|
264
265
|
// Note: tts can be a string (shorthand) or an object with params
|
|
265
266
|
// Sample-rate fields vary by provider, so check the generated wire names dynamically.
|
|
266
267
|
const ttsParams = tts && typeof tts !== "string" ? tts.params : undefined;
|
|
267
|
-
const sampleRate =
|
|
268
|
-
?
|
|
269
|
-
: ttsParams && "
|
|
270
|
-
? ttsParams.
|
|
271
|
-
:
|
|
268
|
+
const sampleRate = tts && typeof tts !== "string" && tts.vendor === "minimax_duplex"
|
|
269
|
+
? (_a = tts.params.audio_setting) === null || _a === void 0 ? void 0 : _a.sample_rate
|
|
270
|
+
: ttsParams && "sample_rate" in ttsParams
|
|
271
|
+
? ttsParams.sample_rate
|
|
272
|
+
: ttsParams && "speech_sample_rate" in ttsParams
|
|
273
|
+
? ttsParams.speech_sample_rate
|
|
274
|
+
: undefined;
|
|
272
275
|
if (typeof sampleRate === "number") {
|
|
273
276
|
if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) || (0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) || (0, avatar_types_js_1.isAkoolAvatar)(strictAvatar)) {
|
|
274
277
|
(0, avatar_types_js_1.validateTtsSampleRate)(strictAvatar, sampleRate);
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* 3. **Convenience methods** (say, stop, interrupt, etc.) are the only
|
|
19
19
|
* parts that need manual updates when adding new sugar.
|
|
20
20
|
*/
|
|
21
|
+
export type { MinimaxDuplexTts, MinimaxDuplexTtsParams, SonioxTts, SonioxTtsParams, StepfunAsr, StepfunAsrParams, } from "../api/index.js";
|
|
21
22
|
export type { AgentsClient } from "../api/resources/agents/client/Client.js";
|
|
22
23
|
export type { AgentOptions } from "./Agent.js";
|
|
23
24
|
export { Agent } from "./Agent.js";
|
|
@@ -34,18 +35,18 @@ export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, Previ
|
|
|
34
35
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
35
36
|
export type { GenerateClientTokenOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
36
37
|
export { ExpiresIn, generateClientToken, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
|
|
37
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams,
|
|
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";
|
|
38
39
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LemonSliceOptions, LiveAvatarAvatarOptions, ProtofaceOptions, TavusOptions, } from "./vendors/avatar.js";
|
|
39
40
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LemonSlice, LiveAvatarAvatar, Protoface, Tavus, } from "./vendors/avatar.js";
|
|
40
41
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
|
|
41
42
|
export { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, type BaseLlmOptions, BaseMLLM, type BaseMllmOptions, BaseSTT, BaseTTS, type GoogleTTSSampleRate, } from "./vendors/base.js";
|
|
42
|
-
export type { AliyunLLMOptions, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CosyVoiceTTSOptions, DeepSeekLLMOptions, FengmingSTTOptions, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MiniMaxCNTTSOptions, SensetimeAvatarOptions, SpatiusAvatarOptions, StepFunTTSOptions, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./vendors/cn.js";
|
|
43
|
-
export { AliyunLLM, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CosyVoiceTTS, DeepSeekLLM, FengmingSTT, MicrosoftCNSTT, MicrosoftCNTTS, MiniMaxCNTTS, SensetimeAvatar, SpatiusAvatar, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./vendors/cn.js";
|
|
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";
|
|
44
45
|
export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, CustomLLMOptions, DifyOptions, GeminiOptions, GroqOptions, OpenAIOptions, VertexAILLMOptions, } from "./vendors/llm.js";
|
|
45
46
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
|
|
46
47
|
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
47
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";
|
|
48
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, RTZRSTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
49
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, RTZRSTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
50
|
-
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions,
|
|
51
|
-
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.SmallestAITTS = 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; } });
|
|
@@ -126,8 +126,11 @@ Object.defineProperty(exports, "FengmingSTT", { enumerable: true, get: function
|
|
|
126
126
|
Object.defineProperty(exports, "MicrosoftCNSTT", { enumerable: true, get: function () { return cn_js_1.MicrosoftCNSTT; } });
|
|
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
|
+
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; } });
|
|
129
131
|
Object.defineProperty(exports, "SensetimeAvatar", { enumerable: true, get: function () { return cn_js_1.SensetimeAvatar; } });
|
|
130
132
|
Object.defineProperty(exports, "SpatiusAvatar", { enumerable: true, get: function () { return cn_js_1.SpatiusAvatar; } });
|
|
133
|
+
Object.defineProperty(exports, "StepFunSTT", { enumerable: true, get: function () { return cn_js_1.StepFunSTT; } });
|
|
131
134
|
Object.defineProperty(exports, "StepFunTTS", { enumerable: true, get: function () { return cn_js_1.StepFunTTS; } });
|
|
132
135
|
Object.defineProperty(exports, "TencentLLM", { enumerable: true, get: function () { return cn_js_1.TencentLLM; } });
|
|
133
136
|
Object.defineProperty(exports, "TencentSTT", { enumerable: true, get: function () { return cn_js_1.TencentSTT; } });
|
|
@@ -166,6 +169,8 @@ Object.defineProperty(exports, "AmazonSTT", { enumerable: true, get: function ()
|
|
|
166
169
|
Object.defineProperty(exports, "AresSTT", { enumerable: true, get: function () { return stt_js_1.AresSTT; } });
|
|
167
170
|
Object.defineProperty(exports, "AssemblyAISTT", { enumerable: true, get: function () { return stt_js_1.AssemblyAISTT; } });
|
|
168
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; } });
|
|
169
174
|
Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
|
|
170
175
|
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
|
|
171
176
|
Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
|
|
@@ -189,7 +194,6 @@ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: funct
|
|
|
189
194
|
Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
|
|
190
195
|
Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
|
|
191
196
|
Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return tts_js_1.GradiumTTS; } });
|
|
192
|
-
Object.defineProperty(exports, "HumeAITTS", { enumerable: true, get: function () { return tts_js_1.HumeAITTS; } });
|
|
193
197
|
Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return tts_js_1.MicrosoftTTS; } });
|
|
194
198
|
Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return tts_js_1.MiniMaxTTS; } });
|
|
195
199
|
Object.defineProperty(exports, "MistralTTS", { enumerable: true, get: function () { return tts_js_1.MistralTTS; } });
|
|
@@ -199,5 +203,6 @@ Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () {
|
|
|
199
203
|
Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
|
|
200
204
|
Object.defineProperty(exports, "SarvamTTSLanguage", { enumerable: true, get: function () { return tts_js_1.SarvamTTSLanguage; } });
|
|
201
205
|
Object.defineProperty(exports, "SmallestAITTS", { enumerable: true, get: function () { return tts_js_1.SmallestAITTS; } });
|
|
206
|
+
Object.defineProperty(exports, "SonioxTTS", { enumerable: true, get: function () { return tts_js_1.SonioxTTS; } });
|
|
202
207
|
Object.defineProperty(exports, "TypecastTTS", { enumerable: true, get: function () { return tts_js_1.TypecastTTS; } });
|
|
203
208
|
Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
|
|
@@ -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,5 +1,18 @@
|
|
|
1
|
+
import type { MinimaxDuplexTtsParams } from "../../api/index.js";
|
|
1
2
|
import type { AvatarConfig, LlmConfig, SttConfig, TtsConfig } from "../types.js";
|
|
2
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
|
+
}
|
|
3
16
|
export interface FengmingSTTOptions {
|
|
4
17
|
/** Hotwords that improve recognition accuracy */
|
|
5
18
|
keywords?: string[];
|
|
@@ -11,6 +24,16 @@ export declare class FengmingSTT extends BaseCNSTT {
|
|
|
11
24
|
constructor(options?: FengmingSTTOptions);
|
|
12
25
|
toConfig(): SttConfig;
|
|
13
26
|
}
|
|
27
|
+
export interface StepFunSTTOptions {
|
|
28
|
+
apiKey: string;
|
|
29
|
+
additionalParams?: Record<string, unknown>;
|
|
30
|
+
}
|
|
31
|
+
/** StepFun ASR for mainland China. */
|
|
32
|
+
export declare class StepFunSTT extends BaseCNSTT {
|
|
33
|
+
private readonly options;
|
|
34
|
+
constructor(options: StepFunSTTOptions);
|
|
35
|
+
toConfig(): SttConfig;
|
|
36
|
+
}
|
|
14
37
|
export interface MicrosoftCNSTTOptions {
|
|
15
38
|
key: string;
|
|
16
39
|
region: string;
|
|
@@ -74,6 +97,29 @@ export declare class XfyunDialectSTT extends BaseCNSTT {
|
|
|
74
97
|
constructor(options: XfyunDialectSTTOptions);
|
|
75
98
|
toConfig(): SttConfig;
|
|
76
99
|
}
|
|
100
|
+
export interface MiniMaxDuplexTTSOptions {
|
|
101
|
+
key: string;
|
|
102
|
+
model: string;
|
|
103
|
+
url?: string;
|
|
104
|
+
voiceSetting: MinimaxDuplexTtsParams.VoiceSetting;
|
|
105
|
+
audioSetting?: MinimaxDuplexTtsParams.AudioSetting;
|
|
106
|
+
pronunciationDict?: MinimaxDuplexTtsParams.PronunciationDict;
|
|
107
|
+
voiceModify?: MinimaxDuplexTtsParams.VoiceModify;
|
|
108
|
+
languageBoost?: string;
|
|
109
|
+
textNormalizationMode?: string;
|
|
110
|
+
subtitleEnable?: boolean;
|
|
111
|
+
subtitleType?: string;
|
|
112
|
+
continuousSound?: boolean;
|
|
113
|
+
sessionId?: string;
|
|
114
|
+
skipPatterns?: number[];
|
|
115
|
+
additionalParams?: Record<string, unknown>;
|
|
116
|
+
}
|
|
117
|
+
/** MiniMax duplex streaming TTS. Currently available only in mainland China. */
|
|
118
|
+
export declare class MiniMaxDuplexTTS extends BaseCNTTS {
|
|
119
|
+
private readonly options;
|
|
120
|
+
constructor(options: MiniMaxDuplexTTSOptions);
|
|
121
|
+
toConfig(): TtsConfig;
|
|
122
|
+
}
|
|
77
123
|
export interface MiniMaxCNVoiceSetting {
|
|
78
124
|
voice_id: string;
|
|
79
125
|
speed?: number;
|
|
@@ -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.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = 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;
|
|
@@ -23,6 +38,21 @@ class FengmingSTT extends base_js_1.BaseCNSTT {
|
|
|
23
38
|
}
|
|
24
39
|
}
|
|
25
40
|
exports.FengmingSTT = FengmingSTT;
|
|
41
|
+
/** StepFun ASR for mainland China. */
|
|
42
|
+
class StepFunSTT extends base_js_1.BaseCNSTT {
|
|
43
|
+
constructor(options) {
|
|
44
|
+
super();
|
|
45
|
+
this.options = options;
|
|
46
|
+
requireString(options.apiKey, "apiKey", "StepFunSTT");
|
|
47
|
+
}
|
|
48
|
+
toConfig() {
|
|
49
|
+
return {
|
|
50
|
+
vendor: "stepfun",
|
|
51
|
+
params: Object.assign(Object.assign({}, this.options.additionalParams), { api_key: this.options.apiKey }),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.StepFunSTT = StepFunSTT;
|
|
26
56
|
class MicrosoftCNSTT extends base_js_1.BaseCNSTT {
|
|
27
57
|
constructor(options) {
|
|
28
58
|
super();
|
|
@@ -116,6 +146,23 @@ class XfyunDialectSTT extends base_js_1.BaseCNSTT {
|
|
|
116
146
|
}
|
|
117
147
|
}
|
|
118
148
|
exports.XfyunDialectSTT = XfyunDialectSTT;
|
|
149
|
+
/** MiniMax duplex streaming TTS. Currently available only in mainland China. */
|
|
150
|
+
class MiniMaxDuplexTTS extends base_js_1.BaseCNTTS {
|
|
151
|
+
constructor(options) {
|
|
152
|
+
var _a;
|
|
153
|
+
super();
|
|
154
|
+
this.options = options;
|
|
155
|
+
requireString(options.key, "key", "MiniMaxDuplexTTS");
|
|
156
|
+
requireString(options.model, "model", "MiniMaxDuplexTTS");
|
|
157
|
+
requireString((_a = options.voiceSetting) === null || _a === void 0 ? void 0 : _a.voice_id, "voiceSetting.voice_id", "MiniMaxDuplexTTS");
|
|
158
|
+
}
|
|
159
|
+
toConfig() {
|
|
160
|
+
const { key, model, url, voiceSetting, audioSetting, pronunciationDict, voiceModify, languageBoost, textNormalizationMode, subtitleEnable, subtitleType, continuousSound, sessionId, skipPatterns, additionalParams, } = this.options;
|
|
161
|
+
return Object.assign({ vendor: "minimax_duplex", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { key,
|
|
162
|
+
model, voice_setting: voiceSetting }), (url !== undefined && { url })), (audioSetting !== undefined && { audio_setting: audioSetting })), (pronunciationDict !== undefined && { pronunciation_dict: pronunciationDict })), (voiceModify !== undefined && { voice_modify: voiceModify })), (languageBoost !== undefined && { language_boost: languageBoost })), (textNormalizationMode !== undefined && { text_normalization_mode: textNormalizationMode })), (subtitleEnable !== undefined && { subtitle_enable: subtitleEnable })), (subtitleType !== undefined && { subtitle_type: subtitleType })), (continuousSound !== undefined && { continuous_sound: continuousSound })), (sessionId !== undefined && { session_id: sessionId })) }, (skipPatterns !== undefined && { skip_patterns: skipPatterns }));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
exports.MiniMaxDuplexTTS = MiniMaxDuplexTTS;
|
|
119
166
|
class MiniMaxCNTTS extends base_js_1.BaseCNTTS {
|
|
120
167
|
constructor(options) {
|
|
121
168
|
super();
|
|
@@ -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
|
}
|
|
@@ -8,6 +8,28 @@ import { type MiniMaxPresetModel, type OpenAITtsPresetModel } from "../presets.j
|
|
|
8
8
|
import type { TtsConfig } from "../types.js";
|
|
9
9
|
import type { CartesiaSampleRate, ElevenLabsSampleRate, GoogleTTSSampleRate, MicrosoftSampleRate } from "./base.js";
|
|
10
10
|
import { BaseTTS } from "./base.js";
|
|
11
|
+
export interface SonioxTTSOptions {
|
|
12
|
+
apiKey: string;
|
|
13
|
+
baseUrl?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
language?: string;
|
|
16
|
+
voice?: string;
|
|
17
|
+
sampleRate?: number;
|
|
18
|
+
/** Speech rate multiplier, from 0.7 to 1.3 inclusive. */
|
|
19
|
+
speed?: number;
|
|
20
|
+
reduceSilence?: boolean;
|
|
21
|
+
returnTimestamps?: boolean;
|
|
22
|
+
clientReferenceId?: string;
|
|
23
|
+
dump?: boolean;
|
|
24
|
+
skipPatterns?: number[];
|
|
25
|
+
additionalParams?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/** Soniox streaming TTS. Only apiKey is required. */
|
|
28
|
+
export declare class SonioxTTS extends BaseTTS {
|
|
29
|
+
private readonly options;
|
|
30
|
+
constructor(options: SonioxTTSOptions);
|
|
31
|
+
toConfig(): TtsConfig;
|
|
32
|
+
}
|
|
11
33
|
/** Gemini 3.8 Flash TTS model. */
|
|
12
34
|
export declare const GeminiTTSModels: {
|
|
13
35
|
readonly Flash38: "gemini-3.8-flash-tts";
|
|
@@ -377,44 +399,6 @@ export declare class TypecastTTS extends BaseTTS {
|
|
|
377
399
|
constructor(options: TypecastTTSOptions);
|
|
378
400
|
toConfig(): TtsConfig;
|
|
379
401
|
}
|
|
380
|
-
/**
|
|
381
|
-
* Constructor options for Hume AI TTS.
|
|
382
|
-
*/
|
|
383
|
-
export interface HumeAITTSOptions {
|
|
384
|
-
/** Hume AI API key */
|
|
385
|
-
key: string;
|
|
386
|
-
/** Configuration ID */
|
|
387
|
-
configId?: string;
|
|
388
|
-
/** Hume AI voice ID */
|
|
389
|
-
voiceId: string;
|
|
390
|
-
/** Base URL for the Hume AI API */
|
|
391
|
-
baseUrl?: string;
|
|
392
|
-
/** Voice provider type */
|
|
393
|
-
provider: "HUME_AI" | "CUSTOM_VOICE";
|
|
394
|
-
/** Playback speed of the generated speech */
|
|
395
|
-
speed?: number;
|
|
396
|
-
/** Duration of silence in seconds to add at the end of each utterance */
|
|
397
|
-
trailingSilence?: number;
|
|
398
|
-
/** Skip patterns for bracketed content */
|
|
399
|
-
skipPatterns?: number[];
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Hume AI TTS vendor.
|
|
403
|
-
*
|
|
404
|
-
* @example
|
|
405
|
-
* ```typescript
|
|
406
|
-
* const tts = new HumeAITTS({
|
|
407
|
-
* key: process.env.HUME_API_KEY,
|
|
408
|
-
* voiceId: 'voice-id',
|
|
409
|
-
* provider: 'CUSTOM_VOICE',
|
|
410
|
-
* });
|
|
411
|
-
* ```
|
|
412
|
-
*/
|
|
413
|
-
export declare class HumeAITTS extends BaseTTS {
|
|
414
|
-
private readonly options;
|
|
415
|
-
constructor(options: HumeAITTSOptions);
|
|
416
|
-
toConfig(): TtsConfig;
|
|
417
|
-
}
|
|
418
402
|
/**
|
|
419
403
|
* Constructor options for Rime TTS.
|
|
420
404
|
*
|