agora-agents 2.1.1 → 2.3.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 (188) hide show
  1. package/README.md +49 -27
  2. package/dist/cjs/AgoraPoolClient.d.ts +9 -6
  3. package/dist/cjs/AgoraPoolClient.js +1 -0
  4. package/dist/cjs/BaseClient.js +2 -2
  5. package/dist/cjs/agentkit/Agent.d.ts +52 -51
  6. package/dist/cjs/agentkit/Agent.js +51 -51
  7. package/dist/cjs/agentkit/AgentSession.d.ts +11 -9
  8. package/dist/cjs/agentkit/AgentSession.js +10 -5
  9. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +1 -0
  10. package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +57 -0
  11. package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +1 -0
  12. package/dist/cjs/agentkit/__tests__/readme-examples.test.js +126 -0
  13. package/dist/cjs/agentkit/__tests__/type-safety.test.js +24 -17
  14. package/dist/cjs/agentkit/area.d.ts +4 -0
  15. package/dist/cjs/agentkit/area.js +2 -0
  16. package/dist/cjs/agentkit/avatar-types.d.ts +28 -2
  17. package/dist/cjs/agentkit/avatar-types.js +24 -2
  18. package/dist/cjs/agentkit/index.d.ts +8 -5
  19. package/dist/cjs/agentkit/index.js +27 -2
  20. package/dist/cjs/agentkit/presets.js +11 -4
  21. package/dist/cjs/agentkit/region-vendors.d.ts +15 -0
  22. package/dist/cjs/agentkit/region-vendors.js +2 -0
  23. package/dist/cjs/agentkit/token.d.ts +3 -2
  24. package/dist/cjs/agentkit/token.js +3 -2
  25. package/dist/cjs/agentkit/types.d.ts +29 -6
  26. package/dist/cjs/agentkit/vendors/avatar.d.ts +9 -4
  27. package/dist/cjs/agentkit/vendors/avatar.js +6 -3
  28. package/dist/cjs/agentkit/vendors/base.d.ts +38 -5
  29. package/dist/cjs/agentkit/vendors/base.js +60 -6
  30. package/dist/cjs/agentkit/vendors/cn.d.ts +251 -0
  31. package/dist/cjs/agentkit/vendors/cn.js +293 -0
  32. package/dist/cjs/agentkit/vendors/llm.d.ts +4 -2
  33. package/dist/cjs/agentkit/vendors/llm.js +10 -5
  34. package/dist/cjs/agentkit/vendors/mllm.d.ts +8 -4
  35. package/dist/cjs/agentkit/vendors/mllm.js +8 -4
  36. package/dist/cjs/agentkit/vendors/stt.d.ts +4 -6
  37. package/dist/cjs/agentkit/vendors/stt.js +48 -62
  38. package/dist/cjs/agentkit/vendors/tts.d.ts +3 -3
  39. package/dist/cjs/agentkit/vendors/tts.js +1 -1
  40. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +5 -2
  41. package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +4 -0
  42. package/dist/cjs/api/types/Asr.d.ts +16 -1
  43. package/dist/cjs/api/types/BytedanceDuplexTts.d.ts +9 -0
  44. package/dist/cjs/api/types/BytedanceDuplexTts.js +3 -0
  45. package/dist/cjs/api/types/BytedanceDuplexTtsParams.d.ts +13 -0
  46. package/dist/cjs/api/types/BytedanceDuplexTtsParams.js +3 -0
  47. package/dist/cjs/api/types/BytedanceTts.d.ts +9 -0
  48. package/dist/cjs/api/types/BytedanceTts.js +3 -0
  49. package/dist/cjs/api/types/BytedanceTtsParams.d.ts +23 -0
  50. package/dist/cjs/api/types/BytedanceTtsParams.js +3 -0
  51. package/dist/cjs/api/types/CosyvoiceTts.d.ts +9 -0
  52. package/dist/cjs/api/types/CosyvoiceTts.js +3 -0
  53. package/dist/cjs/api/types/CosyvoiceTtsParams.d.ts +15 -0
  54. package/dist/cjs/api/types/CosyvoiceTtsParams.js +3 -0
  55. package/dist/cjs/api/types/DeepgramAsr.d.ts +0 -2
  56. package/dist/cjs/api/types/DeepgramAsrParams.d.ts +1 -1
  57. package/dist/cjs/api/types/FengmingAsr.d.ts +11 -0
  58. package/dist/cjs/api/types/FengmingAsr.js +3 -0
  59. package/dist/cjs/api/types/MinimaxTtsParams.d.ts +52 -3
  60. package/dist/cjs/api/types/SensetimeAvatarParams.d.ts +48 -0
  61. package/dist/cjs/api/types/SensetimeAvatarParams.js +3 -0
  62. package/dist/cjs/api/types/StepfunTts.d.ts +9 -0
  63. package/dist/cjs/api/types/StepfunTts.js +3 -0
  64. package/dist/cjs/api/types/StepfunTtsParams.d.ts +13 -0
  65. package/dist/cjs/api/types/StepfunTtsParams.js +3 -0
  66. package/dist/cjs/api/types/TencentAsr.d.ts +10 -0
  67. package/dist/cjs/api/types/TencentAsr.js +3 -0
  68. package/dist/cjs/api/types/TencentAsrParams.d.ts +17 -0
  69. package/dist/cjs/api/types/TencentAsrParams.js +3 -0
  70. package/dist/cjs/api/types/TencentTts.d.ts +9 -0
  71. package/dist/cjs/api/types/TencentTts.js +3 -0
  72. package/dist/cjs/api/types/TencentTtsParams.d.ts +23 -0
  73. package/dist/cjs/api/types/TencentTtsParams.js +3 -0
  74. package/dist/cjs/api/types/Tts.d.ts +16 -1
  75. package/dist/cjs/api/types/XfyunAsr.d.ts +10 -0
  76. package/dist/cjs/api/types/XfyunAsr.js +3 -0
  77. package/dist/cjs/api/types/XfyunAsrParams.d.ts +15 -0
  78. package/dist/cjs/api/types/XfyunAsrParams.js +3 -0
  79. package/dist/cjs/api/types/XfyunBigmodelAsr.d.ts +10 -0
  80. package/dist/cjs/api/types/XfyunBigmodelAsr.js +3 -0
  81. package/dist/cjs/api/types/XfyunBigmodelAsrParams.d.ts +17 -0
  82. package/dist/cjs/api/types/XfyunBigmodelAsrParams.js +3 -0
  83. package/dist/cjs/api/types/XfyunDialectAsr.d.ts +10 -0
  84. package/dist/cjs/api/types/XfyunDialectAsr.js +3 -0
  85. package/dist/cjs/api/types/XfyunDialectAsrParams.d.ts +15 -0
  86. package/dist/cjs/api/types/XfyunDialectAsrParams.js +3 -0
  87. package/dist/cjs/api/types/index.d.ts +20 -0
  88. package/dist/cjs/api/types/index.js +20 -0
  89. package/dist/cjs/core/domain/index.d.ts +2 -1
  90. package/dist/cjs/core/domain/index.js +5 -3
  91. package/dist/cjs/index.d.ts +3 -2
  92. package/dist/cjs/index.js +26 -2
  93. package/dist/cjs/version.d.ts +1 -1
  94. package/dist/cjs/version.js +1 -1
  95. package/dist/esm/AgoraPoolClient.d.mts +9 -6
  96. package/dist/esm/AgoraPoolClient.mjs +1 -0
  97. package/dist/esm/BaseClient.mjs +2 -2
  98. package/dist/esm/agentkit/Agent.d.mts +52 -51
  99. package/dist/esm/agentkit/Agent.mjs +51 -51
  100. package/dist/esm/agentkit/AgentSession.d.mts +11 -9
  101. package/dist/esm/agentkit/AgentSession.mjs +11 -6
  102. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +1 -0
  103. package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +55 -0
  104. package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +1 -0
  105. package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +124 -0
  106. package/dist/esm/agentkit/__tests__/type-safety.test.mjs +24 -17
  107. package/dist/esm/agentkit/area.d.mts +4 -0
  108. package/dist/esm/agentkit/area.mjs +1 -0
  109. package/dist/esm/agentkit/avatar-types.d.mts +28 -2
  110. package/dist/esm/agentkit/avatar-types.mjs +23 -2
  111. package/dist/esm/agentkit/index.d.mts +8 -5
  112. package/dist/esm/agentkit/index.mjs +3 -2
  113. package/dist/esm/agentkit/presets.mjs +11 -4
  114. package/dist/esm/agentkit/region-vendors.d.mts +15 -0
  115. package/dist/esm/agentkit/region-vendors.mjs +1 -0
  116. package/dist/esm/agentkit/token.d.mts +3 -2
  117. package/dist/esm/agentkit/token.mjs +3 -2
  118. package/dist/esm/agentkit/types.d.mts +29 -6
  119. package/dist/esm/agentkit/vendors/avatar.d.mts +9 -4
  120. package/dist/esm/agentkit/vendors/avatar.mjs +6 -3
  121. package/dist/esm/agentkit/vendors/base.d.mts +38 -5
  122. package/dist/esm/agentkit/vendors/base.mjs +55 -5
  123. package/dist/esm/agentkit/vendors/cn.d.mts +251 -0
  124. package/dist/esm/agentkit/vendors/cn.mjs +272 -0
  125. package/dist/esm/agentkit/vendors/llm.d.mts +4 -2
  126. package/dist/esm/agentkit/vendors/llm.mjs +10 -5
  127. package/dist/esm/agentkit/vendors/mllm.d.mts +8 -4
  128. package/dist/esm/agentkit/vendors/mllm.mjs +8 -4
  129. package/dist/esm/agentkit/vendors/stt.d.mts +4 -6
  130. package/dist/esm/agentkit/vendors/stt.mjs +48 -62
  131. package/dist/esm/agentkit/vendors/tts.d.mts +3 -3
  132. package/dist/esm/agentkit/vendors/tts.mjs +1 -1
  133. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +5 -2
  134. package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +4 -0
  135. package/dist/esm/api/types/Asr.d.mts +16 -1
  136. package/dist/esm/api/types/BytedanceDuplexTts.d.mts +9 -0
  137. package/dist/esm/api/types/BytedanceDuplexTts.mjs +2 -0
  138. package/dist/esm/api/types/BytedanceDuplexTtsParams.d.mts +13 -0
  139. package/dist/esm/api/types/BytedanceDuplexTtsParams.mjs +2 -0
  140. package/dist/esm/api/types/BytedanceTts.d.mts +9 -0
  141. package/dist/esm/api/types/BytedanceTts.mjs +2 -0
  142. package/dist/esm/api/types/BytedanceTtsParams.d.mts +23 -0
  143. package/dist/esm/api/types/BytedanceTtsParams.mjs +2 -0
  144. package/dist/esm/api/types/CosyvoiceTts.d.mts +9 -0
  145. package/dist/esm/api/types/CosyvoiceTts.mjs +2 -0
  146. package/dist/esm/api/types/CosyvoiceTtsParams.d.mts +15 -0
  147. package/dist/esm/api/types/CosyvoiceTtsParams.mjs +2 -0
  148. package/dist/esm/api/types/DeepgramAsr.d.mts +0 -2
  149. package/dist/esm/api/types/DeepgramAsrParams.d.mts +1 -1
  150. package/dist/esm/api/types/FengmingAsr.d.mts +11 -0
  151. package/dist/esm/api/types/FengmingAsr.mjs +2 -0
  152. package/dist/esm/api/types/MinimaxTtsParams.d.mts +52 -3
  153. package/dist/esm/api/types/SensetimeAvatarParams.d.mts +48 -0
  154. package/dist/esm/api/types/SensetimeAvatarParams.mjs +2 -0
  155. package/dist/esm/api/types/StepfunTts.d.mts +9 -0
  156. package/dist/esm/api/types/StepfunTts.mjs +2 -0
  157. package/dist/esm/api/types/StepfunTtsParams.d.mts +13 -0
  158. package/dist/esm/api/types/StepfunTtsParams.mjs +2 -0
  159. package/dist/esm/api/types/TencentAsr.d.mts +10 -0
  160. package/dist/esm/api/types/TencentAsr.mjs +2 -0
  161. package/dist/esm/api/types/TencentAsrParams.d.mts +17 -0
  162. package/dist/esm/api/types/TencentAsrParams.mjs +2 -0
  163. package/dist/esm/api/types/TencentTts.d.mts +9 -0
  164. package/dist/esm/api/types/TencentTts.mjs +2 -0
  165. package/dist/esm/api/types/TencentTtsParams.d.mts +23 -0
  166. package/dist/esm/api/types/TencentTtsParams.mjs +2 -0
  167. package/dist/esm/api/types/Tts.d.mts +16 -1
  168. package/dist/esm/api/types/XfyunAsr.d.mts +10 -0
  169. package/dist/esm/api/types/XfyunAsr.mjs +2 -0
  170. package/dist/esm/api/types/XfyunAsrParams.d.mts +15 -0
  171. package/dist/esm/api/types/XfyunAsrParams.mjs +2 -0
  172. package/dist/esm/api/types/XfyunBigmodelAsr.d.mts +10 -0
  173. package/dist/esm/api/types/XfyunBigmodelAsr.mjs +2 -0
  174. package/dist/esm/api/types/XfyunBigmodelAsrParams.d.mts +17 -0
  175. package/dist/esm/api/types/XfyunBigmodelAsrParams.mjs +2 -0
  176. package/dist/esm/api/types/XfyunDialectAsr.d.mts +10 -0
  177. package/dist/esm/api/types/XfyunDialectAsr.mjs +2 -0
  178. package/dist/esm/api/types/XfyunDialectAsrParams.d.mts +15 -0
  179. package/dist/esm/api/types/XfyunDialectAsrParams.mjs +2 -0
  180. package/dist/esm/api/types/index.d.mts +20 -0
  181. package/dist/esm/api/types/index.mjs +20 -0
  182. package/dist/esm/core/domain/index.d.mts +2 -1
  183. package/dist/esm/core/domain/index.mjs +4 -2
  184. package/dist/esm/index.d.mts +3 -2
  185. package/dist/esm/index.mjs +6 -6
  186. package/dist/esm/version.d.mts +1 -1
  187. package/dist/esm/version.mjs +1 -1
  188. package/package.json +1 -1
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SensetimeAvatar = exports.TencentLLM = exports.DeepSeekLLM = exports.BytedanceLLM = exports.AliyunLLM = exports.StepFunTTS = exports.BytedanceDuplexTTS = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.TencentTTS = exports.MicrosoftCNTTS = exports.MiniMaxCNTTS = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.XfyunSTT = exports.TencentSTT = exports.MicrosoftCNSTT = exports.FengmingSTT = void 0;
4
+ const base_js_1 = require("./base.js");
5
+ function requireString(value, field, vendor) {
6
+ if (typeof value !== "string" || value.length === 0) {
7
+ throw new Error(`${vendor} requires ${field}`);
8
+ }
9
+ }
10
+ class FengmingSTT extends base_js_1.BaseCNSTT {
11
+ toConfig() {
12
+ return {
13
+ vendor: "fengming",
14
+ };
15
+ }
16
+ }
17
+ exports.FengmingSTT = FengmingSTT;
18
+ class MicrosoftCNSTT extends base_js_1.BaseCNSTT {
19
+ constructor(options) {
20
+ super();
21
+ this.options = options;
22
+ requireString(options.key, "key", "MicrosoftCNSTT");
23
+ requireString(options.region, "region", "MicrosoftCNSTT");
24
+ requireString(options.language, "language", "MicrosoftCNSTT");
25
+ }
26
+ toConfig() {
27
+ const { key, region, language, phraseList, additionalParams } = this.options;
28
+ return {
29
+ vendor: "microsoft",
30
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { key,
31
+ region,
32
+ language }), (phraseList && { phrase_list: phraseList })),
33
+ };
34
+ }
35
+ }
36
+ exports.MicrosoftCNSTT = MicrosoftCNSTT;
37
+ class TencentSTT extends base_js_1.BaseCNSTT {
38
+ constructor(options) {
39
+ super();
40
+ this.options = options;
41
+ requireString(options.key, "key", "TencentSTT");
42
+ requireString(options.appId, "appId", "TencentSTT");
43
+ requireString(options.secret, "secret", "TencentSTT");
44
+ requireString(options.engineModelType, "engineModelType", "TencentSTT");
45
+ requireString(options.voiceId, "voiceId", "TencentSTT");
46
+ }
47
+ toConfig() {
48
+ const { language, key, appId, secret, engineModelType, voiceId, additionalParams } = this.options;
49
+ return {
50
+ vendor: "tencent",
51
+ params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (key && { key })), (appId && { app_id: appId })), (secret && { secret })), (engineModelType && { engine_model_type: engineModelType })), (voiceId && { voice_id: voiceId })), (language && { language })),
52
+ };
53
+ }
54
+ }
55
+ exports.TencentSTT = TencentSTT;
56
+ class XfyunSTT extends base_js_1.BaseCNSTT {
57
+ constructor(options) {
58
+ super();
59
+ this.options = options;
60
+ requireString(options.apiKey, "apiKey", "XfyunSTT");
61
+ requireString(options.appId, "appId", "XfyunSTT");
62
+ requireString(options.apiSecret, "apiSecret", "XfyunSTT");
63
+ requireString(options.language, "language", "XfyunSTT");
64
+ }
65
+ toConfig() {
66
+ const { apiKey, appId, apiSecret, language, additionalParams } = this.options;
67
+ return {
68
+ vendor: "xfyun",
69
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, app_id: appId, api_secret: apiSecret }), (language && { language })),
70
+ };
71
+ }
72
+ }
73
+ exports.XfyunSTT = XfyunSTT;
74
+ class XfyunBigModelSTT extends base_js_1.BaseCNSTT {
75
+ constructor(options) {
76
+ super();
77
+ this.options = options;
78
+ requireString(options.apiKey, "apiKey", "XfyunBigModelSTT");
79
+ requireString(options.appId, "appId", "XfyunBigModelSTT");
80
+ requireString(options.apiSecret, "apiSecret", "XfyunBigModelSTT");
81
+ requireString(options.languageName, "languageName", "XfyunBigModelSTT");
82
+ requireString(options.language, "language", "XfyunBigModelSTT");
83
+ }
84
+ toConfig() {
85
+ const { apiKey, appId, apiSecret, languageName, language, additionalParams } = this.options;
86
+ return {
87
+ vendor: "xfyun_bigmodel",
88
+ params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, app_id: appId, api_secret: apiSecret }), (languageName && { language_name: languageName })), (language && { language })),
89
+ };
90
+ }
91
+ }
92
+ exports.XfyunBigModelSTT = XfyunBigModelSTT;
93
+ class XfyunDialectSTT extends base_js_1.BaseCNSTT {
94
+ constructor(options) {
95
+ super();
96
+ this.options = options;
97
+ requireString(options.appId, "appId", "XfyunDialectSTT");
98
+ requireString(options.accessKeyId, "accessKeyId", "XfyunDialectSTT");
99
+ requireString(options.accessKeySecret, "accessKeySecret", "XfyunDialectSTT");
100
+ requireString(options.language, "language", "XfyunDialectSTT");
101
+ }
102
+ toConfig() {
103
+ const { appId, accessKeyId, accessKeySecret, language, additionalParams } = this.options;
104
+ return {
105
+ vendor: "xfyun_dialect",
106
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { app_id: appId, access_key_id: accessKeyId, access_key_secret: accessKeySecret }), (language && { language })),
107
+ };
108
+ }
109
+ }
110
+ exports.XfyunDialectSTT = XfyunDialectSTT;
111
+ class MiniMaxCNTTS extends base_js_1.BaseCNTTS {
112
+ constructor(options) {
113
+ super();
114
+ this.options = options;
115
+ requireString(options.key, "key", "MiniMaxCNTTS");
116
+ requireString(options.model, "model", "MiniMaxCNTTS");
117
+ if (options.voiceSetting) {
118
+ requireString(options.voiceSetting.voice_id, "voiceSetting.voice_id", "MiniMaxCNTTS");
119
+ }
120
+ else if (!options.timberWeights.length) {
121
+ throw new Error("MiniMaxCNTTS requires at least one timberWeight when voiceSetting is omitted");
122
+ }
123
+ }
124
+ toConfig() {
125
+ const { key, model, voiceSetting, audioSetting, pronunciationDict, timberWeights, languageBoost, skipPatterns, additionalParams, } = this.options;
126
+ return Object.assign({ vendor: "minimax", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (key && { key })), (model && { model })), (voiceSetting && { voice_setting: voiceSetting })), (audioSetting && { audio_setting: audioSetting })), (pronunciationDict && { pronunciation_dict: pronunciationDict })), (timberWeights && { timber_weights: timberWeights })), (languageBoost && { language_boost: languageBoost })) }, (skipPatterns && { skip_patterns: skipPatterns }));
127
+ }
128
+ }
129
+ exports.MiniMaxCNTTS = MiniMaxCNTTS;
130
+ class MicrosoftCNTTS extends base_js_1.BaseCNTTS {
131
+ constructor(options) {
132
+ super();
133
+ this.options = options;
134
+ requireString(options.key, "key", "MicrosoftCNTTS");
135
+ requireString(options.region, "region", "MicrosoftCNTTS");
136
+ requireString(options.voiceName, "voiceName", "MicrosoftCNTTS");
137
+ }
138
+ toConfig() {
139
+ const { key, region, voiceName, sampleRate, speed, volume, skipPatterns, additionalParams } = this.options;
140
+ return Object.assign({ vendor: "microsoft", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { key,
141
+ region, voice_name: voiceName }), (sampleRate !== undefined && { sample_rate: sampleRate })), (speed !== undefined && { speed })), (volume !== undefined && { volume })) }, (skipPatterns && { skip_patterns: skipPatterns }));
142
+ }
143
+ }
144
+ exports.MicrosoftCNTTS = MicrosoftCNTTS;
145
+ class TencentTTS extends base_js_1.BaseCNTTS {
146
+ constructor(options) {
147
+ super();
148
+ this.options = options;
149
+ requireString(options.appId, "appId", "TencentTTS");
150
+ requireString(options.secretId, "secretId", "TencentTTS");
151
+ requireString(options.secretKey, "secretKey", "TencentTTS");
152
+ if (typeof options.voiceType !== "number" || Number.isNaN(options.voiceType)) {
153
+ throw new Error("TencentTTS requires voiceType");
154
+ }
155
+ }
156
+ toConfig() {
157
+ const { appId, secretId, secretKey, voiceType, volume, speed, emotionCategory, emotionIntensity, skipPatterns, additionalParams, } = this.options;
158
+ return Object.assign({ vendor: "tencent", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { app_id: appId, secret_id: secretId, secret_key: secretKey }), (voiceType !== undefined && { voice_type: voiceType })), (volume !== undefined && { volume })), (speed !== undefined && { speed })), (emotionCategory && { emotion_category: emotionCategory })), (emotionIntensity !== undefined && { emotion_intensity: emotionIntensity })) }, (skipPatterns && { skip_patterns: skipPatterns }));
159
+ }
160
+ }
161
+ exports.TencentTTS = TencentTTS;
162
+ class BytedanceTTS extends base_js_1.BaseCNTTS {
163
+ constructor(options) {
164
+ super();
165
+ this.options = options;
166
+ requireString(options.token, "token", "BytedanceTTS");
167
+ requireString(options.appId, "appId", "BytedanceTTS");
168
+ requireString(options.cluster, "cluster", "BytedanceTTS");
169
+ requireString(options.voiceType, "voiceType", "BytedanceTTS");
170
+ }
171
+ toConfig() {
172
+ const { token, appId, cluster, voiceType, speedRatio, volumeRatio, pitchRatio, emotion, skipPatterns, additionalParams, } = this.options;
173
+ return Object.assign({ vendor: "bytedance", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { token, app_id: appId }), (cluster && { cluster })), (voiceType && { voice_type: voiceType })), (speedRatio !== undefined && { speed_ratio: speedRatio })), (volumeRatio !== undefined && { volume_ratio: volumeRatio })), (pitchRatio !== undefined && { pitch_ratio: pitchRatio })), (emotion && { emotion })) }, (skipPatterns && { skip_patterns: skipPatterns }));
174
+ }
175
+ }
176
+ exports.BytedanceTTS = BytedanceTTS;
177
+ class CosyVoiceTTS extends base_js_1.BaseCNTTS {
178
+ constructor(options) {
179
+ super();
180
+ this.options = options;
181
+ requireString(options.apiKey, "apiKey", "CosyVoiceTTS");
182
+ requireString(options.model, "model", "CosyVoiceTTS");
183
+ if (typeof options.sampleRate !== "number" || Number.isNaN(options.sampleRate)) {
184
+ throw new Error("CosyVoiceTTS requires sampleRate");
185
+ }
186
+ requireString(options.voice, "voice", "CosyVoiceTTS");
187
+ }
188
+ toConfig() {
189
+ const { apiKey, model, sampleRate, voice, skipPatterns, additionalParams } = this.options;
190
+ return Object.assign({ vendor: "cosyvoice", params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (model && { model })), (sampleRate !== undefined && { sample_rate: sampleRate })), (voice && { voice })) }, (skipPatterns && { skip_patterns: skipPatterns }));
191
+ }
192
+ }
193
+ exports.CosyVoiceTTS = CosyVoiceTTS;
194
+ class BytedanceDuplexTTS extends base_js_1.BaseCNTTS {
195
+ constructor(options) {
196
+ super();
197
+ this.options = options;
198
+ requireString(options.appId, "appId", "BytedanceDuplexTTS");
199
+ requireString(options.token, "token", "BytedanceDuplexTTS");
200
+ requireString(options.speaker, "speaker", "BytedanceDuplexTTS");
201
+ }
202
+ toConfig() {
203
+ const { appId, token, speaker, skipPatterns, additionalParams } = this.options;
204
+ return Object.assign({ vendor: "bytedance_duplex", params: Object.assign(Object.assign({}, additionalParams), { app_id: appId, token,
205
+ speaker }) }, (skipPatterns && { skip_patterns: skipPatterns }));
206
+ }
207
+ }
208
+ exports.BytedanceDuplexTTS = BytedanceDuplexTTS;
209
+ class StepFunTTS extends base_js_1.BaseCNTTS {
210
+ constructor(options) {
211
+ super();
212
+ this.options = options;
213
+ requireString(options.apiKey, "apiKey", "StepFunTTS");
214
+ requireString(options.model, "model", "StepFunTTS");
215
+ requireString(options.voiceId, "voiceId", "StepFunTTS");
216
+ }
217
+ toConfig() {
218
+ const { apiKey, model, voiceId, skipPatterns, additionalParams } = this.options;
219
+ return Object.assign({ vendor: "stepfun", params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (model && { model })), (voiceId && { voice_id: voiceId })) }, (skipPatterns && { skip_patterns: skipPatterns }));
220
+ }
221
+ }
222
+ exports.StepFunTTS = StepFunTTS;
223
+ function cnLlmConfig(options, vendor) {
224
+ var _a;
225
+ return Object.assign(Object.assign({ url: options.url }, (options.apiKey && { api_key: options.apiKey })), { params: Object.assign({ model: options.model }, options.params), headers: options.headers, max_history: options.maxHistory, system_messages: options.systemMessages, greeting_message: options.greetingMessage, failure_message: options.failureMessage, input_modalities: (_a = options.inputModalities) !== null && _a !== void 0 ? _a : ["text"], output_modalities: options.outputModalities, style: "openai", vendor, greeting_configs: options.greetingConfigs, template_variables: options.templateVariables, mcp_servers: options.mcpServers });
226
+ }
227
+ class AliyunLLM extends base_js_1.BaseCNLLM {
228
+ constructor(options) {
229
+ super(options);
230
+ this.options = options;
231
+ requireString(options.url, "url", "AliyunLLM");
232
+ requireString(options.model, "model", "AliyunLLM");
233
+ }
234
+ toConfig() {
235
+ return cnLlmConfig(this.options, "aliyun");
236
+ }
237
+ }
238
+ exports.AliyunLLM = AliyunLLM;
239
+ class BytedanceLLM extends base_js_1.BaseCNLLM {
240
+ constructor(options) {
241
+ super(options);
242
+ this.options = options;
243
+ requireString(options.url, "url", "BytedanceLLM");
244
+ requireString(options.model, "model", "BytedanceLLM");
245
+ }
246
+ toConfig() {
247
+ return cnLlmConfig(this.options, "bytedance");
248
+ }
249
+ }
250
+ exports.BytedanceLLM = BytedanceLLM;
251
+ class DeepSeekLLM extends base_js_1.BaseCNLLM {
252
+ constructor(options) {
253
+ super(options);
254
+ this.options = options;
255
+ requireString(options.url, "url", "DeepSeekLLM");
256
+ requireString(options.model, "model", "DeepSeekLLM");
257
+ }
258
+ toConfig() {
259
+ return cnLlmConfig(this.options, "deepseek");
260
+ }
261
+ }
262
+ exports.DeepSeekLLM = DeepSeekLLM;
263
+ class TencentLLM extends base_js_1.BaseCNLLM {
264
+ constructor(options) {
265
+ super(options);
266
+ this.options = options;
267
+ requireString(options.url, "url", "TencentLLM");
268
+ requireString(options.model, "model", "TencentLLM");
269
+ }
270
+ toConfig() {
271
+ return cnLlmConfig(this.options, "tencent");
272
+ }
273
+ }
274
+ exports.TencentLLM = TencentLLM;
275
+ class SensetimeAvatar extends base_js_1.BaseCNAvatar {
276
+ constructor(options) {
277
+ super();
278
+ this.options = options;
279
+ this.requiredSampleRate = 0;
280
+ requireString(options.agoraUid, "agoraUid", "SensetimeAvatar");
281
+ requireString(options.appId, "appId", "SensetimeAvatar");
282
+ requireString(options.appKey, "appKey", "SensetimeAvatar");
283
+ }
284
+ toConfig() {
285
+ const { agoraUid, agoraToken, appId, appKey, sceneList, enable = true, additionalParams } = this.options;
286
+ return {
287
+ enable,
288
+ vendor: "sensetime",
289
+ params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { agora_uid: agoraUid }), (agoraToken && { agora_token: agoraToken })), { appId, app_key: appKey, sceneList }),
290
+ };
291
+ }
292
+ }
293
+ exports.SensetimeAvatar = SensetimeAvatar;
@@ -69,8 +69,10 @@ export interface AzureOpenAIOptions extends BaseLlmOptions {
69
69
  apiKey: string;
70
70
  /** Model/deployment name */
71
71
  model: string;
72
- /** Azure resource name (e.g., 'my-resource') */
73
- resourceName: string;
72
+ /** Azure resource name (e.g., 'my-resource'). Required when endpoint is not set. */
73
+ resourceName?: string;
74
+ /** Full Azure base URL (e.g., for sovereign clouds or private endpoints). Takes precedence over resourceName. */
75
+ endpoint?: string;
74
76
  /** Deployment name in Azure */
75
77
  deploymentName: string;
76
78
  /** Azure API version (defaults to '2024-08-01-preview') */
@@ -82,15 +82,19 @@ class AzureOpenAI extends base_js_1.BaseLLM {
82
82
  super(options);
83
83
  requireString(options.apiKey, "apiKey", "AzureOpenAI");
84
84
  requireString(options.model, "model", "AzureOpenAI");
85
- requireString(options.resourceName, "resourceName", "AzureOpenAI");
85
+ if (!options.resourceName && !options.endpoint) {
86
+ throw new Error("AzureOpenAI requires either resourceName or endpoint");
87
+ }
86
88
  requireString(options.deploymentName, "deploymentName", "AzureOpenAI");
87
89
  this.options = options;
88
90
  }
89
91
  toConfig() {
90
92
  var _a;
91
- const { apiKey, model, resourceName, deploymentName, apiVersion = "2024-08-01-preview", maxHistory, temperature, topP, maxTokens, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
93
+ const { apiKey, model, resourceName, endpoint, deploymentName, apiVersion = "2024-08-01-preview", maxHistory, temperature, topP, maxTokens, systemMessages, greetingMessage, failureMessage, inputModalities, params, headers, } = this.options;
94
+ const rawBase = endpoint !== null && endpoint !== void 0 ? endpoint : `https://${resourceName}.openai.azure.com`;
95
+ const baseUrl = rawBase.replace(/\/$/, "");
92
96
  return {
93
- url: `https://${resourceName}.openai.azure.com/openai/deployments/${deploymentName}/chat/completions?api-version=${apiVersion}`,
97
+ url: `${baseUrl}/openai/deployments/${deploymentName}/chat/completions?api-version=${apiVersion}`,
94
98
  api_key: apiKey,
95
99
  // "azure" is required by Agora for Azure OpenAI; user-supplied vendor overrides if needed.
96
100
  vendor: (_a = this.vendor) !== null && _a !== void 0 ? _a : "azure",
@@ -257,10 +261,11 @@ class VertexAILLM extends base_js_1.BaseLLM {
257
261
  toConfig() {
258
262
  var _a, _b;
259
263
  const o = this.options;
264
+ const defaultUrl = `https://${o.location}-aiplatform.googleapis.com/v1/projects/${o.projectId}/locations/${o.location}/publishers/google/models/${o.model}:streamGenerateContent?alt=sse`;
260
265
  return {
261
- url: (_a = o.url) !== null && _a !== void 0 ? _a : "https://aiplatform.googleapis.com/v1/projects",
266
+ url: (_a = o.url) !== null && _a !== void 0 ? _a : defaultUrl,
262
267
  api_key: o.apiKey,
263
- params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: o.model, project_id: o.projectId, location: o.location }, o.params), (o.temperature !== undefined && { temperature: o.temperature })), (o.topP !== undefined && { top_p: o.topP })), (o.topK !== undefined && { top_k: o.topK })), (o.maxOutputTokens !== undefined && { max_output_tokens: o.maxOutputTokens })),
268
+ params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ model: o.model }, o.params), (o.temperature !== undefined && { temperature: o.temperature })), (o.topP !== undefined && { top_p: o.topP })), (o.topK !== undefined && { top_k: o.topK })), (o.maxOutputTokens !== undefined && { max_output_tokens: o.maxOutputTokens })),
264
269
  headers: o.headers,
265
270
  max_history: o.maxHistory,
266
271
  system_messages: o.systemMessages,
@@ -43,7 +43,8 @@ export interface OpenAIRealtimeOptions {
43
43
  *
44
44
  * @example
45
45
  * ```typescript
46
- * const agent = new Agent({ name: 'realtime-assistant' })
46
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
47
+ * const agent = new Agent({ client })
47
48
  * .withMllm(new OpenAIRealtime({
48
49
  * apiKey: process.env.OPENAI_API_KEY,
49
50
  * greetingMessage: 'Hello! How can I help you?',
@@ -96,7 +97,8 @@ export interface GeminiLiveOptions {
96
97
  *
97
98
  * @example
98
99
  * ```typescript
99
- * const agent = new Agent({ name: 'gemini-assistant' })
100
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
101
+ * const agent = new Agent({ client })
100
102
  * .withMllm(new GeminiLive({
101
103
  * apiKey: process.env.GOOGLE_API_KEY,
102
104
  * model: 'gemini-live-2.5-flash',
@@ -152,7 +154,8 @@ export interface VertexAIOptions {
152
154
  *
153
155
  * @example
154
156
  * ```typescript
155
- * const agent = new Agent({ name: 'gemini-assistant' })
157
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
158
+ * const agent = new Agent({ client })
156
159
  * .withMllm(new VertexAI({
157
160
  * model: 'gemini-live-2.5-flash-preview-native-audio-09-2025',
158
161
  * projectId: process.env.GOOGLE_PROJECT_ID,
@@ -206,7 +209,8 @@ export interface XaiGrokOptions {
206
209
  *
207
210
  * @example
208
211
  * ```typescript
209
- * const agent = new Agent({ name: 'grok-assistant' })
212
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
213
+ * const agent = new Agent({ client })
210
214
  * .withMllm(new XaiGrok({
211
215
  * apiKey: process.env.XAI_API_KEY,
212
216
  * voice: 'eve',
@@ -14,7 +14,8 @@ const base_js_1 = require("./base.js");
14
14
  *
15
15
  * @example
16
16
  * ```typescript
17
- * const agent = new Agent({ name: 'realtime-assistant' })
17
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
18
+ * const agent = new Agent({ client })
18
19
  * .withMllm(new OpenAIRealtime({
19
20
  * apiKey: process.env.OPENAI_API_KEY,
20
21
  * greetingMessage: 'Hello! How can I help you?',
@@ -49,7 +50,8 @@ exports.OpenAIRealtime = OpenAIRealtime;
49
50
  *
50
51
  * @example
51
52
  * ```typescript
52
- * const agent = new Agent({ name: 'gemini-assistant' })
53
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
54
+ * const agent = new Agent({ client })
53
55
  * .withMllm(new GeminiLive({
54
56
  * apiKey: process.env.GOOGLE_API_KEY,
55
57
  * model: 'gemini-live-2.5-flash',
@@ -73,7 +75,8 @@ exports.GeminiLive = GeminiLive;
73
75
  *
74
76
  * @example
75
77
  * ```typescript
76
- * const agent = new Agent({ name: 'gemini-assistant' })
78
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
79
+ * const agent = new Agent({ client })
77
80
  * .withMllm(new VertexAI({
78
81
  * model: 'gemini-live-2.5-flash-preview-native-audio-09-2025',
79
82
  * projectId: process.env.GOOGLE_PROJECT_ID,
@@ -104,7 +107,8 @@ exports.VertexAI = VertexAI;
104
107
  *
105
108
  * @example
106
109
  * ```typescript
107
- * const agent = new Agent({ name: 'grok-assistant' })
110
+ * const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
111
+ * const agent = new Agent({ client })
108
112
  * .withMllm(new XaiGrok({
109
113
  * apiKey: process.env.XAI_API_KEY,
110
114
  * voice: 'eve',
@@ -2,7 +2,7 @@
2
2
  * Type-safe STT (Speech-to-Text) vendor classes.
3
3
  */
4
4
  import { type DeepgramPresetModel } from "../presets.js";
5
- import type { SttConfig, TurnDetectionLanguage } from "../types.js";
5
+ import type { SttConfig } from "../types.js";
6
6
  import { BaseSTT } from "./base.js";
7
7
  /**
8
8
  * Constructor options for Speechmatics STT.
@@ -49,6 +49,8 @@ type DeepgramSTTCommonOptions = {
49
49
  smartFormat?: boolean;
50
50
  /** Enable punctuation */
51
51
  punctuation?: boolean;
52
+ /** Boost specialized terms and brands for Deepgram */
53
+ keyterm?: string;
52
54
  /** Additional vendor-specific parameters */
53
55
  additionalParams?: Record<string, unknown>;
54
56
  };
@@ -238,8 +240,6 @@ export declare class AssemblyAISTT extends BaseSTT {
238
240
  * Constructor options for Agora ARES STT.
239
241
  */
240
242
  export interface AresSTTOptions {
241
- /** Language code for ARES ASR */
242
- language?: TurnDetectionLanguage;
243
243
  /** Additional vendor-specific parameters */
244
244
  additionalParams?: Record<string, unknown>;
245
245
  }
@@ -248,9 +248,7 @@ export interface AresSTTOptions {
248
248
  *
249
249
  * @example
250
250
  * ```typescript
251
- * const stt = new AresSTT({
252
- * language: 'en-US',
253
- * });
251
+ * const stt = new AresSTT();
254
252
  * ```
255
253
  */
256
254
  export declare class AresSTT extends BaseSTT {
@@ -6,44 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SarvamSTT = exports.AresSTT = exports.AssemblyAISTT = exports.AmazonSTT = exports.GoogleSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.DeepgramSTT = exports.SpeechmaticsSTT = void 0;
7
7
  const presets_js_1 = require("../presets.js");
8
8
  const base_js_1 = require("./base.js");
9
- const INTERACTION_LANGUAGES = new Set([
10
- "ar-EG",
11
- "ar-JO",
12
- "ar-SA",
13
- "ar-AE",
14
- "bn-IN",
15
- "zh-CN",
16
- "zh-HK",
17
- "zh-TW",
18
- "nl-NL",
19
- "en-IN",
20
- "en-US",
21
- "fil-PH",
22
- "fr-FR",
23
- "de-DE",
24
- "gu-IN",
25
- "he-IL",
26
- "hi-IN",
27
- "id-ID",
28
- "it-IT",
29
- "ja-JP",
30
- "kn-IN",
31
- "ko-KR",
32
- "ms-MY",
33
- "fa-IR",
34
- "pt-PT",
35
- "ru-RU",
36
- "es-ES",
37
- "ta-IN",
38
- "te-IN",
39
- "th-TH",
40
- "tr-TR",
41
- "vi-VN",
42
- ]);
43
- function toTurnDetectionLanguage(language) {
44
- return language !== undefined && INTERACTION_LANGUAGES.has(language)
45
- ? language
46
- : undefined;
9
+ function _requireString(value, field, vendor) {
10
+ if (typeof value !== "string" || value.length === 0) {
11
+ throw new Error(`${vendor} requires ${field}`);
12
+ }
47
13
  }
48
14
  function isDeepgramManagedModel(model) {
49
15
  return model !== undefined && presets_js_1.DeepgramPresetModels.includes(model.trim().toLowerCase());
@@ -66,8 +32,10 @@ class SpeechmaticsSTT extends base_js_1.BaseSTT {
66
32
  }
67
33
  toConfig() {
68
34
  const { apiKey, language, model, uri, additionalParams } = this.options;
69
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
70
- return Object.assign(Object.assign({ vendor: "speechmatics" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (model !== undefined && { model })), (uri !== undefined && { uri })) });
35
+ return {
36
+ vendor: "speechmatics",
37
+ params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (model !== undefined && { model })), (uri !== undefined && { uri })),
38
+ };
71
39
  }
72
40
  }
73
41
  exports.SpeechmaticsSTT = SpeechmaticsSTT;
@@ -92,9 +60,11 @@ class DeepgramSTT extends base_js_1.BaseSTT {
92
60
  this.options = options !== null && options !== void 0 ? options : {};
93
61
  }
94
62
  toConfig() {
95
- const { apiKey, model, language, smartFormat, punctuation, additionalParams } = this.options;
96
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
97
- return Object.assign(Object.assign({ vendor: "deepgram" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey && { key: apiKey })), (model && { model })), (language && { language })), (smartFormat !== undefined && { smart_format: smartFormat })), (punctuation !== undefined && { punctuation })) });
63
+ const { apiKey, model, language, smartFormat, punctuation, keyterm, additionalParams } = this.options;
64
+ return {
65
+ vendor: "deepgram",
66
+ params: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), (apiKey && { key: apiKey })), (model && { model })), (language && { language })), (smartFormat !== undefined && { smart_format: smartFormat })), (punctuation !== undefined && { punctuation })), (keyterm && { keyterm })),
67
+ };
98
68
  }
99
69
  }
100
70
  exports.DeepgramSTT = DeepgramSTT;
@@ -117,9 +87,11 @@ class MicrosoftSTT extends base_js_1.BaseSTT {
117
87
  }
118
88
  toConfig() {
119
89
  const { key, region, language, additionalParams } = this.options;
120
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
121
- return Object.assign(Object.assign({ vendor: "microsoft" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign({}, additionalParams), { key,
122
- region }), (language && { language })) });
90
+ return {
91
+ vendor: "microsoft",
92
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { key,
93
+ region }), (language && { language })),
94
+ };
123
95
  }
124
96
  }
125
97
  exports.MicrosoftSTT = MicrosoftSTT;
@@ -140,9 +112,17 @@ class OpenAISTT extends base_js_1.BaseSTT {
140
112
  }
141
113
  toConfig() {
142
114
  const { apiKey, model, language, prompt, inputAudioTranscription, additionalParams } = this.options;
143
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
144
- const transcription = Object.assign(Object.assign(Object.assign(Object.assign({ model: "whisper-1" }, inputAudioTranscription), (model && { model })), (prompt && { prompt })), (language && { language }));
145
- return Object.assign(Object.assign({ vendor: "openai" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, input_audio_transcription: transcription }) });
115
+ const transcription = Object.assign(Object.assign(Object.assign(Object.assign({ model: "gpt-4o-mini-transcribe" }, inputAudioTranscription), (model && { model })), (prompt && { prompt })), (language && { language }));
116
+ if (!transcription.model)
117
+ throw new Error("OpenAISTT: inputAudioTranscription.model is required");
118
+ if (!transcription.prompt)
119
+ throw new Error("OpenAISTT: inputAudioTranscription.prompt is required");
120
+ if (!transcription.language)
121
+ throw new Error("OpenAISTT: inputAudioTranscription.language is required");
122
+ return {
123
+ vendor: "openai",
124
+ params: Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, input_audio_transcription: transcription }),
125
+ };
146
126
  }
147
127
  }
148
128
  exports.OpenAISTT = OpenAISTT;
@@ -166,8 +146,10 @@ class GoogleSTT extends base_js_1.BaseSTT {
166
146
  }
167
147
  toConfig() {
168
148
  const { projectId, location, adcCredentialsString, language, model, additionalParams } = this.options;
169
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
170
- return Object.assign(Object.assign({ vendor: "google" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { project_id: projectId, location, adc_credentials_string: adcCredentialsString }), (language && { language })), (model && { model })) });
149
+ return {
150
+ vendor: "google",
151
+ params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { project_id: projectId, location, adc_credentials_string: adcCredentialsString }), (language && { language })), (model && { model })),
152
+ };
171
153
  }
172
154
  }
173
155
  exports.GoogleSTT = GoogleSTT;
@@ -191,8 +173,10 @@ class AmazonSTT extends base_js_1.BaseSTT {
191
173
  }
192
174
  toConfig() {
193
175
  const { accessKey, secretKey, region, language, additionalParams } = this.options;
194
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
195
- return Object.assign(Object.assign({ vendor: "amazon" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign({}, additionalParams), { access_key_id: accessKey, secret_access_key: secretKey, region }), (language && { language_code: language })) });
176
+ return {
177
+ vendor: "amazon",
178
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { access_key_id: accessKey, secret_access_key: secretKey, region }), (language && { language_code: language })),
179
+ };
196
180
  }
197
181
  }
198
182
  exports.AmazonSTT = AmazonSTT;
@@ -214,8 +198,10 @@ class AssemblyAISTT extends base_js_1.BaseSTT {
214
198
  }
215
199
  toConfig() {
216
200
  const { apiKey, language, uri, additionalParams } = this.options;
217
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
218
- return Object.assign(Object.assign({ vendor: "assemblyai" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (language && { language })), (uri && { uri })) });
201
+ return {
202
+ vendor: "assemblyai",
203
+ params: Object.assign(Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey }), (language && { language })), (uri && { uri })),
204
+ };
219
205
  }
220
206
  }
221
207
  exports.AssemblyAISTT = AssemblyAISTT;
@@ -224,9 +210,7 @@ exports.AssemblyAISTT = AssemblyAISTT;
224
210
  *
225
211
  * @example
226
212
  * ```typescript
227
- * const stt = new AresSTT({
228
- * language: 'en-US',
229
- * });
213
+ * const stt = new AresSTT();
230
214
  * ```
231
215
  */
232
216
  class AresSTT extends base_js_1.BaseSTT {
@@ -235,8 +219,8 @@ class AresSTT extends base_js_1.BaseSTT {
235
219
  this.options = options;
236
220
  }
237
221
  toConfig() {
238
- const { language, additionalParams } = this.options;
239
- return Object.assign(Object.assign({ vendor: "ares" }, (language && { language })), (additionalParams && Object.keys(additionalParams).length > 0 && { params: additionalParams }));
222
+ const { additionalParams } = this.options;
223
+ return Object.assign({ vendor: "ares" }, (additionalParams && Object.keys(additionalParams).length > 0 && { params: additionalParams }));
240
224
  }
241
225
  }
242
226
  exports.AresSTT = AresSTT;
@@ -258,8 +242,10 @@ class SarvamSTT extends base_js_1.BaseSTT {
258
242
  }
259
243
  toConfig() {
260
244
  const { apiKey, language, model, additionalParams } = this.options;
261
- const turnDetectionLanguage = toTurnDetectionLanguage(language);
262
- return Object.assign(Object.assign({ vendor: "sarvam" }, (turnDetectionLanguage && { language: turnDetectionLanguage })), { params: Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (model !== undefined && { model })) });
245
+ return {
246
+ vendor: "sarvam",
247
+ params: Object.assign(Object.assign(Object.assign({}, additionalParams), { api_key: apiKey, language }), (model !== undefined && { model })),
248
+ };
263
249
  }
264
250
  }
265
251
  exports.SarvamSTT = SarvamSTT;