agora-agents 2.7.0 → 2.8.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 (90) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/BaseClient.js +2 -2
  3. package/dist/cjs/agentkit/Agent.d.ts +1 -1
  4. package/dist/cjs/agentkit/Agent.js +27 -12
  5. package/dist/cjs/agentkit/AgentSession.d.ts +0 -3
  6. package/dist/cjs/agentkit/AgentSession.js +3 -3
  7. package/dist/cjs/agentkit/debug.d.ts +2 -4
  8. package/dist/cjs/agentkit/debug.js +15 -6
  9. package/dist/cjs/agentkit/index.d.ts +7 -5
  10. package/dist/cjs/agentkit/index.js +15 -12
  11. package/dist/cjs/agentkit/preview/client.d.ts +6 -5
  12. package/dist/cjs/agentkit/preview/client.js +10 -5
  13. package/dist/cjs/agentkit/preview/index.d.ts +6 -5
  14. package/dist/cjs/agentkit/preview/index.js +8 -6
  15. package/dist/cjs/agentkit/preview/vendors.d.ts +65 -63
  16. package/dist/cjs/agentkit/preview/vendors.js +71 -36
  17. package/dist/cjs/agentkit/types.d.ts +23 -41
  18. package/dist/cjs/agentkit/vendors/base.d.ts +6 -2
  19. package/dist/cjs/agentkit/vendors/base.js +4 -0
  20. package/dist/cjs/agentkit/vendors/cn.js +7 -5
  21. package/dist/cjs/agentkit/vendors/llm.js +8 -1
  22. package/dist/cjs/agentkit/vendors/stt.d.ts +45 -2
  23. package/dist/cjs/agentkit/vendors/stt.js +53 -5
  24. package/dist/cjs/agentkit/vendors/tts.js +1 -1
  25. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +12 -20
  26. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +1 -1
  27. package/dist/cjs/api/types/Asr.d.ts +4 -1
  28. package/dist/cjs/api/types/GeminiAsr.d.ts +10 -0
  29. package/dist/cjs/api/types/GeminiAsr.js +3 -0
  30. package/dist/cjs/api/types/GeminiAsrParams.d.ts +33 -0
  31. package/dist/cjs/api/types/GeminiAsrParams.js +12 -0
  32. package/dist/cjs/api/types/index.d.ts +2 -0
  33. package/dist/cjs/api/types/index.js +2 -0
  34. package/dist/cjs/index.d.ts +2 -2
  35. package/dist/cjs/index.js +5 -3
  36. package/dist/cjs/version.d.ts +1 -1
  37. package/dist/cjs/version.js +1 -1
  38. package/dist/esm/BaseClient.mjs +2 -2
  39. package/dist/esm/agentkit/Agent.d.mts +1 -1
  40. package/dist/esm/agentkit/Agent.mjs +27 -12
  41. package/dist/esm/agentkit/AgentSession.d.mts +0 -3
  42. package/dist/esm/agentkit/AgentSession.mjs +3 -3
  43. package/dist/esm/agentkit/debug.d.mts +2 -4
  44. package/dist/esm/agentkit/debug.mjs +15 -6
  45. package/dist/esm/agentkit/index.d.mts +7 -5
  46. package/dist/esm/agentkit/index.mjs +3 -2
  47. package/dist/esm/agentkit/preview/client.d.mts +6 -5
  48. package/dist/esm/agentkit/preview/client.mjs +10 -5
  49. package/dist/esm/agentkit/preview/index.d.mts +6 -5
  50. package/dist/esm/agentkit/preview/index.mjs +4 -4
  51. package/dist/esm/agentkit/preview/vendors.d.mts +65 -63
  52. package/dist/esm/agentkit/preview/vendors.mjs +69 -35
  53. package/dist/esm/agentkit/types.d.mts +23 -41
  54. package/dist/esm/agentkit/vendors/base.d.mts +6 -2
  55. package/dist/esm/agentkit/vendors/base.mjs +4 -0
  56. package/dist/esm/agentkit/vendors/cn.mjs +7 -5
  57. package/dist/esm/agentkit/vendors/llm.mjs +8 -1
  58. package/dist/esm/agentkit/vendors/stt.d.mts +45 -2
  59. package/dist/esm/agentkit/vendors/stt.mjs +51 -4
  60. package/dist/esm/agentkit/vendors/tts.mjs +1 -1
  61. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +12 -20
  62. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +1 -1
  63. package/dist/esm/api/types/Asr.d.mts +4 -1
  64. package/dist/esm/api/types/GeminiAsr.d.mts +10 -0
  65. package/dist/esm/api/types/GeminiAsr.mjs +2 -0
  66. package/dist/esm/api/types/GeminiAsrParams.d.mts +33 -0
  67. package/dist/esm/api/types/GeminiAsrParams.mjs +9 -0
  68. package/dist/esm/api/types/index.d.mts +2 -0
  69. package/dist/esm/api/types/index.mjs +2 -0
  70. package/dist/esm/index.d.mts +2 -2
  71. package/dist/esm/index.mjs +2 -2
  72. package/dist/esm/version.d.mts +1 -1
  73. package/dist/esm/version.mjs +1 -1
  74. package/package.json +4 -2
  75. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +0 -1
  76. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +0 -87
  77. package/dist/cjs/agentkit/__tests__/preview-types.test.d.ts +0 -7
  78. package/dist/cjs/agentkit/__tests__/preview-types.test.js +0 -57
  79. package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +0 -1
  80. package/dist/cjs/agentkit/__tests__/readme-examples.test.js +0 -126
  81. package/dist/cjs/agentkit/__tests__/type-safety.test.d.ts +0 -14
  82. package/dist/cjs/agentkit/__tests__/type-safety.test.js +0 -321
  83. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +0 -1
  84. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +0 -85
  85. package/dist/esm/agentkit/__tests__/preview-types.test.d.mts +0 -7
  86. package/dist/esm/agentkit/__tests__/preview-types.test.mjs +0 -55
  87. package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +0 -1
  88. package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +0 -124
  89. package/dist/esm/agentkit/__tests__/type-safety.test.d.mts +0 -14
  90. package/dist/esm/agentkit/__tests__/type-safety.test.mjs +0 -319
@@ -2,8 +2,51 @@
2
2
  * Type-safe STT (Speech-to-Text) vendor classes.
3
3
  */
4
4
  import { type DeepgramPresetModel } from "../presets.mjs";
5
- import type { SttConfig } from "../types.mjs";
6
- import { BaseSTT } from "./base.mjs";
5
+ import type { SttConfig, TurnDetectionLanguage } from "../types.mjs";
6
+ import { BaseSTT, type SampleRate } from "./base.mjs";
7
+ /** Gemini transcription models. */
8
+ export declare const GeminiSTTModels: {
9
+ readonly Transcribe35Live: "gemini-3.5-transcribe-live";
10
+ };
11
+ /** A Gemini transcription model. Known models autocomplete while newer model names remain accepted. */
12
+ export type GeminiSTTModel = (typeof GeminiSTTModels)[keyof typeof GeminiSTTModels] | (string & {});
13
+ /** Transcription output mode for Gemini ASR. */
14
+ export declare const GeminiTranscriptionMode: {
15
+ readonly Smart: "SMART";
16
+ readonly Verbatim: "VERBATIM";
17
+ };
18
+ export type GeminiTranscriptionMode = (typeof GeminiTranscriptionMode)[keyof typeof GeminiTranscriptionMode];
19
+ /** Constructor options for Google Gemini STT. */
20
+ export interface GeminiSTTOptions {
21
+ /** Google Gemini API key. */
22
+ apiKey: string;
23
+ /** Gemini transcription model. Defaults to `gemini-3.5-transcribe-live`. */
24
+ model?: GeminiSTTModel;
25
+ /** Language code for speech recognition (for example, `en-US`). */
26
+ language?: string;
27
+ /** Candidate transcription languages, serialized as `params.language_hints`. */
28
+ languageHints?: readonly TurnDetectionLanguage[];
29
+ /** @deprecated Use `languageHints` instead. */
30
+ languageCodes?: readonly TurnDetectionLanguage[];
31
+ /** Words and phrases used to bias recognition. */
32
+ customVocabulary?: readonly string[];
33
+ /** Audio sample rate in Hz. Defaults to 16000. */
34
+ sampleRate?: SampleRate;
35
+ /** Whether to include word-level timestamps. Cannot be true when custom vocabulary or SMART mode is used. */
36
+ wordTimestamp?: boolean;
37
+ /** Transcript cleanup mode. Defaults to VERBATIM when omitted. */
38
+ mode?: GeminiTranscriptionMode;
39
+ /** Whether to include speaker labels. Cannot be true when mode is SMART. */
40
+ diarization?: boolean;
41
+ /** Additional vendor-specific parameters. Explicit options take precedence. */
42
+ additionalParams?: Record<string, unknown>;
43
+ }
44
+ /** Google Gemini STT vendor. */
45
+ export declare class GeminiSTT extends BaseSTT {
46
+ private readonly options;
47
+ constructor(options: GeminiSTTOptions);
48
+ toConfig(): SttConfig;
49
+ }
7
50
  /**
8
51
  * Constructor options for Speechmatics STT.
9
52
  */
@@ -11,6 +11,51 @@ function _requireString(value, field, vendor) {
11
11
  function isDeepgramManagedModel(model) {
12
12
  return model !== undefined && DeepgramPresetModels.includes(model.trim().toLowerCase());
13
13
  }
14
+ /** Gemini transcription models. */
15
+ export const GeminiSTTModels = {
16
+ Transcribe35Live: "gemini-3.5-transcribe-live",
17
+ };
18
+ /** Transcription output mode for Gemini ASR. */
19
+ export const GeminiTranscriptionMode = {
20
+ Smart: "SMART",
21
+ Verbatim: "VERBATIM",
22
+ };
23
+ /** Google Gemini STT vendor. */
24
+ export class GeminiSTT extends BaseSTT {
25
+ constructor(options) {
26
+ var _a, _b, _c;
27
+ super();
28
+ _requireString(options.apiKey, "apiKey", "GeminiSTT");
29
+ const wordTimestamp = options.wordTimestamp === true;
30
+ if (((_b = (_a = options.customVocabulary) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0 && wordTimestamp) {
31
+ throw new Error("customVocabulary cannot be used with wordTimestamp=true");
32
+ }
33
+ const mode = (_c = options.mode) !== null && _c !== void 0 ? _c : GeminiTranscriptionMode.Verbatim;
34
+ if (mode !== GeminiTranscriptionMode.Smart && mode !== GeminiTranscriptionMode.Verbatim) {
35
+ throw new Error("GeminiSTT Mode must be SMART or VERBATIM");
36
+ }
37
+ if (mode === GeminiTranscriptionMode.Smart) {
38
+ if (wordTimestamp) {
39
+ throw new Error("GeminiSTT Mode=SMART cannot be used with WordTimestamp=true");
40
+ }
41
+ if (options.diarization === true) {
42
+ throw new Error("GeminiSTT Mode=SMART cannot be used with Diarization=true");
43
+ }
44
+ }
45
+ this.options = options;
46
+ }
47
+ toConfig() {
48
+ const { apiKey, model, language, languageHints, languageCodes, customVocabulary, sampleRate, wordTimestamp, mode, diarization, additionalParams, } = this.options;
49
+ const resolvedLanguageHints = languageHints !== null && languageHints !== void 0 ? languageHints : languageCodes;
50
+ const params = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, model: model === undefined ? GeminiSTTModels.Transcribe35Live : model, sample_rate: sampleRate === undefined ? 16000 : sampleRate }), (language !== undefined && { language })), (resolvedLanguageHints !== undefined && {
51
+ language_hints: [...resolvedLanguageHints],
52
+ })), (customVocabulary !== undefined && { custom_vocabulary: [...customVocabulary] })), (wordTimestamp !== undefined && { word_timestamp: wordTimestamp })), (mode !== undefined && { mode })), (diarization !== undefined && { diarization }));
53
+ return {
54
+ vendor: "gemini",
55
+ params,
56
+ };
57
+ }
58
+ }
14
59
  /**
15
60
  * Speechmatics STT vendor.
16
61
  *
@@ -209,15 +254,17 @@ export class AssemblyAISTT extends BaseSTT {
209
254
  */
210
255
  export class AresSTT extends BaseSTT {
211
256
  constructor(options = {}) {
257
+ var _a;
212
258
  super();
259
+ if (Object.keys((_a = options.additionalParams) !== null && _a !== void 0 ? _a : {}).includes("keywords")) {
260
+ throw new Error("AresSTT additionalParams must not contain keywords; use the top-level keywords option");
261
+ }
213
262
  this.options = options;
214
263
  }
215
264
  toConfig() {
216
265
  const { keywords, additionalParams } = this.options;
217
- const hasParams = keywords !== undefined || (additionalParams !== undefined && Object.keys(additionalParams).length > 0);
218
- return Object.assign({ vendor: "ares" }, (hasParams && {
219
- params: Object.assign(Object.assign({}, additionalParams), (keywords !== undefined && { keywords })),
220
- }));
266
+ const hasParams = additionalParams !== undefined && Object.keys(additionalParams).length > 0;
267
+ return Object.assign(Object.assign({ vendor: "ares" }, (keywords !== undefined && { keywords })), (hasParams && { params: Object.assign({}, additionalParams) }));
221
268
  }
222
269
  }
223
270
  /**
@@ -9,7 +9,7 @@ function requireString(value, field, vendor) {
9
9
  throw new Error(`${vendor} requires ${field}`);
10
10
  }
11
11
  }
12
- function requireRecord(value, field, vendor) {
12
+ function _requireRecord(value, field, vendor) {
13
13
  if (value == null || typeof value !== "object" || Array.isArray(value)) {
14
14
  throw new Error(`${vendor} requires ${field}`);
15
15
  }
@@ -111,10 +111,7 @@ export declare namespace StartAgentsRequest {
111
111
  labels?: Record<string, string>;
112
112
  /** RTC media encryption configuration. */
113
113
  rtc?: Properties.Rtc;
114
- /**
115
- * Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow.
116
- * When `enable` is `true`, `content.static_config.phrases` must be present and non-empty, even when `content.mode` is `generated`, because generated mode still falls back to static filler words.
117
- */
114
+ /** Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow. */
118
115
  filler_words?: Properties.FillerWords;
119
116
  /** Agent configuration parameters. */
120
117
  parameters?: Properties.Parameters;
@@ -160,7 +157,7 @@ export declare namespace StartAgentsRequest {
160
157
  enable_rtm?: boolean;
161
158
  /** Enable Selective Attention Locking (SAL). When enabled, configure the `sal` field to set up speaker recognition or locking modes. */
162
159
  enable_sal?: boolean;
163
- /** Enable tool invocation. When enabled, the agent can invoke tools provided by the MCP server to implement advanced functionality. */
160
+ /** Enable invocation for MCP servers and inline REST tools. */
164
161
  enable_tools?: boolean;
165
162
  }
166
163
  /**
@@ -569,7 +566,6 @@ export declare namespace StartAgentsRequest {
569
566
  }
570
567
  /**
571
568
  * Filler word configuration. Plays filler words while waiting for LLM responses to reduce user anxiety and improve conversation flow.
572
- * When `enable` is `true`, `content.static_config.phrases` must be present and non-empty, even when `content.mode` is `generated`, because generated mode still falls back to static filler words.
573
569
  */
574
570
  interface FillerWords {
575
571
  /**
@@ -612,22 +608,19 @@ export declare namespace StartAgentsRequest {
612
608
  /**
613
609
  * Filler word content mode:
614
610
  * - `static`: Static filler words. Uses a predefined list of filler words.
615
- * - `generated`: LLM-generated filler words based on the last user message. Falls back to static filler words when generation is not ready, fails, or returns empty text.
611
+ * - `generated`: LLM-generated filler words based on the last user message.
616
612
  */
617
613
  mode?: Content.Mode;
618
- /**
619
- * Static filler word configuration. Required when `mode` is `static`.
620
- * Also required whenever `filler_words.enable` is `true`, including when `mode` is `generated`, because generated mode uses static filler words as fallback.
621
- */
614
+ /** Static filler word configuration. Required when `mode` is `static`. */
622
615
  static_config?: Content.StaticConfig;
623
- /** Generated filler word configuration. Required when `content.mode` is `generated`. */
616
+ /** Optional configuration for generated filler words. When omitted, the service uses its default generator settings. */
624
617
  generated_config?: Content.GeneratedConfig;
625
618
  }
626
619
  namespace Content {
627
620
  /**
628
621
  * Filler word content mode:
629
622
  * - `static`: Static filler words. Uses a predefined list of filler words.
630
- * - `generated`: LLM-generated filler words based on the last user message. Falls back to static filler words when generation is not ready, fails, or returns empty text.
623
+ * - `generated`: LLM-generated filler words based on the last user message.
631
624
  */
632
625
  const Mode: {
633
626
  readonly Static: "static";
@@ -636,7 +629,6 @@ export declare namespace StartAgentsRequest {
636
629
  type Mode = (typeof Mode)[keyof typeof Mode];
637
630
  /**
638
631
  * Static filler word configuration. Required when `mode` is `static`.
639
- * Also required whenever `filler_words.enable` is `true`, including when `mode` is `generated`, because generated mode uses static filler words as fallback.
640
632
  */
641
633
  interface StaticConfig {
642
634
  /** List of filler word phrases. Maximum 100 filler words, each not exceeding 50 English words. */
@@ -661,23 +653,23 @@ export declare namespace StartAgentsRequest {
661
653
  type SelectionRule = (typeof SelectionRule)[keyof typeof SelectionRule];
662
654
  }
663
655
  /**
664
- * Generated filler word configuration. Required when `content.mode` is `generated`.
656
+ * Optional configuration for generated filler words. When omitted, the service uses its default generator settings.
665
657
  */
666
658
  interface GeneratedConfig {
667
659
  /** OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM and only uses the last user message as input. */
668
- llm_provider: GeneratedConfig.LlmProvider;
660
+ llm_provider?: GeneratedConfig.LlmProvider;
669
661
  /** System prompt used to generate a short filler phrase based on the last user message. The generated text should be conversational and must not answer the user's question. */
670
- prompt: string;
662
+ prompt?: string;
671
663
  /** Fallback strategy when generated filler text is not ready, fails, or returns empty text. Phase 1 only supports `static`. */
672
- fallback_strategy: "static";
664
+ fallback_strategy?: "static";
673
665
  }
674
666
  namespace GeneratedConfig {
675
667
  /**
676
668
  * OpenAI-compatible LLM provider used to generate filler words. Runs in parallel with the main business LLM and only uses the last user message as input.
677
669
  */
678
670
  interface LlmProvider {
679
- /** Base URL of the OpenAI-compatible chat completions endpoint. If the URL does not end with `/chat/completions`, the engine appends it automatically. */
680
- base_url: string;
671
+ /** URL of the OpenAI-compatible chat completions endpoint. If the URL does not end with `/chat/completions`, the engine appends it automatically. */
672
+ url: string;
681
673
  /** API key for authenticating requests to the filler LLM provider. */
682
674
  api_key: string;
683
675
  /** Additional request parameters merged into the generated filler LLM request body, such as `model`. */
@@ -187,7 +187,7 @@ export var StartAgentsRequest;
187
187
  /**
188
188
  * Filler word content mode:
189
189
  * - `static`: Static filler words. Uses a predefined list of filler words.
190
- * - `generated`: LLM-generated filler words based on the last user message. Falls back to static filler words when generation is not ready, fails, or returns empty text.
190
+ * - `generated`: LLM-generated filler words based on the last user message.
191
191
  */
192
192
  Content.Mode = {
193
193
  Static: "static",
@@ -1,5 +1,5 @@
1
1
  import type * as Agora from "../index.mjs";
2
- export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect;
2
+ export type Asr = Agora.Asr.Ares | Agora.Asr.Fengming | Agora.Asr.Tencent | Agora.Asr.Microsoft | Agora.Asr.Deepgram | Agora.Asr.Openai | Agora.Asr.Google | Agora.Asr.Gemini | Agora.Asr.Amazon | Agora.Asr.Assemblyai | Agora.Asr.Speechmatics | Agora.Asr.Sarvam | Agora.Asr.Xai | Agora.Asr.Xfyun | Agora.Asr.XfyunBigmodel | Agora.Asr.XfyunDialect;
3
3
  export declare namespace Asr {
4
4
  interface Ares extends Agora.AresAsr {
5
5
  vendor: "ares";
@@ -22,6 +22,9 @@ export declare namespace Asr {
22
22
  interface Google extends Agora.GoogleAsr {
23
23
  vendor: "google";
24
24
  }
25
+ interface Gemini extends Agora.GeminiAsr {
26
+ vendor: "gemini";
27
+ }
25
28
  interface Amazon extends Agora.AmazonAsr {
26
29
  vendor: "amazon";
27
30
  }
@@ -0,0 +1,10 @@
1
+ import type * as Agora from "../index.mjs";
2
+ /**
3
+ * Google Gemini ASR configuration.
4
+ */
5
+ export interface GeminiAsr {
6
+ language?: Agora.AsrLanguage;
7
+ params: Agora.GeminiAsrParams;
8
+ /** Accepts any additional properties */
9
+ [key: string]: any;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Google Gemini ASR configuration parameters.
3
+ */
4
+ export interface GeminiAsrParams {
5
+ /** The Google Gemini API key used to authenticate requests. */
6
+ api_key: string;
7
+ /** The Gemini transcription model identifier. */
8
+ model: string;
9
+ /** The audio sample rate in Hz. */
10
+ sample_rate?: number | null;
11
+ /** The language code for speech recognition. This takes precedence over the top-level `asr.language` value. */
12
+ language?: string;
13
+ /** Candidate language codes for transcription. When non-empty, these take precedence over language. */
14
+ language_hints?: string[];
15
+ /** Words and phrases used to bias transcription. A non-empty custom vocabulary cannot be combined with word_timestamp. */
16
+ custom_vocabulary?: string[];
17
+ /** Transcription output mode. SMART removes disfluencies and applies formatting; VERBATIM preserves literal speech. When omitted, the service defaults to VERBATIM. SMART cannot be combined with word_timestamp or diarization. */
18
+ mode?: GeminiAsrParams.Mode;
19
+ /** Whether to include word-level timestamps in the transcription results. Cannot be enabled when mode is SMART or custom_vocabulary is non-empty. */
20
+ word_timestamp?: boolean;
21
+ /** Whether to include speaker labels in the transcription results. Cannot be enabled when mode is SMART. */
22
+ diarization?: boolean;
23
+ /** Accepts any additional properties */
24
+ [key: string]: any;
25
+ }
26
+ export declare namespace GeminiAsrParams {
27
+ /** Transcription output mode. SMART removes disfluencies and applies formatting; VERBATIM preserves literal speech. When omitted, the service defaults to VERBATIM. SMART cannot be combined with word_timestamp or diarization. */
28
+ const Mode: {
29
+ readonly Smart: "SMART";
30
+ readonly Verbatim: "VERBATIM";
31
+ };
32
+ type Mode = (typeof Mode)[keyof typeof Mode];
33
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var GeminiAsrParams;
3
+ (function (GeminiAsrParams) {
4
+ /** Transcription output mode. SMART removes disfluencies and applies formatting; VERBATIM preserves literal speech. When omitted, the service defaults to VERBATIM. SMART cannot be combined with word_timestamp or diarization. */
5
+ GeminiAsrParams.Mode = {
6
+ Smart: "SMART",
7
+ Verbatim: "VERBATIM",
8
+ };
9
+ })(GeminiAsrParams || (GeminiAsrParams = {}));
@@ -29,6 +29,8 @@ export * from "./FengmingAsr.mjs";
29
29
  export * from "./FengmingAsrParams.mjs";
30
30
  export * from "./FishAudioTts.mjs";
31
31
  export * from "./FishAudioTtsParams.mjs";
32
+ export * from "./GeminiAsr.mjs";
33
+ export * from "./GeminiAsrParams.mjs";
32
34
  export * from "./GenericHttpTts.mjs";
33
35
  export * from "./GenericHttpTtsParams.mjs";
34
36
  export * from "./GoogleAsr.mjs";
@@ -29,6 +29,8 @@ export * from "./FengmingAsr.mjs";
29
29
  export * from "./FengmingAsrParams.mjs";
30
30
  export * from "./FishAudioTts.mjs";
31
31
  export * from "./FishAudioTtsParams.mjs";
32
+ export * from "./GeminiAsr.mjs";
33
+ export * from "./GeminiAsrParams.mjs";
32
34
  export * from "./GenericHttpTts.mjs";
33
35
  export * from "./GenericHttpTtsParams.mjs";
34
36
  export * from "./GoogleAsr.mjs";
@@ -1,8 +1,8 @@
1
1
  export type { AgoraAuthMode } from "./AgoraPoolClient.mjs";
2
2
  export { AgoraClient } from "./AgoraPoolClient.mjs";
3
3
  export type { AgoraArea, AreaScope, GlobalArea } from "./agentkit/area.mjs";
4
- export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveOptions, GeminiOptions, GeminiSTTModel, GeminiSTTOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmVendor, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.mjs";
5
- export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GeminiSTT, GeminiSTTModels, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.mjs";
4
+ export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AgentOptions, AgentPreset, AgentSessionEvent, AgentSessionEventHandler, AgentSessionOptions, AgentsClient, AkoolAvatarConfig, AkoolAvatarOptions, AkoolSampleRate, AliyunLLMOptions, AmazonBedrockOptions, AmazonSTTOptions, AmazonTTSOptions, AmazonTts, AmazonTtsParams, AnamAvatarConfig, AnamAvatarOptions, AnthropicOptions, AresSTTOptions, AsrConfig, AsrPreset, AsrVendorName, AssemblyAISTTOptions, AvatarConfig, AvatarVendor, AvatarWireVendor, AzureOpenAIOptions, AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, BytedanceDuplexTTSOptions, BytedanceLLMOptions, BytedanceTTSOptions, CartesiaSampleRate, CartesiaTTSOptions, CartesiaTts, CartesiaTtsParams, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, CustomLLMOptions, DeepgramSTTOptions, DeepgramTTSOptions, DeepSeekLLMOptions, DifyOptions, Eagerness, ElevenLabsSampleRate, ElevenLabsTTSOptions, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FengmingSTTOptions, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTTSOptions, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GeminiLiveOptions, GeminiOptions, GeminiSTTModel, GeminiSTTOptions, GenerateConvoAITokenOptions, GenerateTokenOptions, GenericAvatarConfig, GenericAvatarOptions, GenericTTSOptions, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, GoogleSTTOptions, GoogleTTSOptions, GoogleTts, GoogleTtsParams, GradiumTTSOptions, GradiumTts, GradiumTtsParams, GroqOptions, HeyGenAvatarConfig, HeyGenAvatarOptions, HeyGenSampleRate, HumeAITTSOptions, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LiveAvatarAvatarConfig, LiveAvatarAvatarOptions, LiveAvatarSampleRate, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmPreset, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, LlmVendor, McpServersItem, MicrosoftCNSampleRate, MicrosoftCNSTTOptions, MicrosoftCNTTSOptions, MicrosoftSampleRate, MicrosoftSTTOptions, MicrosoftTTSOptions, MicrosoftTts, MicrosoftTtsParams, MiniMaxCNTTSOptions, MiniMaxTTSOptions, MinimaxTts, MinimaxTtsParams, MistralTTSOptions, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTTSOptions, MurfTts, MurfTtsParams, OpenAIGPTLiveOptions, OpenAIOptions, OpenAIRealtimeOptions, OpenAISTTOptions, OpenAITTSOptions, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, PresetCategory, PresetInput, PreviewFeature, PreviewRoute, QwenOmniOptions, RimeTTSOptions, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SampleRate, SarvamSTTOptions, SarvamTTSOptions, SarvamTts, SarvamTtsParams, SayOptions, SensetimeAvatarConfig, SensetimeAvatarOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarConfig, SpatiusAvatarOptions, SpatiusAvatarParams, SpeakPriority, SpeechmaticsSTTOptions, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, StepFunTTSOptions, StrictAvatarConfig, SttConfig, SttVendor, TencentLLMOptions, TencentSTTOptions, TencentTTSOptions, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TtsPreset, TtsVendor, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTTSOptions, TypecastTts, TypecastTtsParams, VertexAILLMOptions, VertexAIOptions, XAiAsr, XAiAsrParams, XAiSTTOptions, XAiTTSOptions, XAiTts, XAiTtsParams, XaiGrokOptions, XfyunBigModelSTTOptions, XfyunDialectSTTOptions, XfyunSTTOptions, } from "./agentkit/index.mjs";
5
+ export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedrock, AmazonSTT, AmazonTTS, AnamAvatar, Anthropic, AresSTT, AssemblyAISTT, AudioScenario, AzureOpenAI, AzureOpenAIRealtime, BaseAvatar, BaseCNAvatar, BaseCNLLM, BaseCNMLLM, BaseCNSTT, BaseCNTTS, BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify, ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken, HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput, OpenAI, OpenAIGPTLive, OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues, SpeechmaticsSTT, StepFunTTS, TencentLLM, TencentSTT, TencentTTS, ThinkOnListeningActionIgnore, ThinkOnListeningActionInject, ThinkOnListeningActionInterrupt, ThinkOnSpeakingActionIgnore, ThinkOnSpeakingActionInterrupt, ThinkOnThinkingActionIgnore, ThinkOnThinkingActionInterrupt, TurnDetectionTypeValues, TypecastTTS, toBaseAvatarConfig, VertexAI, VertexAILLM, validateAvatarConfig, validateTtsSampleRate, XAiSTT, XAiTTS, XaiGrok, XfyunBigModelSTT, XfyunDialectSTT, XfyunSTT, } from "./agentkit/index.mjs";
6
6
  export * as Agora from "./api/index.mjs";
7
7
  export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
8
8
  export { Area } from "./core/domain/index.mjs";
@@ -4,11 +4,11 @@ export { Agent, AgentPresets, AgentSession, AkoolAvatar, AliyunLLM, AmazonBedroc
4
4
  // Base vendor classes
5
5
  BaseLLM, BaseMLLM, BaseSTT, BaseTTS, BytedanceDuplexTTS, BytedanceLLM, BytedanceTTS, CartesiaTTS, CosyVoiceTTS, CredentialMode, CustomLLM, createPreviewRoute, DataChannel, DeepgramSTT, DeepgramTTS, DeepSeekLLM, Dify,
6
6
  // TTS vendors
7
- ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GeminiSTT, GeminiSTTModels, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken,
7
+ ElevenLabsTTS, ExpiresIn, FengmingSTT, FillerWordsSelectionRule, FishAudioTTS, Gemini, GeminiLive, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GenericAvatar, GenericTTS, Geofence, GoogleSTT, GoogleTTS, GradiumTTS, Groq, generateConvoAIToken, generateRtcToken,
8
8
  // Avatar vendors
9
9
  HeyGenAvatar, HumeAITTS, InterruptionDisabledStrategy, InterruptionDisabledStrategyAppend, InterruptionDisabledStrategyIgnore, InterruptionModeKeywords, InterruptionModeStartOfSpeech, InterruptionModeValues, isAkoolAvatar, isAnamAvatar, isAvatarTokenManaged, isGenericAvatar, isHeyGenAvatar, isLiveAvatarAvatar, isSensetimeAvatar, isSpatiusAvatar, LiveAvatarAvatar, MAX_EXPIRY_SECONDS, MicrosoftCNSTT, MicrosoftCNTTS, MicrosoftSTT, MicrosoftTTS, MiniMaxCNTTS, MiniMaxTTS, MistralTTS, MllmTurnDetectionModeAgoraVad, MllmTurnDetectionModeSemanticVad, MllmTurnDetectionModeServerVad, MllmTurnDetectionModeValues, MurfTTS, normalizePresetInput,
10
10
  // LLM vendors
11
- OpenAI,
11
+ OpenAI, OpenAIGPTLive,
12
12
  // MLLM vendors
13
13
  OpenAIRealtime, OpenAISTT, OpenAITTS, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, QwenOmni, REDACTED, RimeTTS, redactHeadersForDebug, redactSecrets, SalModeValues, SarvamSTT, SarvamTTS, SensetimeAvatar, SilenceActionValues, SpatiusAvatar, SpeakPriorityAppend, SpeakPriorityIgnore, SpeakPriorityInterrupt, SpeakPriorityValues,
14
14
  // STT vendors
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "v2.7.0";
1
+ export declare const SDK_VERSION = "v2.8.1";
@@ -1 +1 @@
1
- export const SDK_VERSION = "v2.7.0";
1
+ export const SDK_VERSION = "v2.8.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-agents",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
4
4
  "private": false,
5
5
  "repository": "github:AgoraIO/agora-agents-ts",
6
6
  "type": "commonjs",
@@ -37,9 +37,11 @@
37
37
  "docs:check": "node scripts/docs-check.js",
38
38
  "release:check": "node scripts/check-release-workflow.js",
39
39
  "release:prepare": "node scripts/prepare-release.js",
40
- "build": "rm -rf dist && pnpm build:cjs && pnpm build:esm",
40
+ "build": "rm -rf dist && pnpm typecheck && pnpm build:cjs && pnpm build:esm && pnpm package:check",
41
41
  "build:cjs": "tsc --project ./tsconfig.cjs.json",
42
42
  "build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm && node scripts/verify-esm-imports.js dist/esm",
43
+ "typecheck": "tsc --project ./tsconfig.json",
44
+ "package:check": "node scripts/check-package-contents.js",
43
45
  "test": "vitest",
44
46
  "test:unit": "vitest --project unit",
45
47
  "test:wire": "vitest --project wire",
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const AgoraPoolClient_js_1 = require("../../AgoraPoolClient.js");
4
- const index_js_1 = require("../../core/domain/index.js");
5
- const Agent_js_1 = require("../Agent.js");
6
- const cn_js_1 = require("../vendors/cn.js");
7
- const llm_js_1 = require("../vendors/llm.js");
8
- const mllm_js_1 = require("../vendors/mllm.js");
9
- const stt_js_1 = require("../vendors/stt.js");
10
- const tts_js_1 = require("../vendors/tts.js");
11
- const client = new AgoraPoolClient_js_1.AgoraClient({
12
- area: index_js_1.Area.US,
13
- appId: "app-id",
14
- appCertificate: "app-certificate-0123456789abcdef",
15
- });
16
- new Agent_js_1.Agent({ client, turnDetection: { language: "en-US" } })
17
- .withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }))
18
- .withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }))
19
- .withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }))
20
- .createSession({
21
- name: "assistant",
22
- channel: "test-room",
23
- agentUid: "1",
24
- remoteUids: ["100"],
25
- });
26
- // Area and provider may differ.
27
- new Agent_js_1.Agent({ client }).withStt(new cn_js_1.FengmingSTT());
28
- 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" }));
29
- new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
30
- const globalGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.com/v1/audio/speech" });
31
- new Agent_js_1.Agent({ client }).withTts(globalGenericTts);
32
- const globalMllm = new mllm_js_1.AzureOpenAIRealtime({
33
- apiKey: "azure-key",
34
- url: "wss://example.openai.azure.com/openai/realtime",
35
- turnDetection: { mode: "server_vad" },
36
- });
37
- new Agent_js_1.Agent({ client }).withMllm(globalMllm);
38
- // @ts-expect-error Qwen Omni is a Chinese mainland MLLM vendor.
39
- const _invalidGlobalMllm = new mllm_js_1.QwenOmni({
40
- apiKey: "key",
41
- model: "qwen3.5-omni-plus-realtime",
42
- url: "wss://dashscope.aliyuncs.com/api-ws/v1/realtime",
43
- turnDetection: { mode: "server_vad" },
44
- });
45
- {
46
- const client = new AgoraPoolClient_js_1.AgoraClient({
47
- area: index_js_1.Area.CN,
48
- appId: "app-id",
49
- appCertificate: "app-certificate-0123456789abcdef",
50
- });
51
- new Agent_js_1.Agent({ client, turnDetection: { language: "zh-CN" } })
52
- .withStt(new cn_js_1.FengmingSTT())
53
- .withLlm(new cn_js_1.AliyunLLM({
54
- url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
55
- model: "qwen-plus",
56
- }))
57
- .withTts(new cn_js_1.MiniMaxCNTTS({
58
- key: "minimax-key",
59
- model: "speech-01-turbo",
60
- voiceSetting: { voice_id: "female-shaonv" },
61
- audioSetting: { sample_rate: 16000 },
62
- }))
63
- .createSession({
64
- name: "assistant",
65
- channel: "cn-room",
66
- agentUid: "1",
67
- remoteUids: ["100"],
68
- });
69
- new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
70
- new Agent_js_1.Agent({ client }).withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }));
71
- new Agent_js_1.Agent({ client }).withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
72
- const cnGenericTts = new tts_js_1.GenericTTS({ url: "https://tts.example.cn/v1/audio/speech" });
73
- new Agent_js_1.Agent({ client }).withTts(cnGenericTts);
74
- const cnMllm = new mllm_js_1.QwenOmni({
75
- apiKey: "key",
76
- model: "qwen3.5-omni-plus-realtime",
77
- url: "wss://dashscope.aliyuncs.com/api-ws/v1/realtime",
78
- });
79
- new Agent_js_1.Agent({ client }).withMllm(cnMllm);
80
- // @ts-expect-error Azure OpenAI Realtime is a global MLLM vendor.
81
- const _invalidCnMllm = new mllm_js_1.AzureOpenAIRealtime({
82
- apiKey: "azure-key",
83
- url: "wss://example.openai.azure.com/openai/realtime",
84
- turnDetection: { mode: "server_vad" },
85
- });
86
- }
87
- new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
@@ -1,7 +0,0 @@
1
- /**
2
- * Compile-time type checks for the preview providers.
3
- *
4
- * This file is type-checked by `tsc` (it is under `src`), not executed by
5
- * vitest. A regression here fails `pnpm build`.
6
- */
7
- export {};
@@ -1,57 +0,0 @@
1
- "use strict";
2
- /**
3
- * Compile-time type checks for the preview providers.
4
- *
5
- * This file is type-checked by `tsc` (it is under `src`), not executed by
6
- * vitest. A regression here fails `pnpm build`.
7
- */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const AgoraPoolClient_js_1 = require("../../AgoraPoolClient.js");
10
- const index_js_1 = require("../../core/domain/index.js");
11
- const Agent_js_1 = require("../Agent.js");
12
- const index_js_2 = require("../preview/index.js");
13
- const CLIENT = new AgoraPoolClient_js_1.AgoraClient({
14
- area: index_js_1.Area.US,
15
- appId: "test-app-id",
16
- appCertificate: "test-app-certificate-01234567890",
17
- });
18
- // ============================================
19
- // ✅ VALID CONFIGURATIONS
20
- // ============================================
21
- function _validTranscribeStt() {
22
- return new Agent_js_1.Agent({ client: CLIENT }).withStt(new index_js_2.GeminiSTT({
23
- apiKey: "test",
24
- model: "gemini-3.5-transcribe-live",
25
- languageCodes: ["en-US"],
26
- customVocabulary: ["Agora"],
27
- sampleRate: 16000,
28
- wordTimestamp: false,
29
- }));
30
- }
31
- /** The preview ASR variant is part of `SttConfig`, so hand-written configs type-check too. */
32
- const _handWrittenAsr = {
33
- vendor: "gemini",
34
- language: "en-US",
35
- params: {
36
- api_key: "test",
37
- model: "gemini-3.5-transcribe-live",
38
- sample_rate: 16000,
39
- language_codes: ["en-US"],
40
- custom_vocabulary: ["Agora"],
41
- word_timestamp: false,
42
- },
43
- };
44
- // ============================================
45
- // ❌ INVALID CONFIGURATIONS
46
- // ============================================
47
- /** The API key is required — it is the only credential these providers accept. */
48
- function _transcribeRequiresApiKey() {
49
- // @ts-expect-error - apiKey is required
50
- return new index_js_2.GeminiSTT({ languageCodes: ["en-US"] });
51
- }
52
- /** ASR params must carry a model; the preview gateway rejects a bare vendor. */
53
- // @ts-expect-error - params.model is required
54
- const _asrRequiresModel = {
55
- vendor: "gemini",
56
- params: { api_key: "test" },
57
- };
@@ -1 +0,0 @@
1
- export {};