agora-agents 2.12.0 → 2.13.1

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 (100) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/agentkit/Agent.js +10 -3
  4. package/dist/cjs/agentkit/AgentSession.js +6 -2
  5. package/dist/cjs/agentkit/avatar-types.d.ts +6 -0
  6. package/dist/cjs/agentkit/index.d.ts +7 -9
  7. package/dist/cjs/agentkit/index.js +8 -5
  8. package/dist/cjs/agentkit/presets.js +3 -3
  9. package/dist/cjs/agentkit/preview/client.d.ts +6 -5
  10. package/dist/cjs/agentkit/preview/client.js +7 -7
  11. package/dist/cjs/agentkit/preview/gemini-tts.d.ts +3 -31
  12. package/dist/cjs/agentkit/preview/gemini-tts.js +4 -30
  13. package/dist/cjs/agentkit/preview/index.d.ts +2 -2
  14. package/dist/cjs/agentkit/preview/index.js +4 -4
  15. package/dist/cjs/agentkit/token.d.ts +43 -7
  16. package/dist/cjs/agentkit/token.js +34 -6
  17. package/dist/cjs/agentkit/types.d.ts +12 -3
  18. package/dist/cjs/agentkit/vendors/avatar.d.ts +30 -12
  19. package/dist/cjs/agentkit/vendors/avatar.js +62 -5
  20. package/dist/cjs/agentkit/vendors/stt.d.ts +35 -0
  21. package/dist/cjs/agentkit/vendors/stt.js +19 -2
  22. package/dist/cjs/agentkit/vendors/tts.d.ts +72 -18
  23. package/dist/cjs/agentkit/vendors/tts.js +60 -11
  24. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +13 -0
  25. package/dist/cjs/api/resources/agents/types/GetTurnsAgentsResponse.d.ts +3 -1
  26. package/dist/cjs/api/types/Asr.d.ts +4 -1
  27. package/dist/cjs/api/types/CartesiaTts.d.ts +10 -0
  28. package/dist/cjs/api/types/CartesiaTts.js +9 -0
  29. package/dist/cjs/api/types/CartesiaTtsParams.d.ts +1 -1
  30. package/dist/cjs/api/types/DeepgramAsrParams.d.ts +1 -1
  31. package/dist/cjs/api/types/FishAudioTts.d.ts +10 -0
  32. package/dist/cjs/api/types/FishAudioTts.js +9 -0
  33. package/dist/cjs/api/types/FishAudioTtsParams.d.ts +1 -1
  34. package/dist/cjs/api/types/GeminiTts.d.ts +9 -0
  35. package/dist/cjs/api/types/GeminiTts.js +3 -0
  36. package/dist/cjs/api/types/GeminiTtsParams.d.ts +15 -0
  37. package/dist/cjs/api/types/GeminiTtsParams.js +3 -0
  38. package/dist/cjs/api/types/RtzrAsr.d.ts +10 -0
  39. package/dist/cjs/api/types/RtzrAsr.js +3 -0
  40. package/dist/cjs/api/types/RtzrAsrParams.d.ts +31 -0
  41. package/dist/cjs/api/types/RtzrAsrParams.js +3 -0
  42. package/dist/cjs/api/types/SarvamTtsParams.d.ts +12 -8
  43. package/dist/cjs/api/types/SarvamTtsParams.js +1 -1
  44. package/dist/cjs/api/types/Tts.d.ts +4 -1
  45. package/dist/cjs/api/types/index.d.ts +4 -0
  46. package/dist/cjs/api/types/index.js +4 -0
  47. package/dist/cjs/index.d.ts +4 -4
  48. package/dist/cjs/index.js +9 -6
  49. package/dist/cjs/version.d.ts +1 -1
  50. package/dist/cjs/version.js +1 -1
  51. package/dist/esm/BaseClient.mjs +2 -2
  52. package/dist/esm/agentkit/Agent.mjs +10 -3
  53. package/dist/esm/agentkit/AgentSession.mjs +6 -2
  54. package/dist/esm/agentkit/avatar-types.d.mts +6 -0
  55. package/dist/esm/agentkit/index.d.mts +7 -9
  56. package/dist/esm/agentkit/index.mjs +3 -4
  57. package/dist/esm/agentkit/presets.mjs +3 -3
  58. package/dist/esm/agentkit/preview/client.d.mts +6 -5
  59. package/dist/esm/agentkit/preview/client.mjs +7 -7
  60. package/dist/esm/agentkit/preview/gemini-tts.d.mts +3 -31
  61. package/dist/esm/agentkit/preview/gemini-tts.mjs +1 -28
  62. package/dist/esm/agentkit/preview/index.d.mts +2 -2
  63. package/dist/esm/agentkit/preview/index.mjs +1 -1
  64. package/dist/esm/agentkit/token.d.mts +43 -7
  65. package/dist/esm/agentkit/token.mjs +33 -6
  66. package/dist/esm/agentkit/types.d.mts +12 -3
  67. package/dist/esm/agentkit/vendors/avatar.d.mts +30 -12
  68. package/dist/esm/agentkit/vendors/avatar.mjs +59 -8
  69. package/dist/esm/agentkit/vendors/stt.d.mts +35 -0
  70. package/dist/esm/agentkit/vendors/stt.mjs +17 -1
  71. package/dist/esm/agentkit/vendors/tts.d.mts +72 -18
  72. package/dist/esm/agentkit/vendors/tts.mjs +58 -10
  73. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +13 -0
  74. package/dist/esm/api/resources/agents/types/GetTurnsAgentsResponse.d.mts +3 -1
  75. package/dist/esm/api/types/Asr.d.mts +4 -1
  76. package/dist/esm/api/types/CartesiaTts.d.mts +10 -0
  77. package/dist/esm/api/types/CartesiaTts.mjs +8 -1
  78. package/dist/esm/api/types/CartesiaTtsParams.d.mts +1 -1
  79. package/dist/esm/api/types/DeepgramAsrParams.d.mts +1 -1
  80. package/dist/esm/api/types/FishAudioTts.d.mts +10 -0
  81. package/dist/esm/api/types/FishAudioTts.mjs +8 -1
  82. package/dist/esm/api/types/FishAudioTtsParams.d.mts +1 -1
  83. package/dist/esm/api/types/GeminiTts.d.mts +9 -0
  84. package/dist/esm/api/types/GeminiTts.mjs +2 -0
  85. package/dist/esm/api/types/GeminiTtsParams.d.mts +15 -0
  86. package/dist/esm/api/types/GeminiTtsParams.mjs +2 -0
  87. package/dist/esm/api/types/RtzrAsr.d.mts +10 -0
  88. package/dist/esm/api/types/RtzrAsr.mjs +2 -0
  89. package/dist/esm/api/types/RtzrAsrParams.d.mts +31 -0
  90. package/dist/esm/api/types/RtzrAsrParams.mjs +2 -0
  91. package/dist/esm/api/types/SarvamTtsParams.d.mts +12 -8
  92. package/dist/esm/api/types/SarvamTtsParams.mjs +1 -1
  93. package/dist/esm/api/types/Tts.d.mts +4 -1
  94. package/dist/esm/api/types/index.d.mts +4 -0
  95. package/dist/esm/api/types/index.mjs +4 -0
  96. package/dist/esm/index.d.mts +4 -4
  97. package/dist/esm/index.mjs +3 -3
  98. package/dist/esm/version.d.mts +1 -1
  99. package/dist/esm/version.mjs +1 -1
  100. package/package.json +2 -2
package/README.md CHANGED
@@ -234,9 +234,9 @@ See the [MLLM Flow guide](./docs/guides/mllm-flow.md) for full examples with Gem
234
234
 
235
235
  ## Avatars
236
236
 
237
- AgentKit supports LiveAvatar, Generic Avatar, Anam, Akool, SenseTime (CN), and deprecated HeyGen. Avatar `agoraToken` is optional: when omitted, `session.start()` generates a token using the same ConvoAI token format as the agent token, scoped to the avatar `agoraUid`. Avatars require the cascading ASR + LLM + TTS pipeline (not MLLM).
237
+ AgentKit supports LiveAvatar, Generic Avatar (including Tavus, Protoface, and LemonSlice), Anam, Akool, SenseTime (CN), and deprecated HeyGen. Avatar `agoraToken` is optional: when omitted, `session.start()` generates a token using the same ConvoAI token format as the agent token, scoped to the avatar `agoraUid`. Avatars require the cascading ASR + LLM + TTS pipeline (not MLLM).
238
238
 
239
- See the [Avatar Integration guide](./docs/guides/avatars.md) for sample-rate requirements and Generic Avatar setup.
239
+ See the [Avatar Integration guide](./docs/guides/avatars.md) for sample-rate requirements, provider URL defaults, LemonSlice image/agent selectors and aspect ratios, and Generic Avatar setup.
240
240
 
241
241
  ## Documentation
242
242
 
@@ -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.12.0",
45
- "User-Agent": "agora-agents/v2.12.0",
44
+ "X-Fern-SDK-Version": "v2.13.1",
45
+ "User-Agent": "agora-agents/v2.13.1",
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);
@@ -605,9 +605,8 @@ class Agent {
605
605
  else {
606
606
  // opts is narrowed to the appId/appCertificate branch here
607
607
  const { appId, appCertificate, expiresIn } = opts;
608
- // Use buildTokenWithRtm (RTC + RTM) so the token works whether or not
609
- // the caller enables advanced_features.enable_rtm. The account string
610
- // works for both numeric and string UIDs.
608
+ // Build the ConvoAI-specific Token007 with RTC, RTM, and ConvoAI
609
+ // services. The account string works for numeric UIDs.
611
610
  token = (0, token_js_1.generateConvoAIToken)({
612
611
  appId,
613
612
  appCertificate,
@@ -747,6 +746,14 @@ class Agent {
747
746
  delete params.language_codes;
748
747
  asrConfig.params = params;
749
748
  }
749
+ if (asrConfig.vendor === "deepgram" && asrConfig.params !== undefined) {
750
+ const params = Object.assign({}, asrConfig.params);
751
+ if (params.api_key === undefined && params.key !== undefined) {
752
+ params.api_key = params.key;
753
+ }
754
+ delete params.key;
755
+ asrConfig.params = params;
756
+ }
750
757
  // Turn detection is the single source of truth for the top-level
751
758
  // interaction language. Provider-specific languages remain in params.
752
759
  asrConfig.language = turnDetectionConfig.language;
@@ -262,9 +262,13 @@ class AgentSession {
262
262
  }
263
263
  // Validate TTS sample rate against avatar requirements
264
264
  // Note: tts can be a string (shorthand) or an object with params
265
- // sample_rate may not exist on all TTS vendor params, so we check dynamically
265
+ // Sample-rate fields vary by provider, so check the generated wire names dynamically.
266
266
  const ttsParams = tts && typeof tts !== "string" ? tts.params : undefined;
267
- const sampleRate = ttsParams && "sample_rate" in ttsParams ? ttsParams.sample_rate : undefined;
267
+ const sampleRate = ttsParams && "sample_rate" in ttsParams
268
+ ? ttsParams.sample_rate
269
+ : ttsParams && "speech_sample_rate" in ttsParams
270
+ ? ttsParams.speech_sample_rate
271
+ : undefined;
268
272
  if (typeof sampleRate === "number") {
269
273
  if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) || (0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) || (0, avatar_types_js_1.isAkoolAvatar)(strictAvatar)) {
270
274
  (0, avatar_types_js_1.validateTtsSampleRate)(strictAvatar, sampleRate);
@@ -77,6 +77,12 @@ export interface AnamAvatarConfig {
77
77
  api_key: string;
78
78
  /** Anam avatar ID (optional) */
79
79
  avatar_id?: string;
80
+ /** Anam avatar model, such as `cara_mk4` for Cara 4 portrait mode */
81
+ avatar_model?: string;
82
+ /** Output video width in pixels; set together with `video_height` */
83
+ video_width?: number;
84
+ /** Output video height in pixels; set together with `video_width` */
85
+ video_height?: number;
80
86
  [key: string]: unknown;
81
87
  };
82
88
  }
@@ -31,12 +31,10 @@ export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPre
31
31
  export { AgentPresets, normalizePresetInput } from "./presets.js";
32
32
  export type { PreviewFeature, PreviewRoute } from "./preview/client.js";
33
33
  export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./preview/client.js";
34
- export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./preview/gemini-tts.js";
35
- export { GeminiTTS, GeminiTTSModels } from "./preview/gemini-tts.js";
36
34
  export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
37
- export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
38
- export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
39
- export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, McpServer, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SmallestAiAsr, SmallestAiAsrParams, SmallestAiTts, SmallestAiTtsParams, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
35
+ export type { GenerateClientTokenOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
36
+ 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, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, McpServer, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, RtzrAsr, RtzrAsrParams, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, 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, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
40
38
  export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LemonSliceOptions, LiveAvatarAvatarOptions, ProtofaceOptions, TavusOptions, } from "./vendors/avatar.js";
41
39
  export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LemonSlice, LiveAvatarAvatar, Protoface, Tavus, } from "./vendors/avatar.js";
42
40
  export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
@@ -47,7 +45,7 @@ export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, Custom
47
45
  export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
48
46
  export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveModel, GeminiLiveOptions, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, OpenAIGPTLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
49
47
  export { AzureOpenAIRealtime, GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLive, GeminiLiveModels, GeminiThinkingLevels, OpenAIGPTLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.js";
50
- export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SmallestAISTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
51
- export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SmallestAISTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
52
- export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, SmallestAITTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
53
- export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SmallestAITTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
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, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, SmallestAITTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
51
+ export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GeminiTTS, GeminiTTSModels, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, SarvamTTSLanguage, SmallestAITTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
@@ -21,8 +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.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.Tavus = exports.Protoface = exports.LiveAvatarAvatar = exports.LemonSlice = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.GeminiTTSModels = exports.GeminiTTS = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = void 0;
25
- exports.XAiTTS = exports.TypecastTTS = exports.SmallestAITTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SmallestAISTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.OpenAIGPTLive = exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GeminiLive = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.AzureOpenAIRealtime = exports.VertexAILLM = exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = void 0;
24
+ exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.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.SarvamTTSLanguage = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = 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.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 = void 0;
26
+ exports.XAiTTS = exports.TypecastTTS = exports.SmallestAITTS = void 0;
26
27
  // Core classes
27
28
  var Agent_js_1 = require("./Agent.js");
28
29
  Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
@@ -85,12 +86,10 @@ Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get
85
86
  Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: function () { return client_js_1.PreviewFeatures; } });
86
87
  Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
87
88
  Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
88
- var gemini_tts_js_1 = require("./preview/gemini-tts.js");
89
- Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
90
- Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
91
89
  // Token generation
92
90
  var token_js_1 = require("./token.js");
93
91
  Object.defineProperty(exports, "ExpiresIn", { enumerable: true, get: function () { return token_js_1.ExpiresIn; } });
92
+ Object.defineProperty(exports, "generateClientToken", { enumerable: true, get: function () { return token_js_1.generateClientToken; } });
94
93
  Object.defineProperty(exports, "generateConvoAIToken", { enumerable: true, get: function () { return token_js_1.generateConvoAIToken; } });
95
94
  Object.defineProperty(exports, "generateRtcToken", { enumerable: true, get: function () { return token_js_1.generateRtcToken; } });
96
95
  Object.defineProperty(exports, "MAX_EXPIRY_SECONDS", { enumerable: true, get: function () { return token_js_1.MAX_EXPIRY_SECONDS; } });
@@ -173,6 +172,7 @@ Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, ge
173
172
  Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function () { return stt_js_1.GoogleSTT; } });
174
173
  Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function () { return stt_js_1.MicrosoftSTT; } });
175
174
  Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
175
+ Object.defineProperty(exports, "RTZRSTT", { enumerable: true, get: function () { return stt_js_1.RTZRSTT; } });
176
176
  Object.defineProperty(exports, "SarvamSTT", { enumerable: true, get: function () { return stt_js_1.SarvamSTT; } });
177
177
  Object.defineProperty(exports, "SmallestAISTT", { enumerable: true, get: function () { return stt_js_1.SmallestAISTT; } });
178
178
  Object.defineProperty(exports, "SpeechmaticsSTT", { enumerable: true, get: function () { return stt_js_1.SpeechmaticsSTT; } });
@@ -184,6 +184,8 @@ Object.defineProperty(exports, "CartesiaTTS", { enumerable: true, get: function
184
184
  Object.defineProperty(exports, "DeepgramTTS", { enumerable: true, get: function () { return tts_js_1.DeepgramTTS; } });
185
185
  Object.defineProperty(exports, "ElevenLabsTTS", { enumerable: true, get: function () { return tts_js_1.ElevenLabsTTS; } });
186
186
  Object.defineProperty(exports, "FishAudioTTS", { enumerable: true, get: function () { return tts_js_1.FishAudioTTS; } });
187
+ Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return tts_js_1.GeminiTTS; } });
188
+ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return tts_js_1.GeminiTTSModels; } });
187
189
  Object.defineProperty(exports, "GenericTTS", { enumerable: true, get: function () { return tts_js_1.GenericTTS; } });
188
190
  Object.defineProperty(exports, "GoogleTTS", { enumerable: true, get: function () { return tts_js_1.GoogleTTS; } });
189
191
  Object.defineProperty(exports, "GradiumTTS", { enumerable: true, get: function () { return tts_js_1.GradiumTTS; } });
@@ -195,6 +197,7 @@ Object.defineProperty(exports, "MurfTTS", { enumerable: true, get: function () {
195
197
  Object.defineProperty(exports, "OpenAITTS", { enumerable: true, get: function () { return tts_js_1.OpenAITTS; } });
196
198
  Object.defineProperty(exports, "RimeTTS", { enumerable: true, get: function () { return tts_js_1.RimeTTS; } });
197
199
  Object.defineProperty(exports, "SarvamTTS", { enumerable: true, get: function () { return tts_js_1.SarvamTTS; } });
200
+ Object.defineProperty(exports, "SarvamTTSLanguage", { enumerable: true, get: function () { return tts_js_1.SarvamTTSLanguage; } });
198
201
  Object.defineProperty(exports, "SmallestAITTS", { enumerable: true, get: function () { return tts_js_1.SmallestAITTS; } });
199
202
  Object.defineProperty(exports, "TypecastTTS", { enumerable: true, get: function () { return tts_js_1.TypecastTTS; } });
200
203
  Object.defineProperty(exports, "XAiTTS", { enumerable: true, get: function () { return tts_js_1.XAiTTS; } });
@@ -93,10 +93,10 @@ function omitUndefinedKeys(value) {
93
93
  return Object.keys(next).length > 0 ? next : undefined;
94
94
  }
95
95
  function inferAsrPreset(asr) {
96
- var _a, _b, _c;
97
- if (!asr || asr.vendor !== "deepgram" || ((_a = asr.params) === null || _a === void 0 ? void 0 : _a.key))
96
+ var _a, _b, _c, _d;
97
+ if (!asr || asr.vendor !== "deepgram" || ((_a = asr.params) === null || _a === void 0 ? void 0 : _a.api_key) || ((_b = asr.params) === null || _b === void 0 ? void 0 : _b.key))
98
98
  return undefined;
99
- const preset = deepgramModelToPreset[(_c = normalizeModelName((_b = asr.params) === null || _b === void 0 ? void 0 : _b.model)) !== null && _c !== void 0 ? _c : ""];
99
+ const preset = deepgramModelToPreset[(_d = normalizeModelName((_c = asr.params) === null || _c === void 0 ? void 0 : _c.model)) !== null && _d !== void 0 ? _d : ""];
100
100
  if (!preset)
101
101
  return undefined;
102
102
  return {
@@ -7,9 +7,9 @@
7
7
  * and binds that session to the preview host while ordinary AgoraClient calls
8
8
  * remain on the regional production endpoint.
9
9
  *
10
- * Everything under `agentkit/preview/` is temporary. When a provider ships on
11
- * the production gateway, remove its preview registration and move its class
12
- * into the corresponding production vendor module.
10
+ * Preview registrations are temporary. When a provider ships on the production
11
+ * gateway, remove its registration and move its class into the corresponding
12
+ * production vendor module, retaining historical imports as aliases.
13
13
  */
14
14
  import type { AgoraClient } from "../../AgoraPoolClient.js";
15
15
  import type * as Agora from "../../api/index.js";
@@ -31,7 +31,7 @@ export declare const PREVIEW_FEATURE_HEADER = "agora-feature";
31
31
  * preview endpoint.
32
32
  */
33
33
  export declare const PreviewFeatures: {
34
- /** Gemini TTS preview gate; Gemini ASR and Live use production. */
34
+ /** @deprecated Gemini ASR, Live, and TTS now use the production endpoint. */
35
35
  readonly GeminiLive: "gemini-live";
36
36
  /** @deprecated GPT Live now uses the production endpoint. */
37
37
  readonly LiveModels: "live-models";
@@ -52,7 +52,8 @@ export interface PreviewRoute {
52
52
  export declare function previewRequestHeaders(features: readonly PreviewFeature[], headers?: Record<string, string>): Record<string, string>;
53
53
  /** Build generated resource clients for one preview session. */
54
54
  export declare function createPreviewRoute(client: AgoraClient, features: readonly PreviewFeature[]): PreviewRoute;
55
- export declare function requiredPreviewFeatures(properties: Agora.StartAgentsRequest.Properties): PreviewFeature[];
55
+ /** Compatibility helper; all formerly registered providers now use production. */
56
+ export declare function requiredPreviewFeatures(_properties: Agora.StartAgentsRequest.Properties): PreviewFeature[];
56
57
  /**
57
58
  * Normalizes the historical Gemini preview greeting field for production.
58
59
  * Kept under its old name so callers importing this compatibility helper do
@@ -8,9 +8,9 @@
8
8
  * and binds that session to the preview host while ordinary AgoraClient calls
9
9
  * remain on the regional production endpoint.
10
10
  *
11
- * Everything under `agentkit/preview/` is temporary. When a provider ships on
12
- * the production gateway, remove its preview registration and move its class
13
- * into the corresponding production vendor module.
11
+ * Preview registrations are temporary. When a provider ships on the production
12
+ * gateway, remove its registration and move its class into the corresponding
13
+ * production vendor module, retaining historical imports as aliases.
14
14
  */
15
15
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
16
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -45,7 +45,7 @@ exports.PREVIEW_FEATURE_HEADER = "agora-feature";
45
45
  * preview endpoint.
46
46
  */
47
47
  exports.PreviewFeatures = {
48
- /** Gemini TTS preview gate; Gemini ASR and Live use production. */
48
+ /** @deprecated Gemini ASR, Live, and TTS now use the production endpoint. */
49
49
  GeminiLive: "gemini-live",
50
50
  /** @deprecated GPT Live now uses the production endpoint. */
51
51
  LiveModels: "live-models",
@@ -74,9 +74,9 @@ function createPreviewRoute(client, features) {
74
74
  features: [...features],
75
75
  };
76
76
  }
77
- function requiredPreviewFeatures(properties) {
78
- var _a;
79
- return ((_a = properties.tts) === null || _a === void 0 ? void 0 : _a.vendor) === "gemini" ? [exports.PreviewFeatures.GeminiLive] : [];
77
+ /** Compatibility helper; all formerly registered providers now use production. */
78
+ function requiredPreviewFeatures(_properties) {
79
+ return [];
80
80
  }
81
81
  const PRODUCTION_GEMINI_MLLM_MODELS = new Set([
82
82
  "models/gemini-3.8-live",
@@ -1,31 +1,3 @@
1
- import { BaseTTS } from "../vendors/base.js";
2
- /** Gemini 3.8 Flash TTS preview model. */
3
- export declare const GeminiTTSModels: {
4
- readonly Flash38: "gemini-3.8-flash-tts";
5
- };
6
- export type GeminiTTSModel = (typeof GeminiTTSModels)[keyof typeof GeminiTTSModels] | (string & {});
7
- export interface GeminiTTSOptions {
8
- apiKey: string;
9
- /** Sent verbatim; defaults to Gemini 3.8 Flash TTS. */
10
- model?: GeminiTTSModel;
11
- /** Defaults to Puck. */
12
- voice?: string;
13
- /** Natural-language speaking instructions. Omitted unless supplied. */
14
- style?: string;
15
- }
16
- /** Preview wire shape, kept separate from the generated production schema. */
17
- export interface GeminiTTSConfig {
18
- vendor: "gemini";
19
- params: {
20
- api_key: string;
21
- model: string;
22
- voice: string;
23
- style?: string;
24
- };
25
- }
26
- /** Preview-only TTS. AgentSession selects the gemini-live gate automatically. */
27
- export declare class GeminiTTS extends BaseTTS {
28
- private readonly options;
29
- constructor(options: GeminiTTSOptions);
30
- toConfig(): GeminiTTSConfig;
31
- }
1
+ /** Legacy preview import aliases for the production Gemini TTS implementation. */
2
+ export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "../vendors/tts.js";
3
+ export { GeminiTTS, GeminiTTSModels } from "../vendors/tts.js";
@@ -1,32 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GeminiTTS = exports.GeminiTTSModels = void 0;
4
- const base_js_1 = require("../vendors/base.js");
5
- /** Gemini 3.8 Flash TTS preview model. */
6
- exports.GeminiTTSModels = {
7
- Flash38: "gemini-3.8-flash-tts",
8
- };
9
- /** Preview-only TTS. AgentSession selects the gemini-live gate automatically. */
10
- class GeminiTTS extends base_js_1.BaseTTS {
11
- constructor(options) {
12
- super();
13
- for (const field of ["apiKey", "model", "voice"]) {
14
- const value = options[field];
15
- if ((field === "apiKey" || value !== undefined) && (typeof value !== "string" || !value.trim())) {
16
- throw new Error(`GeminiTTS requires ${field}`);
17
- }
18
- }
19
- if (options.style !== undefined && typeof options.style !== "string") {
20
- throw new Error("GeminiTTS style must be a string");
21
- }
22
- this.options = Object.assign({}, options);
23
- }
24
- toConfig() {
25
- const { apiKey, model = exports.GeminiTTSModels.Flash38, voice = "Puck", style } = this.options;
26
- return {
27
- vendor: "gemini",
28
- params: Object.assign({ api_key: apiKey, model, voice }, (style !== undefined && { style })),
29
- };
30
- }
31
- }
32
- exports.GeminiTTS = GeminiTTS;
3
+ exports.GeminiTTSModels = exports.GeminiTTS = void 0;
4
+ var tts_js_1 = require("../vendors/tts.js");
5
+ Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return tts_js_1.GeminiTTS; } });
6
+ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return tts_js_1.GeminiTTSModels; } });
@@ -8,9 +8,9 @@ export type { OpenAIGPTLiveOptions } from "../vendors/mllm.js";
8
8
  export { OpenAIGPTLive } from "../vendors/mllm.js";
9
9
  export type { GeminiSTTModel, GeminiSTTOptions } from "../vendors/stt.js";
10
10
  export { GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode } from "../vendors/stt.js";
11
+ export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "../vendors/tts.js";
12
+ export { GeminiTTS, GeminiTTSModels } from "../vendors/tts.js";
11
13
  export type { PreviewFeature, PreviewRoute } from "./client.js";
12
14
  export { applyPreviewShape, createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.js";
13
- export type { GeminiTTSConfig, GeminiTTSModel, GeminiTTSOptions } from "./gemini-tts.js";
14
- export { GeminiTTS, GeminiTTSModels } from "./gemini-tts.js";
15
15
  export type { GeminiLiveModel, GeminiLiveVoice, GeminiPreviewVoice, GeminiThinkingLevel, } from "./vendors.js";
16
16
  export { GEMINI_MLLM_DEFAULT_MODEL, GEMINI_MLLM_URL, GEMINI_PREVIEW_MLLM_URL, GeminiLiveModels, GeminiThinkingLevels, } from "./vendors.js";
@@ -6,13 +6,16 @@
6
6
  * the production vendor modules independently.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.GeminiTTSModels = exports.GeminiTTS = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.applyPreviewShape = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.OpenAIGPTLive = void 0;
9
+ exports.GeminiThinkingLevels = exports.GeminiLiveModels = exports.GEMINI_PREVIEW_MLLM_URL = exports.GEMINI_MLLM_URL = exports.GEMINI_MLLM_DEFAULT_MODEL = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.applyPreviewShape = exports.GeminiTTSModels = exports.GeminiTTS = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.OpenAIGPTLive = void 0;
10
10
  var mllm_js_1 = require("../vendors/mllm.js");
11
11
  Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return mllm_js_1.OpenAIGPTLive; } });
12
12
  var stt_js_1 = require("../vendors/stt.js");
13
13
  Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
14
14
  Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
15
15
  Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
16
+ var tts_js_1 = require("../vendors/tts.js");
17
+ Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return tts_js_1.GeminiTTS; } });
18
+ Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return tts_js_1.GeminiTTSModels; } });
16
19
  var client_js_1 = require("./client.js");
17
20
  Object.defineProperty(exports, "applyPreviewShape", { enumerable: true, get: function () { return client_js_1.applyPreviewShape; } });
18
21
  Object.defineProperty(exports, "createPreviewRoute", { enumerable: true, get: function () { return client_js_1.createPreviewRoute; } });
@@ -21,9 +24,6 @@ Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get
21
24
  Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: function () { return client_js_1.PreviewFeatures; } });
22
25
  Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
23
26
  Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
24
- var gemini_tts_js_1 = require("./gemini-tts.js");
25
- Object.defineProperty(exports, "GeminiTTS", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTS; } });
26
- Object.defineProperty(exports, "GeminiTTSModels", { enumerable: true, get: function () { return gemini_tts_js_1.GeminiTTSModels; } });
27
27
  var vendors_js_1 = require("./vendors.js");
28
28
  Object.defineProperty(exports, "GEMINI_MLLM_DEFAULT_MODEL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_DEFAULT_MODEL; } });
29
29
  Object.defineProperty(exports, "GEMINI_MLLM_URL", { enumerable: true, get: function () { return vendors_js_1.GEMINI_MLLM_URL; } });
@@ -3,8 +3,11 @@
3
3
  *
4
4
  * - RTC tokens authenticate a specific (appId, channel, uid) combination with
5
5
  * the Agora RTC network.
6
- * - ConvoAI tokens are combined RTC + RTM tokens used to authenticate ConvoAI
7
- * REST API calls via `Authorization: agora token=<token>`.
6
+ * - ConvoAI tokens are RTC + RTM + ConvoAI tokens used to authenticate
7
+ * ConvoAI REST API calls via `Authorization: agora token=<token>`. Keep them
8
+ * on the server.
9
+ * - Client tokens are RTC + RTM only, for front-end token routes. They join a
10
+ * channel and log in to RTM but cannot call the ConvoAI REST API.
8
11
  *
9
12
  * The `agora-token` library handles the JWT signing.
10
13
  */
@@ -74,8 +77,12 @@ export interface GenerateConvoAITokenOptions {
74
77
  appCertificate: string;
75
78
  /** The channel the agent will join — must match the channel used in the start request */
76
79
  channelName: string;
77
- /** Numeric ConvoAI participant UID. Use the RTC UID for a user, agent, or avatar. */
78
- uid: number;
80
+ /**
81
+ * ConvoAI participant UID: a numeric RTC UID or a string user account. Use the
82
+ * RTC UID for a user, agent, or avatar. Both forms are signed as the UID's
83
+ * string form, which is also the RTM user ID.
84
+ */
85
+ uid: number | string;
79
86
  /** Seconds until the token expires (default: 86400) */
80
87
  tokenExpire?: number;
81
88
  /**
@@ -86,11 +93,40 @@ export interface GenerateConvoAITokenOptions {
86
93
  privilegeExpire?: number;
87
94
  }
88
95
  /**
89
- * Builds a combined RTC + RTM token for ConvoAI REST API authentication.
96
+ * Builds a ConvoAI token carrying RTC, RTM, and ConvoAI services for REST API authentication.
90
97
  *
91
98
  * The resulting token is used as: `Authorization: agora token=<token>`
92
99
  *
93
- * Uses `buildTokenWithRtm` which bundles both RTC channel access and RTM
94
- * messaging privileges in a single AccessToken2 token.
100
+ * Uses `ConvoAITokenBuilder.buildToken`, which adds the ConvoAI service marker
101
+ * required by the ConvoAI REST API alongside RTC channel access and RTM login
102
+ * privileges in a single AccessToken2 token.
95
103
  */
96
104
  export declare function generateConvoAIToken(opts: GenerateConvoAITokenOptions): string;
105
+ export interface GenerateClientTokenOptions {
106
+ appId: string;
107
+ appCertificate: string;
108
+ /** The channel the client will join. */
109
+ channelName: string;
110
+ /**
111
+ * The client's RTC UID or string user account. It is also the RTM user ID, so
112
+ * it must be nonzero and nonempty.
113
+ */
114
+ uid: number | string;
115
+ /** Seconds until the token expires (default: 86400) */
116
+ tokenExpire?: number;
117
+ /**
118
+ * Seconds until RTC privileges expire. Defaults to `tokenExpire`. RTM login
119
+ * keeps the token lifetime.
120
+ */
121
+ privilegeExpire?: number;
122
+ }
123
+ /**
124
+ * Builds an RTC + RTM token for a front-end client. Use it in token routes that
125
+ * hand tokens to browsers or apps.
126
+ *
127
+ * The token joins the RTC channel as a publisher and logs in to RTM, the data
128
+ * channel for agent transcripts and state. It carries no ConvoAI service, so it
129
+ * cannot authenticate ConvoAI REST calls. Use {@link generateConvoAIToken} for
130
+ * server-side REST authentication and agent tokens instead.
131
+ */
132
+ export declare function generateClientToken(opts: GenerateClientTokenOptions): string;
@@ -4,8 +4,11 @@
4
4
  *
5
5
  * - RTC tokens authenticate a specific (appId, channel, uid) combination with
6
6
  * the Agora RTC network.
7
- * - ConvoAI tokens are combined RTC + RTM tokens used to authenticate ConvoAI
8
- * REST API calls via `Authorization: agora token=<token>`.
7
+ * - ConvoAI tokens are RTC + RTM + ConvoAI tokens used to authenticate
8
+ * ConvoAI REST API calls via `Authorization: agora token=<token>`. Keep them
9
+ * on the server.
10
+ * - Client tokens are RTC + RTM only, for front-end token routes. They join a
11
+ * channel and log in to RTM but cannot call the ConvoAI REST API.
9
12
  *
10
13
  * The `agora-token` library handles the JWT signing.
11
14
  */
@@ -17,6 +20,7 @@ exports.ExpiresIn = exports.MAX_EXPIRY_SECONDS = void 0;
17
20
  exports.generateRtcToken = generateRtcToken;
18
21
  exports.generateRtcTokenWithAccount = generateRtcTokenWithAccount;
19
22
  exports.generateConvoAIToken = generateConvoAIToken;
23
+ exports.generateClientToken = generateClientToken;
20
24
  const agora_token_1 = __importDefault(require("agora-token"));
21
25
  const DEFAULT_EXPIRY_SECONDS = 86400;
22
26
  exports.MAX_EXPIRY_SECONDS = 86400;
@@ -137,12 +141,13 @@ function generateRtcTokenWithAccount(opts) {
137
141
  return _requireBuiltToken(agora_token_1.default.RtcTokenBuilder.buildTokenWithUserAccount(opts.appId, opts.appCertificate, opts.channel, opts.account, (_b = opts.role) !== null && _b !== void 0 ? _b : agora_token_1.default.RtcRole.PUBLISHER, expiry, expiry), opts.appId, opts.appCertificate);
138
142
  }
139
143
  /**
140
- * Builds a combined RTC + RTM token for ConvoAI REST API authentication.
144
+ * Builds a ConvoAI token carrying RTC, RTM, and ConvoAI services for REST API authentication.
141
145
  *
142
146
  * The resulting token is used as: `Authorization: agora token=<token>`
143
147
  *
144
- * Uses `buildTokenWithRtm` which bundles both RTC channel access and RTM
145
- * messaging privileges in a single AccessToken2 token.
148
+ * Uses `ConvoAITokenBuilder.buildToken`, which adds the ConvoAI service marker
149
+ * required by the ConvoAI REST API alongside RTC channel access and RTM login
150
+ * privileges in a single AccessToken2 token.
146
151
  */
147
152
  function generateConvoAIToken(opts) {
148
153
  var _a, _b;
@@ -152,11 +157,34 @@ function generateConvoAIToken(opts) {
152
157
  const configuredPrivilegeExpire = (_b = opts.privilegeExpire) !== null && _b !== void 0 ? _b : 0;
153
158
  const privilegeExpire = configuredPrivilegeExpire === 0 ? tokenExpire : configuredPrivilegeExpire;
154
159
  const account = _uidToAccount(opts.uid);
155
- return _requireBuiltToken(agora_token_1.default.RtcTokenBuilder.buildTokenWithRtm(opts.appId, opts.appCertificate, opts.channelName, account, agora_token_1.default.RtcRole.PUBLISHER, tokenExpire, privilegeExpire), opts.appId, opts.appCertificate);
160
+ return _requireBuiltToken(agora_token_1.default.ConvoAITokenBuilder.buildToken(opts.appId, opts.appCertificate, opts.channelName, account, agora_token_1.default.RtcRole.PUBLISHER, tokenExpire, privilegeExpire, privilegeExpire, privilegeExpire, privilegeExpire, account, privilegeExpire), opts.appId, opts.appCertificate);
156
161
  }
157
162
  function _uidToAccount(uid) {
163
+ if (typeof uid === "string") {
164
+ return uid;
165
+ }
158
166
  if (!Number.isInteger(uid)) {
159
167
  throw new Error("uid must be an integer when provided as a number");
160
168
  }
161
169
  return String(uid);
162
170
  }
171
+ /**
172
+ * Builds an RTC + RTM token for a front-end client. Use it in token routes that
173
+ * hand tokens to browsers or apps.
174
+ *
175
+ * The token joins the RTC channel as a publisher and logs in to RTM, the data
176
+ * channel for agent transcripts and state. It carries no ConvoAI service, so it
177
+ * cannot authenticate ConvoAI REST calls. Use {@link generateConvoAIToken} for
178
+ * server-side REST authentication and agent tokens instead.
179
+ */
180
+ function generateClientToken(opts) {
181
+ var _a;
182
+ const account = _uidToAccount(opts.uid);
183
+ if (account === "" || /^0+$/.test(account)) {
184
+ throw new Error("uid must be nonzero and nonempty: it is also the RTM user ID");
185
+ }
186
+ const tokenExpire = (_a = opts.tokenExpire) !== null && _a !== void 0 ? _a : DEFAULT_EXPIRY_SECONDS;
187
+ // Per Agora docs, privilegeExpire=0 means "expires immediately", which is invalid.
188
+ const privilegeExpire = opts.privilegeExpire || tokenExpire;
189
+ return _requireBuiltToken(agora_token_1.default.RtcTokenBuilder.buildTokenWithRtm(opts.appId, opts.appCertificate, opts.channelName, account, agora_token_1.default.RtcRole.PUBLISHER, tokenExpire, privilegeExpire), opts.appId, opts.appCertificate);
190
+ }
@@ -2,10 +2,9 @@
2
2
  * Clean type aliases for the Agora Conversational AI SDK.
3
3
  * These provide shorter, more intuitive names for the verbose Fern-generated types.
4
4
  */
5
- import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GeminiAsrParams as GeminiAsrParamsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, McpServer as McpServerType, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, SarvamTtsParams as SarvamTtsParamsType, SarvamTts as SarvamTtsType, SmallestAiAsrParams as SmallestAiAsrParamsType, SmallestAiAsr as SmallestAiAsrType, SmallestAiTtsParams as SmallestAiTtsParamsType, SmallestAiTts as SmallestAiTtsType, SpatiusAvatarParams as SpatiusAvatarParamsType, SpeakAgentsRequest, StartAgentsRequest, Tts, TypecastTtsParams as TypecastTtsParamsType, TypecastTts as TypecastTtsType, UpdateAgentsRequest, XAiAsrParams as XAiAsrParamsType, XAiAsr as XAiAsrType, XAiTtsParams as XAiTtsParamsType, XAiTts as XAiTtsType } from "../api/index.js";
5
+ import type { AgentThinkAgentManagementResponse, AmazonTtsParams as AmazonTtsParamsType, AmazonTts as AmazonTtsType, Asr, AsrLanguage, CartesiaTtsParams as CartesiaTtsParamsType, CartesiaTts as CartesiaTtsType, ElevenLabsTtsParams as ElevenLabsTtsParamsType, ElevenLabsTts as ElevenLabsTtsType, FishAudioTtsParams as FishAudioTtsParamsType, FishAudioTts as FishAudioTtsType, GeminiAsrParams as GeminiAsrParamsType, GenericHttpTtsParams as GenericTtsParamsType, GenericHttpTts as GenericTtsType, GetAgentsResponse, GetHistoryAgentsResponse, GetTurnsAgentsResponse, GoogleTtsParams as GoogleTtsParamsType, GoogleTts as GoogleTtsType, GradiumTtsParams as GradiumTtsParamsType, GradiumTts as GradiumTtsType, HumeAiTtsParams as HumeAiTtsParamsType, HumeAiTts as HumeAiTtsType, ListAgentsResponse, Llm, LlmToolExecution as LlmToolExecutionType, LlmToolFunction as LlmToolFunctionType, LlmToolServer as LlmToolServerType, LlmTool as LlmToolType, McpServer as McpServerType, MicrosoftTtsParams as MicrosoftTtsParamsType, MicrosoftTts as MicrosoftTtsType, MinimaxTtsParams as MinimaxTtsParamsType, MinimaxTts as MinimaxTtsType, MistralTtsParams as MistralTtsParamsType, MistralTts as MistralTtsType, Mllm, MllmTurnDetection, MllmTurnDetection as MllmTurnDetectionNS, MurfTtsParams as MurfTtsParamsType, MurfTts as MurfTtsType, OpenAiTtsParams as OpenAiTtsParamsType, OpenAiTts as OpenAiTtsType, RimeTtsParams as RimeTtsParamsType, RimeTts as RimeTtsType, 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
- import type { GeminiTTSConfig } from "./preview/gemini-tts.js";
9
8
  /** LLM request style (openai, gemini, anthropic, dify) */
10
9
  export type LlmStyle = Llm.Style;
11
10
  /**
@@ -71,6 +70,10 @@ export type SttConfig = {
71
70
  vendor: "sarvam";
72
71
  language?: TurnDetectionLanguage;
73
72
  params: SarvamAsrParams;
73
+ } | {
74
+ vendor: "rtzr";
75
+ language?: TurnDetectionLanguage;
76
+ params: RtzrAsrParamsType;
74
77
  } | {
75
78
  vendor: "xai";
76
79
  language?: TurnDetectionLanguage;
@@ -85,7 +88,7 @@ export type AsrConfig = SttConfig;
85
88
  /** Wire ASR vendor identifier (e.g. `"deepgram"`, `"fengming"`). */
86
89
  export type AsrVendorName = string;
87
90
  /** TTS (Text-to-Speech) configuration - discriminated union */
88
- export type TtsConfig = Tts | GeminiTTSConfig;
91
+ export type TtsConfig = Tts;
89
92
  /** Inline synchronous REST tool exposed to a standard text LLM. */
90
93
  export type LlmTool = LlmToolType;
91
94
  export type LlmToolExecution = LlmToolExecutionType;
@@ -155,6 +158,8 @@ export type AdvancedFeatures = StartAgentsRequest.Properties.AdvancedFeatures;
155
158
  export type SessionParams = StartAgentsRequest.Properties.Parameters;
156
159
  /** RTC audio scenario for the session parameters object. */
157
160
  export type ParametersAudioScenario = StartAgentsRequest.Properties.Parameters.AudioScenario;
161
+ /** Speak request sentence-segmentation behavior. */
162
+ export type SpeakConfig = StartAgentsRequest.Properties.Parameters.Speak;
158
163
  /**
159
164
  * AgentKit session parameters input.
160
165
  * Allows providing `audio_scenario` through the AgentKit layer.
@@ -447,6 +452,8 @@ export interface SpeechmaticsParams {
447
452
  */
448
453
  export interface DeepgramParams {
449
454
  /** Deepgram API key */
455
+ api_key?: string;
456
+ /** @deprecated Use `api_key` instead. AgentKit normalizes this alias before sending. */
450
457
  key?: string;
451
458
  /** Model to use (e.g., 'nova-2', 'enhanced', 'base') */
452
459
  model?: string;
@@ -566,6 +573,8 @@ export type XAiAsr = XAiAsrType;
566
573
  export type XAiAsrParams = XAiAsrParamsType;
567
574
  export type SmallestAiAsr = SmallestAiAsrType;
568
575
  export type SmallestAiAsrParams = SmallestAiAsrParamsType;
576
+ export type RtzrAsr = RtzrAsrType;
577
+ export type RtzrAsrParams = RtzrAsrParamsType;
569
578
  /** Google Gemini STT parameters generated from the API schema. */
570
579
  export type GeminiAsrParams = GeminiAsrParamsType;
571
580
  export type MicrosoftTts = MicrosoftTtsType;