agora-agents 2.4.0 → 2.5.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.
Files changed (69) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +4 -0
  3. package/dist/cjs/agentkit/constants.d.ts +6 -0
  4. package/dist/cjs/agentkit/constants.js +6 -1
  5. package/dist/cjs/agentkit/index.d.ts +4 -4
  6. package/dist/cjs/agentkit/index.js +6 -3
  7. package/dist/cjs/agentkit/region-vendors.d.ts +2 -1
  8. package/dist/cjs/agentkit/types.d.ts +5 -1
  9. package/dist/cjs/agentkit/vendors/mllm.d.ts +1 -1
  10. package/dist/cjs/agentkit/vendors/mllm.js +1 -1
  11. package/dist/cjs/agentkit/vendors/tts.d.ts +81 -9
  12. package/dist/cjs/agentkit/vendors/tts.js +70 -12
  13. package/dist/cjs/api/types/{GenericTts.d.ts → GenericHttpTts.d.ts} +3 -3
  14. package/dist/cjs/api/types/{GenericTtsParams.d.ts → GenericHttpTtsParams.d.ts} +3 -3
  15. package/dist/cjs/api/types/GradiumTts.d.ts +9 -0
  16. package/dist/cjs/api/types/GradiumTts.js +3 -0
  17. package/dist/cjs/api/types/GradiumTtsParams.d.ts +17 -0
  18. package/dist/cjs/api/types/GradiumTtsParams.js +3 -0
  19. package/dist/cjs/api/types/MistralTts.d.ts +9 -0
  20. package/dist/cjs/api/types/MistralTts.js +3 -0
  21. package/dist/cjs/api/types/MistralTtsParams.d.ts +13 -0
  22. package/dist/cjs/api/types/MistralTtsParams.js +3 -0
  23. package/dist/cjs/api/types/RimeTts.d.ts +10 -0
  24. package/dist/cjs/api/types/RimeTts.js +9 -0
  25. package/dist/cjs/api/types/RimeTtsParams.d.ts +2 -2
  26. package/dist/cjs/api/types/Tts.d.ts +9 -3
  27. package/dist/cjs/api/types/index.d.ts +6 -2
  28. package/dist/cjs/api/types/index.js +6 -2
  29. package/dist/cjs/index.d.ts +2 -2
  30. package/dist/cjs/index.js +6 -3
  31. package/dist/cjs/version.d.ts +1 -1
  32. package/dist/cjs/version.js +1 -1
  33. package/dist/esm/BaseClient.mjs +2 -2
  34. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +5 -1
  35. package/dist/esm/agentkit/constants.d.mts +6 -0
  36. package/dist/esm/agentkit/constants.mjs +5 -0
  37. package/dist/esm/agentkit/index.d.mts +4 -4
  38. package/dist/esm/agentkit/index.mjs +2 -2
  39. package/dist/esm/agentkit/region-vendors.d.mts +2 -1
  40. package/dist/esm/agentkit/types.d.mts +5 -1
  41. package/dist/esm/agentkit/vendors/mllm.d.mts +1 -1
  42. package/dist/esm/agentkit/vendors/mllm.mjs +1 -1
  43. package/dist/esm/agentkit/vendors/tts.d.mts +81 -9
  44. package/dist/esm/agentkit/vendors/tts.mjs +67 -11
  45. package/dist/esm/api/types/{GenericTts.d.mts → GenericHttpTts.d.mts} +3 -3
  46. package/dist/esm/api/types/{GenericTtsParams.d.mts → GenericHttpTtsParams.d.mts} +3 -3
  47. package/dist/esm/api/types/GradiumTts.d.mts +9 -0
  48. package/dist/esm/api/types/GradiumTts.mjs +2 -0
  49. package/dist/esm/api/types/GradiumTtsParams.d.mts +17 -0
  50. package/dist/esm/api/types/GradiumTtsParams.mjs +2 -0
  51. package/dist/esm/api/types/MistralTts.d.mts +9 -0
  52. package/dist/esm/api/types/MistralTts.mjs +2 -0
  53. package/dist/esm/api/types/MistralTtsParams.d.mts +13 -0
  54. package/dist/esm/api/types/MistralTtsParams.mjs +2 -0
  55. package/dist/esm/api/types/RimeTts.d.mts +10 -0
  56. package/dist/esm/api/types/RimeTts.mjs +8 -1
  57. package/dist/esm/api/types/RimeTtsParams.d.mts +2 -2
  58. package/dist/esm/api/types/Tts.d.mts +9 -3
  59. package/dist/esm/api/types/index.d.mts +6 -2
  60. package/dist/esm/api/types/index.mjs +6 -2
  61. package/dist/esm/index.d.mts +2 -2
  62. package/dist/esm/index.mjs +3 -3
  63. package/dist/esm/version.d.mts +1 -1
  64. package/dist/esm/version.mjs +1 -1
  65. package/package.json +1 -1
  66. /package/dist/cjs/api/types/{GenericTts.js → GenericHttpTts.js} +0 -0
  67. /package/dist/cjs/api/types/{GenericTtsParams.js → GenericHttpTtsParams.js} +0 -0
  68. /package/dist/esm/api/types/{GenericTts.mjs → GenericHttpTts.mjs} +0 -0
  69. /package/dist/esm/api/types/{GenericTtsParams.mjs → GenericHttpTtsParams.mjs} +0 -0
@@ -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.3.2",
45
- "User-Agent": "agora-agents/v2.3.2",
44
+ "X-Fern-SDK-Version": "v2.5.0",
45
+ "User-Agent": "agora-agents/v2.5.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);
@@ -26,6 +26,8 @@ new Agent_js_1.Agent({ client, turnDetection: { language: "en-US" } })
26
26
  new Agent_js_1.Agent({ client }).withStt(new cn_js_1.FengmingSTT());
27
27
  new Agent_js_1.Agent({ client }).withLlm(new cn_js_1.AliyunLLM({ url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", model: "qwen-plus" }));
28
28
  new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
29
+ const globalGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.com/v1/audio/speech" });
30
+ new Agent_js_1.Agent({ client }).withTts(globalGenericTts);
29
31
  {
30
32
  const client = new AgoraPoolClient_js_1.AgoraClient({
31
33
  area: index_js_1.Area.CN,
@@ -53,5 +55,7 @@ new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minima
53
55
  new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
54
56
  new Agent_js_1.Agent({ client }).withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }));
55
57
  new Agent_js_1.Agent({ client }).withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
58
+ const cnGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.cn/v1/audio/speech" });
59
+ new Agent_js_1.Agent({ client }).withTts(cnGenericTts);
56
60
  }
57
61
  new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
@@ -6,6 +6,12 @@ import { AgentThinkAgentManagementRequest as AgentThinkRequestNS } from "../api/
6
6
  import { SpeakAgentsRequest as SpeakAgentsRequestNS } from "../api/resources/agents/client/requests/SpeakAgentsRequest.js";
7
7
  import { StartAgentsRequest as StartAgentsRequestNS } from "../api/resources/agents/client/requests/StartAgentsRequest.js";
8
8
  import { MllmTurnDetection as MllmTurnDetectionNS } from "../api/types/MllmTurnDetection.js";
9
+ /** Credential source for vendors that support Agora-managed credentials and BYOK. */
10
+ export declare const CredentialMode: {
11
+ readonly Managed: "managed";
12
+ readonly Byok: "byok";
13
+ };
14
+ export type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
9
15
  /** Data channel: `"rtm"` | `"datastream"` */
10
16
  export declare const DataChannel: typeof StartAgentsRequestNS.Properties.Parameters.DataChannel;
11
17
  /** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
@@ -4,12 +4,17 @@
4
4
  * Use these instead of raw strings to avoid typos and get IDE autocomplete.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnListeningActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeAgoraVad = exports.MllmTurnDetectionModeValues = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpeakPriorityInterrupt = exports.SpeakPriorityValues = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.InterruptionModeKeywords = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeValues = exports.TurnDetectionTypeValues = exports.FillerWordsSelectionRule = exports.Geofence = exports.SalModeValues = exports.SilenceActionValues = exports.AudioScenario = exports.DataChannel = void 0;
7
+ exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnListeningActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeAgoraVad = exports.MllmTurnDetectionModeValues = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SpeakPriorityInterrupt = exports.SpeakPriorityValues = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.InterruptionModeKeywords = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeValues = exports.TurnDetectionTypeValues = exports.FillerWordsSelectionRule = exports.Geofence = exports.SalModeValues = exports.SilenceActionValues = exports.AudioScenario = exports.DataChannel = exports.CredentialMode = void 0;
8
8
  // Import namespace as value from source (api index uses export type)
9
9
  const AgentThinkAgentManagementRequest_js_1 = require("../api/resources/agentManagement/client/requests/AgentThinkAgentManagementRequest.js");
10
10
  const SpeakAgentsRequest_js_1 = require("../api/resources/agents/client/requests/SpeakAgentsRequest.js");
11
11
  const StartAgentsRequest_js_1 = require("../api/resources/agents/client/requests/StartAgentsRequest.js");
12
12
  const MllmTurnDetection_js_1 = require("../api/types/MllmTurnDetection.js");
13
+ /** Credential source for vendors that support Agora-managed credentials and BYOK. */
14
+ exports.CredentialMode = {
15
+ Managed: "managed",
16
+ Byok: "byok",
17
+ };
13
18
  /** Data channel: `"rtm"` | `"datastream"` */
14
19
  exports.DataChannel = StartAgentsRequest_js_1.StartAgentsRequest.Properties.Parameters.DataChannel;
15
20
  /** RTC audio scenario: `"default"` | `"chorus"` | `"aiserver"` */
@@ -25,13 +25,13 @@ export type { AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions,
25
25
  export { AgentSession } from "./AgentSession.js";
26
26
  export type { AkoolAvatarConfig, AnamAvatarConfig, GenericAvatarConfig, HeyGenAvatarConfig, LiveAvatarAvatarConfig, SensetimeAvatarConfig, SpatiusAvatarConfig, StrictAvatarConfig, } from "./avatar-types.js";
27
27
  export { isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, toBaseAvatarConfig, validateAvatarConfig, validateTtsSampleRate, } from "./avatar-types.js";
28
- export { AudioScenario, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.js";
28
+ export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, Geofence, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, SalModeValues, SilenceActionValues, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, } from "./constants.js";
29
29
  export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPresetModel, OpenAIPresetModel, OpenAITtsPresetModel, PresetCategory, PresetInput, TtsPreset, } from "./presets.js";
30
30
  export { AgentPresets, normalizePresetInput } from "./presets.js";
31
31
  export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
32
32
  export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
33
33
  export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
34
- 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, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
34
+ 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, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
35
35
  export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
36
36
  export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
37
37
  export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
@@ -44,5 +44,5 @@ export type { GeminiLiveOptions, OpenAIRealtimeOptions, VertexAIOptions, XaiGrok
44
44
  export { GeminiLive, OpenAIRealtime, VertexAI, XaiGrok, } from "./vendors/mllm.js";
45
45
  export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
46
46
  export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
47
- export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
48
- export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.js";
47
+ export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
48
+ export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, XAiTTS, } from "./vendors/tts.js";
@@ -20,9 +20,9 @@
20
20
  * parts that need manual updates when adding new sugar.
21
21
  */
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.normalizePresetInput = exports.AgentPresets = 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.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.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.OpenAIRealtime = exports.GeminiLive = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = void 0;
25
- exports.XAiTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = void 0;
23
+ exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.normalizePresetInput = exports.AgentPresets = 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.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.OpenAIRealtime = exports.GeminiLive = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = void 0;
25
+ exports.XAiTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = void 0;
26
26
  // Core classes
27
27
  var Agent_js_1 = require("./Agent.js");
28
28
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
@@ -43,6 +43,7 @@ Object.defineProperty(exports, "validateTtsSampleRate", { enumerable: true, get:
43
43
  // Type-safe constants
44
44
  var constants_js_1 = require("./constants.js");
45
45
  Object.defineProperty(exports, "AudioScenario", { enumerable: true, get: function () { return constants_js_1.AudioScenario; } });
46
+ Object.defineProperty(exports, "CredentialMode", { enumerable: true, get: function () { return constants_js_1.CredentialMode; } });
46
47
  Object.defineProperty(exports, "DataChannel", { enumerable: true, get: function () { return constants_js_1.DataChannel; } });
47
48
  Object.defineProperty(exports, "FillerWordsSelectionRule", { enumerable: true, get: function () { return constants_js_1.FillerWordsSelectionRule; } });
48
49
  Object.defineProperty(exports, "Geofence", { enumerable: true, get: function () { return constants_js_1.Geofence; } });
@@ -155,9 +156,11 @@ Object.defineProperty(exports, "ElevenLabsTTS", { enumerable: true, get: functio
155
156
  Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function () { return tts_js_1.FishAudioTTS; } });
156
157
  Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
157
158
  Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
159
+ Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return tts_js_1.GradiumTTS; } });
158
160
  Object.defineProperty(exports, "HumeAITTS", { enumerable: true, get: function () { return tts_js_1.HumeAITTS; } });
159
161
  Object.defineProperty(exports, "MicrosoftTTS", { enumerable: true, get: function () { return tts_js_1.MicrosoftTTS; } });
160
162
  Object.defineProperty(exports, "MiniMaxTTS", { enumerable: true, get: function () { return tts_js_1.MiniMaxTTS; } });
163
+ Object.defineProperty(exports, "MistralTTS", { enumerable: true, get: function () { return tts_js_1.MistralTTS; } });
161
164
  Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () { return tts_js_1.MurfTTS; } });
162
165
  Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
163
166
  Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
@@ -1,12 +1,13 @@
1
1
  import type { BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseSTT, BaseTTS } from "./vendors/base.js";
2
2
  import type { MicrosoftCNSampleRate, MicrosoftCNSTT, MicrosoftCNTTS } from "./vendors/cn.js";
3
3
  import type { CustomLLM } from "./vendors/llm.js";
4
+ import type { GenericTTS } from "./vendors/tts.js";
4
5
  export type GlobalLlmVendor = BaseLLM;
5
6
  export type GlobalTtsVendor<SR extends number = number> = BaseTTS<SR>;
6
7
  export type GlobalSttVendor = BaseSTT;
7
8
  export type GlobalAvatarVendor<SR extends number = number> = BaseAvatar<SR>;
8
9
  export type CNLlmVendor = BaseCNLLM | CustomLLM;
9
- export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
10
+ export type CNTtsVendor<SR extends number = number> = BaseCNTTS<SR> | GenericTTS | (SR extends MicrosoftCNSampleRate ? MicrosoftCNTTS<SR> : never);
10
11
  export type CNSttVendor = BaseCNSTT | MicrosoftCNSTT;
11
12
  export type CNAvatarVendor<SR extends number = number> = BaseCNAvatar<SR>;
12
13
  export type LlmVendor = GlobalLlmVendor | CNLlmVendor;
@@ -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, GenericTtsParams as GenericTtsParamsType, GenericTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } from "../api/index.js";
5
+ import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, 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) */
@@ -558,10 +558,14 @@ export type GenericTts = GenericTtsType;
558
558
  export type GenericTtsParams = GenericTtsParamsType;
559
559
  export type GoogleTts = GoogleTtsType;
560
560
  export type GoogleTtsParams = GoogleTtsParamsType;
561
+ export type GradiumTts = GradiumTtsType;
562
+ export type GradiumTtsParams = GradiumTtsParamsType;
561
563
  export type AmazonTts = AmazonTtsType;
562
564
  export type AmazonTtsParams = AmazonTtsParamsType;
563
565
  export type MinimaxTts = MinimaxTtsType;
564
566
  export type MinimaxTtsParams = MinimaxTtsParamsType;
567
+ export type MistralTts = MistralTtsType;
568
+ export type MistralTtsParams = MistralTtsParamsType;
565
569
  export type MurfTts = MurfTtsType;
566
570
  export type MurfTtsParams = MurfTtsParamsType;
567
571
  export type SarvamTts = SarvamTtsType;
@@ -21,7 +21,7 @@ export interface OpenAIRealtimeOptions {
21
21
  instructions?: string;
22
22
  /** Audio transcription settings */
23
23
  inputAudioTranscription?: Record<string, unknown>;
24
- /** WebSocket URL for real-time communication */
24
+ /** WebSocket URL. Defaults to `wss://api.openai.com/v1/realtime` when omitted or empty. */
25
25
  url?: string;
26
26
  /** Agent greeting message */
27
27
  greetingMessage?: string;
@@ -39,7 +39,7 @@ class OpenAIRealtime extends base_js_1.BaseMLLM {
39
39
  voice !== undefined ||
40
40
  instructions !== undefined ||
41
41
  inputAudioTranscription !== undefined;
42
- return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "openai", api_key: apiKey }, (url && { url })), (hasParams && { params: mergedParams })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
42
+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ vendor: "openai", api_key: apiKey, url: url || "wss://api.openai.com/v1/realtime" }, (hasParams && { params: mergedParams })), (greetingMessage && { greeting_message: greetingMessage })), (inputModalities && { input_modalities: inputModalities })), (outputModalities && { output_modalities: outputModalities })), (messages && { messages })), (this.options.failureMessage && { failure_message: this.options.failureMessage })), (turnDetection && { turn_detection: turnDetection }));
43
43
  }
44
44
  }
45
45
  exports.OpenAIRealtime = OpenAIRealtime;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Type-safe TTS (Text-to-Speech) vendor classes.
3
3
  */
4
+ import { CredentialMode } from "../constants.js";
4
5
  import { type MiniMaxPresetModel, type OpenAITtsPresetModel } from "../presets.js";
5
6
  import type { TtsConfig } from "../types.js";
6
7
  import type { CartesiaSampleRate, ElevenLabsSampleRate, GoogleTTSSampleRate, MicrosoftSampleRate } from "./base.js";
@@ -279,6 +280,48 @@ export declare class DeepgramTTS extends BaseTTS {
279
280
  constructor(options: DeepgramTTSOptions);
280
281
  toConfig(): TtsConfig;
281
282
  }
283
+ /** Constructor options for Gradium TTS. */
284
+ export interface GradiumTTSOptions {
285
+ /** Gradium API key */
286
+ apiKey: string;
287
+ /** WebSocket endpoint for streaming TTS output */
288
+ url?: string;
289
+ /** Gradium TTS model name (e.g., 'default') */
290
+ modelName?: string;
291
+ /** Gradium voice identifier */
292
+ voiceId?: string;
293
+ /** Audio sample rate in Hz */
294
+ sampleRate?: number;
295
+ /** Additional vendor-specific parameters */
296
+ additionalParams?: Record<string, unknown>;
297
+ /** Skip patterns for bracketed content */
298
+ skipPatterns?: number[];
299
+ }
300
+ /** Gradium TTS vendor. */
301
+ export declare class GradiumTTS extends BaseTTS {
302
+ private readonly options;
303
+ constructor(options: GradiumTTSOptions);
304
+ toConfig(): TtsConfig;
305
+ }
306
+ /** Constructor options for Mistral TTS. */
307
+ export interface MistralTTSOptions {
308
+ /** Mistral API key */
309
+ apiKey: string;
310
+ /** Mistral TTS model name (e.g., 'voxtral-mini-tts-2603') */
311
+ model?: string;
312
+ /** Mistral voice identifier */
313
+ voice?: string;
314
+ /** Additional vendor-specific parameters */
315
+ additionalParams?: Record<string, unknown>;
316
+ /** Skip patterns for bracketed content */
317
+ skipPatterns?: number[];
318
+ }
319
+ /** Mistral TTS vendor. */
320
+ export declare class MistralTTS extends BaseTTS {
321
+ private readonly options;
322
+ constructor(options: MistralTTSOptions);
323
+ toConfig(): TtsConfig;
324
+ }
282
325
  /**
283
326
  * Constructor options for Hume AI TTS.
284
327
  */
@@ -319,8 +362,28 @@ export declare class HumeAITTS extends BaseTTS {
319
362
  }
320
363
  /**
321
364
  * Constructor options for Rime TTS.
365
+ *
366
+ * - `credentialMode: CredentialMode.Managed` requires `baseUrl` and `modelId`
367
+ * - omitted / `CredentialMode.Byok` requires `key`, `speaker`, and `modelId`
322
368
  */
323
- export interface RimeTTSOptions {
369
+ type RimeTTSCommonOptions = {
370
+ /** Skip patterns for bracketed content */
371
+ skipPatterns?: number[];
372
+ };
373
+ export type RimeTTSOptions = (RimeTTSCommonOptions & {
374
+ /** Use Agora-managed Rime credentials */
375
+ credentialMode: typeof CredentialMode.Managed;
376
+ /** Model ID */
377
+ modelId: string;
378
+ /** WebSocket URL for the Rime streaming API */
379
+ baseUrl: string;
380
+ /** Rime API key (optional for managed credentials) */
381
+ key?: string;
382
+ /** Speaker ID (optional for managed credentials) */
383
+ speaker?: string;
384
+ }) | (RimeTTSCommonOptions & {
385
+ /** Bring-your-own Rime credentials (default when omitted) */
386
+ credentialMode?: typeof CredentialMode.Byok;
324
387
  /** Rime API key */
325
388
  key: string;
326
389
  /** Speaker ID */
@@ -329,15 +392,24 @@ export interface RimeTTSOptions {
329
392
  modelId: string;
330
393
  /** WebSocket URL for the Rime streaming API */
331
394
  baseUrl?: string;
332
- /** Skip patterns for bracketed content */
333
- skipPatterns?: number[];
334
- }
395
+ });
335
396
  /**
336
397
  * Rime TTS vendor.
337
398
  *
338
399
  * @example
400
+ * Agora-managed credentials:
339
401
  * ```typescript
340
- * const tts = new RimeTTS({
402
+ * const managedTts = new RimeTTS({
403
+ * credentialMode: CredentialMode.Managed,
404
+ * baseUrl: 'wss://users.rime.ai/ws',
405
+ * modelId: 'mist',
406
+ * });
407
+ * ```
408
+ *
409
+ * @example
410
+ * Bring your own credentials (the default mode):
411
+ * ```typescript
412
+ * const byokTts = new RimeTTS({
341
413
  * key: process.env.RIME_API_KEY,
342
414
  * speaker: 'speaker-id',
343
415
  * modelId: 'mist',
@@ -505,16 +577,16 @@ export declare class MurfTTS extends BaseTTS {
505
577
  * Constructor options for Generic OpenAI-compatible TTS.
506
578
  */
507
579
  export interface GenericTTSOptions {
508
- /** Callback address of the generic TTS service */
580
+ /** HTTP(S) endpoint of the generic TTS service */
509
581
  url: string;
510
582
  /** Custom headers to include in requests to the generic TTS service */
511
- headers: Record<string, string>;
583
+ headers?: Record<string, string>;
512
584
  /** API key for the generic TTS service */
513
585
  apiKey?: string;
514
586
  /** TTS model name */
515
- model: string;
587
+ model?: string;
516
588
  /** Voice name */
517
- voice: string;
589
+ voice?: string;
518
590
  /** Speech rate */
519
591
  speed?: number;
520
592
  /** Output audio sample rate in Hz */
@@ -3,7 +3,8 @@
3
3
  * Type-safe TTS (Text-to-Speech) vendor classes.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
6
+ exports.XAiTTS = exports.GenericTTS = exports.MurfTTS = exports.SarvamTTS = exports.MiniMaxTTS = exports.FishAudioTTS = exports.RimeTTS = exports.HumeAITTS = exports.MistralTTS = exports.GradiumTTS = exports.DeepgramTTS = exports.AmazonTTS = exports.GoogleTTS = exports.CartesiaTTS = exports.OpenAITTS = exports.MicrosoftTTS = exports.ElevenLabsTTS = void 0;
7
+ const constants_js_1 = require("../constants.js");
7
8
  const presets_js_1 = require("../presets.js");
8
9
  const base_js_1 = require("./base.js");
9
10
  function requireString(value, field, vendor) {
@@ -196,6 +197,32 @@ class DeepgramTTS extends base_js_1.BaseTTS {
196
197
  }
197
198
  }
198
199
  exports.DeepgramTTS = DeepgramTTS;
200
+ /** Gradium TTS vendor. */
201
+ class GradiumTTS extends base_js_1.BaseTTS {
202
+ constructor(options) {
203
+ super();
204
+ requireString(options.apiKey, "apiKey", "GradiumTTS");
205
+ this.options = options;
206
+ }
207
+ toConfig() {
208
+ const { apiKey, url, modelName, voiceId, sampleRate, additionalParams, skipPatterns } = this.options;
209
+ return Object.assign({ vendor: "gradium", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (url !== undefined && { url })), (modelName !== undefined && { model_name: modelName })), (voiceId !== undefined && { voice_id: voiceId })), (sampleRate !== undefined && { sample_rate: sampleRate })) }, (skipPatterns && { skip_patterns: skipPatterns }));
210
+ }
211
+ }
212
+ exports.GradiumTTS = GradiumTTS;
213
+ /** Mistral TTS vendor. */
214
+ class MistralTTS extends base_js_1.BaseTTS {
215
+ constructor(options) {
216
+ super();
217
+ requireString(options.apiKey, "apiKey", "MistralTTS");
218
+ this.options = options;
219
+ }
220
+ toConfig() {
221
+ const { apiKey, model, voice, additionalParams, skipPatterns } = this.options;
222
+ return Object.assign({ vendor: "mistral", params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (model !== undefined && { model })), (voice !== undefined && { voice })) }, (skipPatterns && { skip_patterns: skipPatterns }));
223
+ }
224
+ }
225
+ exports.MistralTTS = MistralTTS;
199
226
  /**
200
227
  * Hume AI TTS vendor.
201
228
  *
@@ -223,8 +250,19 @@ exports.HumeAITTS = HumeAITTS;
223
250
  * Rime TTS vendor.
224
251
  *
225
252
  * @example
253
+ * Agora-managed credentials:
226
254
  * ```typescript
227
- * const tts = new RimeTTS({
255
+ * const managedTts = new RimeTTS({
256
+ * credentialMode: CredentialMode.Managed,
257
+ * baseUrl: 'wss://users.rime.ai/ws',
258
+ * modelId: 'mist',
259
+ * });
260
+ * ```
261
+ *
262
+ * @example
263
+ * Bring your own credentials (the default mode):
264
+ * ```typescript
265
+ * const byokTts = new RimeTTS({
228
266
  * key: process.env.RIME_API_KEY,
229
267
  * speaker: 'speaker-id',
230
268
  * modelId: 'mist',
@@ -234,12 +272,23 @@ exports.HumeAITTS = HumeAITTS;
234
272
  class RimeTTS extends base_js_1.BaseTTS {
235
273
  constructor(options) {
236
274
  super();
275
+ requireString(options.modelId, "modelId", "RimeTTS");
276
+ if (options.credentialMode === constants_js_1.CredentialMode.Managed) {
277
+ requireString(options.baseUrl, "baseUrl", "RimeTTS");
278
+ }
279
+ else {
280
+ requireString(options.key, "key", "RimeTTS");
281
+ requireString(options.speaker, "speaker", "RimeTTS");
282
+ }
237
283
  this.options = options;
238
284
  }
239
285
  toConfig() {
240
- const { key, speaker, modelId, baseUrl, skipPatterns } = this.options;
241
- return Object.assign({ vendor: "rime", params: Object.assign({ api_key: key, speaker,
242
- modelId }, (baseUrl && { base_url: baseUrl })) }, (skipPatterns && { skip_patterns: skipPatterns }));
286
+ const { key, speaker, modelId, baseUrl, skipPatterns, credentialMode } = this.options;
287
+ if (credentialMode === constants_js_1.CredentialMode.Managed) {
288
+ return Object.assign({ vendor: "rime", credential_mode: constants_js_1.CredentialMode.Managed, params: Object.assign(Object.assign({ modelId, base_url: baseUrl }, (key !== undefined && { api_key: key })), (speaker !== undefined && { speaker })) }, (skipPatterns && { skip_patterns: skipPatterns }));
289
+ }
290
+ return Object.assign(Object.assign(Object.assign({ vendor: "rime" }, (credentialMode !== undefined && { credential_mode: credentialMode })), { params: Object.assign({ api_key: key, speaker,
291
+ modelId }, (baseUrl && { base_url: baseUrl })) }), (skipPatterns && { skip_patterns: skipPatterns }));
243
292
  }
244
293
  }
245
294
  exports.RimeTTS = RimeTTS;
@@ -349,23 +398,32 @@ class MurfTTS extends base_js_1.BaseTTS {
349
398
  }
350
399
  }
351
400
  exports.MurfTTS = MurfTTS;
401
+ function requireGenericTtsHttpUrl(url) {
402
+ requireString(url, "url", "GenericTTS");
403
+ let protocol;
404
+ try {
405
+ protocol = new URL(url).protocol;
406
+ }
407
+ catch (_a) {
408
+ throw new Error("GenericTTS requires url to be a valid absolute URL");
409
+ }
410
+ if (protocol === "http:" || protocol === "https:") {
411
+ return;
412
+ }
413
+ throw new Error(`GenericTTS does not support the ${protocol} protocol`);
414
+ }
352
415
  /**
353
416
  * Generic OpenAI-compatible TTS vendor.
354
417
  */
355
418
  class GenericTTS extends base_js_1.BaseTTS {
356
419
  constructor(options) {
357
420
  super();
358
- requireString(options.url, "url", "GenericTTS");
359
- requireRecord(options.headers, "headers", "GenericTTS");
360
- requireString(options.model, "model", "GenericTTS");
361
- requireString(options.voice, "voice", "GenericTTS");
421
+ requireGenericTtsHttpUrl(options.url);
362
422
  this.options = options;
363
423
  }
364
424
  toConfig() {
365
425
  const { url, headers, apiKey, model, voice, speed, sampleRate, responseFormat, instruction, additionalParams, skipPatterns, } = this.options;
366
- return Object.assign({ vendor: "generic", url,
367
- headers, params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey !== undefined && { api_key: apiKey })), { model,
368
- voice }), (speed !== undefined && { speed })), (sampleRate !== undefined && { sample_rate: sampleRate })), (responseFormat !== undefined && { response_format: responseFormat })), (instruction !== undefined && { instruction })) }, (skipPatterns && { skip_patterns: skipPatterns }));
426
+ return Object.assign(Object.assign(Object.assign({ vendor: "generic_http", url }, (headers && { headers })), { params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey !== undefined && { api_key: apiKey })), (model !== undefined && { model })), (voice !== undefined && { voice })), (speed !== undefined && { speed })), (sampleRate !== undefined && { sample_rate: sampleRate })), (responseFormat !== undefined && { response_format: responseFormat })), (instruction !== undefined && { instruction })) }), (skipPatterns && { skip_patterns: skipPatterns }));
369
427
  }
370
428
  }
371
429
  exports.GenericTTS = GenericTTS;
@@ -2,12 +2,12 @@ import type * as Agora from "../index.js";
2
2
  /**
3
3
  * Generic OpenAI-compatible Text-to-Speech configuration.
4
4
  */
5
- export interface GenericTts {
5
+ export interface GenericHttpTts {
6
6
  /** Callback address of the generic TTS service. */
7
7
  url: string;
8
8
  /** Custom headers to include in requests to the generic TTS service. */
9
- headers: Record<string, string>;
10
- params: Agora.GenericTtsParams;
9
+ headers?: Record<string, string>;
10
+ params: Agora.GenericHttpTtsParams;
11
11
  /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
12
12
  skip_patterns?: number[];
13
13
  }
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Generic TTS configuration parameters.
3
3
  */
4
- export interface GenericTtsParams {
4
+ export interface GenericHttpTtsParams {
5
5
  /** API key for the generic TTS service. */
6
6
  api_key?: string;
7
7
  /** TTS model name. */
8
- model: string;
8
+ model?: string;
9
9
  /** Voice name. */
10
- voice: string;
10
+ voice?: string;
11
11
  /** Speech rate. */
12
12
  speed?: number;
13
13
  /** Output audio sample rate in Hz. */
@@ -0,0 +1,9 @@
1
+ import type * as Agora from "../index.js";
2
+ /**
3
+ * Gradium Text-to-Speech configuration.
4
+ */
5
+ export interface GradiumTts {
6
+ params: Agora.GradiumTtsParams;
7
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
+ skip_patterns?: number[];
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Gradium TTS configuration parameters.
3
+ */
4
+ export interface GradiumTtsParams {
5
+ /** Gradium API key. */
6
+ api_key: string;
7
+ /** WebSocket endpoint for streaming TTS output (for example, "wss://api.gradium.ai/api/speech/tts"). */
8
+ url?: string;
9
+ /** Gradium TTS model name (for example, "default"). */
10
+ model_name?: string;
11
+ /** Gradium voice identifier. */
12
+ voice_id?: string;
13
+ /** Audio sample rate in Hz (for example, 16000). */
14
+ sample_rate?: number;
15
+ /** Accepts any additional properties */
16
+ [key: string]: any;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import type * as Agora from "../index.js";
2
+ /**
3
+ * Mistral Text-to-Speech configuration.
4
+ */
5
+ export interface MistralTts {
6
+ params: Agora.MistralTtsParams;
7
+ /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
+ skip_patterns?: number[];
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Mistral TTS configuration parameters.
3
+ */
4
+ export interface MistralTtsParams {
5
+ /** Mistral API key. */
6
+ api_key: string;
7
+ /** Mistral TTS model name (for example, "voxtral-mini-tts-2603"). */
8
+ model?: string;
9
+ /** Mistral voice identifier. */
10
+ voice?: string;
11
+ /** Accepts any additional properties */
12
+ [key: string]: any;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,7 +3,17 @@ import type * as Agora from "../index.js";
3
3
  * Rime Text-to-Speech configuration (Beta).
4
4
  */
5
5
  export interface RimeTts {
6
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
7
+ credential_mode?: RimeTts.CredentialMode;
6
8
  params: Agora.RimeTtsParams;
7
9
  /** Controls whether the TTS module skips bracketed content when reading LLM response text. */
8
10
  skip_patterns?: number[];
9
11
  }
12
+ export declare namespace RimeTts {
13
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
14
+ const CredentialMode: {
15
+ readonly Managed: "managed";
16
+ readonly Byok: "byok";
17
+ };
18
+ type CredentialMode = (typeof CredentialMode)[keyof typeof CredentialMode];
19
+ }
@@ -1,3 +1,12 @@
1
1
  "use strict";
2
2
  // This file was auto-generated by Fern from our API Definition.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RimeTts = void 0;
5
+ var RimeTts;
6
+ (function (RimeTts) {
7
+ /** Credential mode. When provided, must be "managed" (Agora managed mode) or "byok" (BYOK mode). */
8
+ RimeTts.CredentialMode = {
9
+ Managed: "managed",
10
+ Byok: "byok",
11
+ };
12
+ })(RimeTts || (exports.RimeTts = RimeTts = {}));