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.
- package/README.md +49 -27
- package/dist/cjs/AgoraPoolClient.d.ts +9 -6
- package/dist/cjs/AgoraPoolClient.js +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/agentkit/Agent.d.ts +52 -51
- package/dist/cjs/agentkit/Agent.js +51 -51
- package/dist/cjs/agentkit/AgentSession.d.ts +11 -9
- package/dist/cjs/agentkit/AgentSession.js +10 -5
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +57 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +1 -0
- package/dist/cjs/agentkit/__tests__/readme-examples.test.js +126 -0
- package/dist/cjs/agentkit/__tests__/type-safety.test.js +24 -17
- package/dist/cjs/agentkit/area.d.ts +4 -0
- package/dist/cjs/agentkit/area.js +2 -0
- package/dist/cjs/agentkit/avatar-types.d.ts +28 -2
- package/dist/cjs/agentkit/avatar-types.js +24 -2
- package/dist/cjs/agentkit/index.d.ts +8 -5
- package/dist/cjs/agentkit/index.js +27 -2
- package/dist/cjs/agentkit/presets.js +11 -4
- package/dist/cjs/agentkit/region-vendors.d.ts +15 -0
- package/dist/cjs/agentkit/region-vendors.js +2 -0
- package/dist/cjs/agentkit/token.d.ts +3 -2
- package/dist/cjs/agentkit/token.js +3 -2
- package/dist/cjs/agentkit/types.d.ts +29 -6
- package/dist/cjs/agentkit/vendors/avatar.d.ts +9 -4
- package/dist/cjs/agentkit/vendors/avatar.js +6 -3
- package/dist/cjs/agentkit/vendors/base.d.ts +38 -5
- package/dist/cjs/agentkit/vendors/base.js +60 -6
- package/dist/cjs/agentkit/vendors/cn.d.ts +251 -0
- package/dist/cjs/agentkit/vendors/cn.js +293 -0
- package/dist/cjs/agentkit/vendors/llm.d.ts +4 -2
- package/dist/cjs/agentkit/vendors/llm.js +10 -5
- package/dist/cjs/agentkit/vendors/mllm.d.ts +8 -4
- package/dist/cjs/agentkit/vendors/mllm.js +8 -4
- package/dist/cjs/agentkit/vendors/stt.d.ts +4 -6
- package/dist/cjs/agentkit/vendors/stt.js +48 -62
- package/dist/cjs/agentkit/vendors/tts.d.ts +3 -3
- package/dist/cjs/agentkit/vendors/tts.js +1 -1
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +5 -2
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +4 -0
- package/dist/cjs/api/types/Asr.d.ts +16 -1
- package/dist/cjs/api/types/BytedanceDuplexTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceDuplexTts.js +3 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/BytedanceDuplexTtsParams.js +3 -0
- package/dist/cjs/api/types/BytedanceTts.d.ts +9 -0
- package/dist/cjs/api/types/BytedanceTts.js +3 -0
- package/dist/cjs/api/types/BytedanceTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/BytedanceTtsParams.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTts.d.ts +9 -0
- package/dist/cjs/api/types/CosyvoiceTts.js +3 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.d.ts +15 -0
- package/dist/cjs/api/types/CosyvoiceTtsParams.js +3 -0
- package/dist/cjs/api/types/DeepgramAsr.d.ts +0 -2
- package/dist/cjs/api/types/DeepgramAsrParams.d.ts +1 -1
- package/dist/cjs/api/types/FengmingAsr.d.ts +11 -0
- package/dist/cjs/api/types/FengmingAsr.js +3 -0
- package/dist/cjs/api/types/MinimaxTtsParams.d.ts +52 -3
- package/dist/cjs/api/types/SensetimeAvatarParams.d.ts +48 -0
- package/dist/cjs/api/types/SensetimeAvatarParams.js +3 -0
- package/dist/cjs/api/types/StepfunTts.d.ts +9 -0
- package/dist/cjs/api/types/StepfunTts.js +3 -0
- package/dist/cjs/api/types/StepfunTtsParams.d.ts +13 -0
- package/dist/cjs/api/types/StepfunTtsParams.js +3 -0
- package/dist/cjs/api/types/TencentAsr.d.ts +10 -0
- package/dist/cjs/api/types/TencentAsr.js +3 -0
- package/dist/cjs/api/types/TencentAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/TencentAsrParams.js +3 -0
- package/dist/cjs/api/types/TencentTts.d.ts +9 -0
- package/dist/cjs/api/types/TencentTts.js +3 -0
- package/dist/cjs/api/types/TencentTtsParams.d.ts +23 -0
- package/dist/cjs/api/types/TencentTtsParams.js +3 -0
- package/dist/cjs/api/types/Tts.d.ts +16 -1
- package/dist/cjs/api/types/XfyunAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunAsr.js +3 -0
- package/dist/cjs/api/types/XfyunAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunBigmodelAsr.js +3 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.d.ts +17 -0
- package/dist/cjs/api/types/XfyunBigmodelAsrParams.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsr.d.ts +10 -0
- package/dist/cjs/api/types/XfyunDialectAsr.js +3 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.d.ts +15 -0
- package/dist/cjs/api/types/XfyunDialectAsrParams.js +3 -0
- package/dist/cjs/api/types/index.d.ts +20 -0
- package/dist/cjs/api/types/index.js +20 -0
- package/dist/cjs/core/domain/index.d.ts +2 -1
- package/dist/cjs/core/domain/index.js +5 -3
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +26 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/AgoraPoolClient.d.mts +9 -6
- package/dist/esm/AgoraPoolClient.mjs +1 -0
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/agentkit/Agent.d.mts +52 -51
- package/dist/esm/agentkit/Agent.mjs +51 -51
- package/dist/esm/agentkit/AgentSession.d.mts +11 -9
- package/dist/esm/agentkit/AgentSession.mjs +11 -6
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +55 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +1 -0
- package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +124 -0
- package/dist/esm/agentkit/__tests__/type-safety.test.mjs +24 -17
- package/dist/esm/agentkit/area.d.mts +4 -0
- package/dist/esm/agentkit/area.mjs +1 -0
- package/dist/esm/agentkit/avatar-types.d.mts +28 -2
- package/dist/esm/agentkit/avatar-types.mjs +23 -2
- package/dist/esm/agentkit/index.d.mts +8 -5
- package/dist/esm/agentkit/index.mjs +3 -2
- package/dist/esm/agentkit/presets.mjs +11 -4
- package/dist/esm/agentkit/region-vendors.d.mts +15 -0
- package/dist/esm/agentkit/region-vendors.mjs +1 -0
- package/dist/esm/agentkit/token.d.mts +3 -2
- package/dist/esm/agentkit/token.mjs +3 -2
- package/dist/esm/agentkit/types.d.mts +29 -6
- package/dist/esm/agentkit/vendors/avatar.d.mts +9 -4
- package/dist/esm/agentkit/vendors/avatar.mjs +6 -3
- package/dist/esm/agentkit/vendors/base.d.mts +38 -5
- package/dist/esm/agentkit/vendors/base.mjs +55 -5
- package/dist/esm/agentkit/vendors/cn.d.mts +251 -0
- package/dist/esm/agentkit/vendors/cn.mjs +272 -0
- package/dist/esm/agentkit/vendors/llm.d.mts +4 -2
- package/dist/esm/agentkit/vendors/llm.mjs +10 -5
- package/dist/esm/agentkit/vendors/mllm.d.mts +8 -4
- package/dist/esm/agentkit/vendors/mllm.mjs +8 -4
- package/dist/esm/agentkit/vendors/stt.d.mts +4 -6
- package/dist/esm/agentkit/vendors/stt.mjs +48 -62
- package/dist/esm/agentkit/vendors/tts.d.mts +3 -3
- package/dist/esm/agentkit/vendors/tts.mjs +1 -1
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +5 -2
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +4 -0
- package/dist/esm/api/types/Asr.d.mts +16 -1
- package/dist/esm/api/types/BytedanceDuplexTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceDuplexTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.d.mts +13 -0
- package/dist/esm/api/types/BytedanceDuplexTtsParams.mjs +2 -0
- package/dist/esm/api/types/BytedanceTts.d.mts +9 -0
- package/dist/esm/api/types/BytedanceTts.mjs +2 -0
- package/dist/esm/api/types/BytedanceTtsParams.d.mts +23 -0
- package/dist/esm/api/types/BytedanceTtsParams.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTts.d.mts +9 -0
- package/dist/esm/api/types/CosyvoiceTts.mjs +2 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.d.mts +15 -0
- package/dist/esm/api/types/CosyvoiceTtsParams.mjs +2 -0
- package/dist/esm/api/types/DeepgramAsr.d.mts +0 -2
- package/dist/esm/api/types/DeepgramAsrParams.d.mts +1 -1
- package/dist/esm/api/types/FengmingAsr.d.mts +11 -0
- package/dist/esm/api/types/FengmingAsr.mjs +2 -0
- package/dist/esm/api/types/MinimaxTtsParams.d.mts +52 -3
- package/dist/esm/api/types/SensetimeAvatarParams.d.mts +48 -0
- package/dist/esm/api/types/SensetimeAvatarParams.mjs +2 -0
- package/dist/esm/api/types/StepfunTts.d.mts +9 -0
- package/dist/esm/api/types/StepfunTts.mjs +2 -0
- package/dist/esm/api/types/StepfunTtsParams.d.mts +13 -0
- package/dist/esm/api/types/StepfunTtsParams.mjs +2 -0
- package/dist/esm/api/types/TencentAsr.d.mts +10 -0
- package/dist/esm/api/types/TencentAsr.mjs +2 -0
- package/dist/esm/api/types/TencentAsrParams.d.mts +17 -0
- package/dist/esm/api/types/TencentAsrParams.mjs +2 -0
- package/dist/esm/api/types/TencentTts.d.mts +9 -0
- package/dist/esm/api/types/TencentTts.mjs +2 -0
- package/dist/esm/api/types/TencentTtsParams.d.mts +23 -0
- package/dist/esm/api/types/TencentTtsParams.mjs +2 -0
- package/dist/esm/api/types/Tts.d.mts +16 -1
- package/dist/esm/api/types/XfyunAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunBigmodelAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.d.mts +17 -0
- package/dist/esm/api/types/XfyunBigmodelAsrParams.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsr.d.mts +10 -0
- package/dist/esm/api/types/XfyunDialectAsr.mjs +2 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.d.mts +15 -0
- package/dist/esm/api/types/XfyunDialectAsrParams.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +20 -0
- package/dist/esm/api/types/index.mjs +20 -0
- package/dist/esm/core/domain/index.d.mts +2 -1
- package/dist/esm/core/domain/index.mjs +4 -2
- package/dist/esm/index.d.mts +3 -2
- package/dist/esm/index.mjs +6 -6
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
* Agent class - A reusable agent definition.
|
|
4
4
|
*
|
|
5
5
|
* This class represents an agent configuration that can be used to create
|
|
6
|
-
* multiple sessions.
|
|
6
|
+
* multiple sessions. Set the unique agent instance `name` in
|
|
7
|
+
* {@link Agent.createSession}, not on the Agent itself.
|
|
7
8
|
*/
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.Agent = void 0;
|
|
10
11
|
const AgentSession_js_1 = require("./AgentSession.js");
|
|
12
|
+
const constants_js_1 = require("./constants.js");
|
|
11
13
|
const token_js_1 = require("./token.js");
|
|
12
14
|
const DEFAULT_TURN_DETECTION_LANGUAGE = "en-US";
|
|
13
15
|
const INTERACTION_LANGUAGES = new Set([
|
|
@@ -49,7 +51,7 @@ function isTurnDetectionLanguage(value) {
|
|
|
49
51
|
}
|
|
50
52
|
function assertTurnDetectionLanguage(value) {
|
|
51
53
|
if (!isTurnDetectionLanguage(value)) {
|
|
52
|
-
throw new Error(`Invalid
|
|
54
|
+
throw new Error(`Invalid turnDetection.language: ${value}`);
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
@@ -62,15 +64,22 @@ function assertTurnDetectionLanguage(value) {
|
|
|
62
64
|
* import { Agent, OpenAI, MicrosoftTTS, DeepgramSTT } from 'agora-agents';
|
|
63
65
|
*
|
|
64
66
|
* // Use the fluent builder pattern to configure vendors
|
|
65
|
-
* const agent = new Agent({ instructions: 'You are helpful.' })
|
|
67
|
+
* const agent = new Agent({ client, instructions: 'You are helpful.' })
|
|
66
68
|
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
67
69
|
* .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
|
|
68
70
|
* .withStt(new DeepgramSTT({ apiKey: '...', model: 'nova-2' }));
|
|
71
|
+
*
|
|
72
|
+
* const session = agent.createSession({
|
|
73
|
+
* name: `conversation-${Date.now()}`,
|
|
74
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
75
|
+
* agentUid: '1',
|
|
76
|
+
* remoteUids: ['100'],
|
|
77
|
+
* });
|
|
69
78
|
* ```
|
|
70
79
|
*/
|
|
71
80
|
class Agent {
|
|
72
|
-
constructor(options
|
|
73
|
-
this.
|
|
81
|
+
constructor(options) {
|
|
82
|
+
this._client = options.client;
|
|
74
83
|
this._pipelineId = options.pipelineId;
|
|
75
84
|
this._instructions = options.instructions;
|
|
76
85
|
this._greeting = options.greeting;
|
|
@@ -205,7 +214,8 @@ class Agent {
|
|
|
205
214
|
* ```typescript
|
|
206
215
|
* import { HeyGenAvatar, ElevenLabsTTS } from 'agora-agents';
|
|
207
216
|
*
|
|
208
|
-
* const
|
|
217
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
218
|
+
* const agent = new Agent({ client })
|
|
209
219
|
* .withTts(new ElevenLabsTTS({
|
|
210
220
|
* key: '...',
|
|
211
221
|
* modelId: '...',
|
|
@@ -276,14 +286,6 @@ class Agent {
|
|
|
276
286
|
newAgent._greetingConfigs = configs;
|
|
277
287
|
return newAgent;
|
|
278
288
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Returns a new Agent with the specified name.
|
|
281
|
-
*/
|
|
282
|
-
withName(name) {
|
|
283
|
-
const newAgent = this._clone();
|
|
284
|
-
newAgent._name = name;
|
|
285
|
-
return newAgent;
|
|
286
|
-
}
|
|
287
289
|
/**
|
|
288
290
|
* Returns a new Agent with the specified SAL (Selective Attention Locking) configuration.
|
|
289
291
|
*/
|
|
@@ -389,12 +391,6 @@ class Agent {
|
|
|
389
391
|
newAgent._fillerWords = fillerWords;
|
|
390
392
|
return newAgent;
|
|
391
393
|
}
|
|
392
|
-
/**
|
|
393
|
-
* Get the agent name.
|
|
394
|
-
*/
|
|
395
|
-
get name() {
|
|
396
|
-
return this._name;
|
|
397
|
-
}
|
|
398
394
|
/**
|
|
399
395
|
* Get the AI Studio pipeline ID used as this agent's base configuration.
|
|
400
396
|
*/
|
|
@@ -522,7 +518,7 @@ class Agent {
|
|
|
522
518
|
*/
|
|
523
519
|
get config() {
|
|
524
520
|
return {
|
|
525
|
-
|
|
521
|
+
client: this._client,
|
|
526
522
|
pipelineId: this._pipelineId,
|
|
527
523
|
instructions: this._instructions,
|
|
528
524
|
turnDetection: this._turnDetection,
|
|
@@ -548,18 +544,19 @@ class Agent {
|
|
|
548
544
|
/**
|
|
549
545
|
* Creates a new session from this agent configuration.
|
|
550
546
|
*
|
|
551
|
-
* @param client - The Agora client instance (must have appId and appCertificate properties)
|
|
552
547
|
* @param options - Session connection options
|
|
553
548
|
* @returns A new AgentSession instance ready to start
|
|
554
549
|
*
|
|
555
550
|
* @example
|
|
556
551
|
* ```typescript
|
|
557
|
-
* const
|
|
558
|
-
*
|
|
559
|
-
* .
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
552
|
+
* const client = new AgoraClient({ area: Area.US, appId: '...', appCertificate: '...' });
|
|
553
|
+
* const agent = new Agent({ client })
|
|
554
|
+
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
555
|
+
* .withTts(new MiniMaxTTS({ model: 'speech_2_6_turbo', voiceId: 'English_captivating_female1' }));
|
|
556
|
+
*
|
|
557
|
+
* const session = agent.createSession({
|
|
558
|
+
* name: `conversation-${Date.now()}`,
|
|
559
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
563
560
|
* agentUid: '1',
|
|
564
561
|
* remoteUids: ['100'],
|
|
565
562
|
* idleTimeout: 120,
|
|
@@ -568,10 +565,10 @@ class Agent {
|
|
|
568
565
|
* const agentId = await session.start();
|
|
569
566
|
* ```
|
|
570
567
|
*/
|
|
571
|
-
createSession(
|
|
572
|
-
var _a
|
|
573
|
-
const name = (
|
|
574
|
-
return new AgentSession_js_1.AgentSession(Object.assign(Object.assign({ client, agent: this, appId:
|
|
568
|
+
createSession(options) {
|
|
569
|
+
var _a;
|
|
570
|
+
const name = (_a = options.name) !== null && _a !== void 0 ? _a : `agent-${Date.now()}`;
|
|
571
|
+
return new AgentSession_js_1.AgentSession(Object.assign(Object.assign({ client: this._client, agent: this, appId: this._client.appId, appCertificate: this._client.appCertificate }, options), { name }));
|
|
575
572
|
}
|
|
576
573
|
/**
|
|
577
574
|
* Converts the Agent configuration to the Fern request properties format.
|
|
@@ -581,7 +578,7 @@ class Agent {
|
|
|
581
578
|
* and RTM privileges (required for RTM-enabled sessions).
|
|
582
579
|
*/
|
|
583
580
|
toProperties(opts) {
|
|
584
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
585
582
|
// In MLLM mode the backend handles audio end-to-end; LLM, TTS, and ASR
|
|
586
583
|
// are not required.
|
|
587
584
|
const isMllmMode = ((_a = this._mllm) === null || _a === void 0 ? void 0 : _a.enable) === true || this._mllm !== undefined;
|
|
@@ -614,8 +611,13 @@ class Agent {
|
|
|
614
611
|
// When RTM is enabled, data_channel must also be 'rtm' for the client
|
|
615
612
|
// to receive transcripts and state events. Default it automatically so
|
|
616
613
|
// callers only need to set advancedFeatures.enable_rtm: true.
|
|
617
|
-
|
|
618
|
-
|
|
614
|
+
let resolvedParameters = this._parameters;
|
|
615
|
+
if (((_b = this._advancedFeatures) === null || _b === void 0 ? void 0 : _b.enable_rtm) && !(resolvedParameters === null || resolvedParameters === void 0 ? void 0 : resolvedParameters.data_channel)) {
|
|
616
|
+
resolvedParameters = Object.assign(Object.assign({}, resolvedParameters), { data_channel: "rtm" });
|
|
617
|
+
}
|
|
618
|
+
if ((resolvedParameters === null || resolvedParameters === void 0 ? void 0 : resolvedParameters.audio_scenario) === undefined) {
|
|
619
|
+
resolvedParameters = Object.assign(Object.assign({}, resolvedParameters), { audio_scenario: constants_js_1.AudioScenario.Default });
|
|
620
|
+
}
|
|
619
621
|
const base = {
|
|
620
622
|
channel: opts.channel,
|
|
621
623
|
token,
|
|
@@ -649,8 +651,8 @@ class Agent {
|
|
|
649
651
|
}
|
|
650
652
|
return Object.assign(Object.assign({}, base), { mllm: mllmConfig, turn_detection: this._turnDetection });
|
|
651
653
|
}
|
|
652
|
-
const skipCategories = new Set((
|
|
653
|
-
const allowMissingCategories = new Set((
|
|
654
|
+
const skipCategories = new Set((_c = opts.skipVendorValidationCategories) !== null && _c !== void 0 ? _c : []);
|
|
655
|
+
const allowMissingCategories = new Set((_d = opts.allowMissingVendorCategories) !== null && _d !== void 0 ? _d : []);
|
|
654
656
|
if (opts.skipVendorValidation) {
|
|
655
657
|
for (const category of ["asr", "llm", "tts"]) {
|
|
656
658
|
skipCategories.add(category);
|
|
@@ -669,13 +671,15 @@ class Agent {
|
|
|
669
671
|
throw new Error("LLM configuration is required. Use withLlm() to set it.");
|
|
670
672
|
}
|
|
671
673
|
const llmConfig = this._llm
|
|
672
|
-
? Object.assign(Object.assign({}, this._llm), { system_messages: this.
|
|
673
|
-
?
|
|
674
|
-
: this.
|
|
674
|
+
? Object.assign(Object.assign({}, this._llm), { system_messages: this._llm.system_messages !== undefined
|
|
675
|
+
? this._llm.system_messages
|
|
676
|
+
: this._instructions
|
|
677
|
+
? [{ role: "system", content: this._instructions }]
|
|
678
|
+
: undefined, greeting_message: (_e = this._llm.greeting_message) !== null && _e !== void 0 ? _e : this._greeting, greeting_configs: (_f = this._llm.greeting_configs) !== null && _f !== void 0 ? _f : this._greetingConfigs, failure_message: (_g = this._llm.failure_message) !== null && _g !== void 0 ? _g : this._failureMessage, max_history: (_h = this._llm.max_history) !== null && _h !== void 0 ? _h : this._maxHistory }) : undefined;
|
|
679
|
+
const turnDetectionConfig = this._resolveTurnDetectionConfig();
|
|
675
680
|
const asrConfig = this._stt !== undefined || !allowMissingAsr
|
|
676
|
-
? this._resolveAsrConfig()
|
|
681
|
+
? this._resolveAsrConfig(turnDetectionConfig)
|
|
677
682
|
: undefined;
|
|
678
|
-
const turnDetectionConfig = this._resolveTurnDetectionConfig();
|
|
679
683
|
const ttsConfig = this._tts;
|
|
680
684
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, base), { turn_detection: turnDetectionConfig }), (llmConfig && { llm: llmConfig })), (ttsConfig && { tts: ttsConfig })), (asrConfig && { asr: asrConfig }));
|
|
681
685
|
}
|
|
@@ -689,8 +693,7 @@ class Agent {
|
|
|
689
693
|
* If a new private field is added to Agent, it MUST also be added here.
|
|
690
694
|
*/
|
|
691
695
|
_clone() {
|
|
692
|
-
const newAgent = new Agent();
|
|
693
|
-
newAgent._name = this._name;
|
|
696
|
+
const newAgent = new Agent({ client: this._client });
|
|
694
697
|
newAgent._pipelineId = this._pipelineId;
|
|
695
698
|
newAgent._llm = this._llm;
|
|
696
699
|
newAgent._tts = this._tts;
|
|
@@ -713,23 +716,20 @@ class Agent {
|
|
|
713
716
|
newAgent._greetingConfigs = this._greetingConfigs;
|
|
714
717
|
return newAgent;
|
|
715
718
|
}
|
|
716
|
-
_resolveAsrConfig() {
|
|
719
|
+
_resolveAsrConfig(turnDetectionConfig) {
|
|
717
720
|
var _a;
|
|
718
721
|
const asrConfig = Object.assign({}, ((_a = this._stt) !== null && _a !== void 0 ? _a : {}));
|
|
719
722
|
if (this._stt === undefined) {
|
|
720
723
|
asrConfig.vendor = "ares";
|
|
721
724
|
}
|
|
722
|
-
|
|
725
|
+
asrConfig.language = turnDetectionConfig.language;
|
|
723
726
|
return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
|
|
724
727
|
}
|
|
725
728
|
_resolveTurnDetectionConfig() {
|
|
726
|
-
var _a
|
|
729
|
+
var _a;
|
|
727
730
|
const turnDetection = Object.assign({}, ((_a = this._turnDetection) !== null && _a !== void 0 ? _a : {}));
|
|
728
731
|
const existingTurnDetectionLanguage = turnDetection.language;
|
|
729
|
-
const
|
|
730
|
-
const language = existingTurnDetectionLanguage !== null && existingTurnDetectionLanguage !== void 0 ? existingTurnDetectionLanguage : (existingAsrLanguage !== undefined && isTurnDetectionLanguage(existingAsrLanguage)
|
|
731
|
-
? existingAsrLanguage
|
|
732
|
-
: DEFAULT_TURN_DETECTION_LANGUAGE);
|
|
732
|
+
const language = existingTurnDetectionLanguage !== null && existingTurnDetectionLanguage !== void 0 ? existingTurnDetectionLanguage : DEFAULT_TURN_DETECTION_LANGUAGE;
|
|
733
733
|
assertTurnDetectionLanguage(language);
|
|
734
734
|
turnDetection.language = language;
|
|
735
735
|
return turnDetection;
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* This class provides a high-level interface for managing agent sessions,
|
|
5
5
|
* including starting, stopping, and interacting with the agent.
|
|
6
6
|
*/
|
|
7
|
+
import type { AgoraClient } from "../AgoraPoolClient.js";
|
|
7
8
|
import type { AgentManagementClient } from "../api/resources/agentManagement/client/Client.js";
|
|
8
9
|
import type { AgentsClient } from "../api/resources/agents/client/Client.js";
|
|
9
|
-
import type { AgoraClient } from "../Client.js";
|
|
10
10
|
import type { Agent } from "./Agent.js";
|
|
11
|
+
import type { AgoraArea } from "./area.js";
|
|
11
12
|
import { type PresetInput } from "./presets.js";
|
|
12
13
|
import type { AgentConfigUpdate, ConversationHistory, ConversationTurns, GetTurnsOptions, SayOptions, SessionInfo, ThinkOptions, ThinkResponse } from "./types.js";
|
|
13
14
|
/**
|
|
@@ -23,14 +24,14 @@ export type AgentSessionEventHandler<T = unknown> = (data: T) => void;
|
|
|
23
24
|
*/
|
|
24
25
|
export interface AgentSessionOptions {
|
|
25
26
|
/** The Agora client instance */
|
|
26
|
-
client: AgoraClient
|
|
27
|
+
client: AgoraClient<AgoraArea>;
|
|
27
28
|
/** The agent configuration */
|
|
28
|
-
agent: Agent
|
|
29
|
+
agent: Agent<number, AgoraArea>;
|
|
29
30
|
/** The App ID */
|
|
30
31
|
appId: string;
|
|
31
32
|
/** The App Certificate — enables automatic RTC token generation when starting sessions */
|
|
32
33
|
appCertificate?: string;
|
|
33
|
-
/** Unique name
|
|
34
|
+
/** Unique agent instance name (set via {@link Agent.createSession}) */
|
|
34
35
|
name: string;
|
|
35
36
|
/** The channel to join */
|
|
36
37
|
channel: string;
|
|
@@ -77,13 +78,14 @@ export interface AgentSessionOptions {
|
|
|
77
78
|
* appCertificate: '...',
|
|
78
79
|
* });
|
|
79
80
|
*
|
|
80
|
-
* const agent = new Agent({
|
|
81
|
+
* const agent = new Agent({ client, instructions: 'You are a helpful voice assistant.' })
|
|
81
82
|
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
82
83
|
* .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
|
|
83
84
|
* .withStt(new DeepgramSTT({ apiKey: '...', language: 'en-US' }));
|
|
84
85
|
*
|
|
85
|
-
* const session = agent.createSession(
|
|
86
|
-
*
|
|
86
|
+
* const session = agent.createSession({
|
|
87
|
+
* name: `conversation-${Date.now()}`,
|
|
88
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
87
89
|
* agentUid: '1',
|
|
88
90
|
* remoteUids: ['100'],
|
|
89
91
|
* });
|
|
@@ -136,7 +138,7 @@ export declare class AgentSession {
|
|
|
136
138
|
/**
|
|
137
139
|
* The agent configuration.
|
|
138
140
|
*/
|
|
139
|
-
get agent(): Agent
|
|
141
|
+
get agent(): Agent<number, AgoraArea>;
|
|
140
142
|
/**
|
|
141
143
|
* The App ID for this session.
|
|
142
144
|
*/
|
|
@@ -183,7 +185,7 @@ export declare class AgentSession {
|
|
|
183
185
|
* Fills session-derived avatar fields and generates avatar ConvoAI tokens.
|
|
184
186
|
*
|
|
185
187
|
* Token management is gated to vendors that publish a separate RTC video
|
|
186
|
-
* identity (HeyGen, LiveAvatar, Generic). Other vendors (Akool, Anam) do
|
|
188
|
+
* identity (HeyGen, LiveAvatar, Generic, SenseTime). Other vendors (Akool, Anam) do
|
|
187
189
|
* not run a separate publisher and never receive an auto-generated token.
|
|
188
190
|
*/
|
|
189
191
|
private _enrichAvatarParams;
|
|
@@ -35,13 +35,14 @@ const token_js_1 = require("./token.js");
|
|
|
35
35
|
* appCertificate: '...',
|
|
36
36
|
* });
|
|
37
37
|
*
|
|
38
|
-
* const agent = new Agent({
|
|
38
|
+
* const agent = new Agent({ client, instructions: 'You are a helpful voice assistant.' })
|
|
39
39
|
* .withLlm(new OpenAI({ apiKey: '...', model: 'gpt-4o-mini', url: 'https://api.openai.com/v1/chat/completions' }))
|
|
40
40
|
* .withTts(new ElevenLabsTTS({ key: '...', modelId: '...', voiceId: '...', baseUrl: 'wss://api.elevenlabs.io/v1', sampleRate: 24000 }))
|
|
41
41
|
* .withStt(new DeepgramSTT({ apiKey: '...', language: 'en-US' }));
|
|
42
42
|
*
|
|
43
|
-
* const session = agent.createSession(
|
|
44
|
-
*
|
|
43
|
+
* const session = agent.createSession({
|
|
44
|
+
* name: `conversation-${Date.now()}`,
|
|
45
|
+
* channel: `demo-channel-${Date.now()}`,
|
|
45
46
|
* agentUid: '1',
|
|
46
47
|
* remoteUids: ['100'],
|
|
47
48
|
* });
|
|
@@ -193,6 +194,7 @@ class AgentSession {
|
|
|
193
194
|
// are filled by `_enrichAvatarParams()` and validated separately.
|
|
194
195
|
if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) ||
|
|
195
196
|
(0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) ||
|
|
197
|
+
(0, avatar_types_js_1.isSensetimeAvatar)(strictAvatar) ||
|
|
196
198
|
(0, avatar_types_js_1.isAkoolAvatar)(strictAvatar) ||
|
|
197
199
|
(0, avatar_types_js_1.isAnamAvatar)(strictAvatar) ||
|
|
198
200
|
(0, avatar_types_js_1.isGenericAvatar)(strictAvatar)) {
|
|
@@ -228,7 +230,7 @@ class AgentSession {
|
|
|
228
230
|
* Fills session-derived avatar fields and generates avatar ConvoAI tokens.
|
|
229
231
|
*
|
|
230
232
|
* Token management is gated to vendors that publish a separate RTC video
|
|
231
|
-
* identity (HeyGen, LiveAvatar, Generic). Other vendors (Akool, Anam) do
|
|
233
|
+
* identity (HeyGen, LiveAvatar, Generic, SenseTime). Other vendors (Akool, Anam) do
|
|
232
234
|
* not run a separate publisher and never receive an auto-generated token.
|
|
233
235
|
*/
|
|
234
236
|
_enrichAvatarParams(properties, expirySeconds) {
|
|
@@ -279,10 +281,13 @@ class AgentSession {
|
|
|
279
281
|
const strictAvatar = avatar;
|
|
280
282
|
if ((0, avatar_types_js_1.isHeyGenAvatar)(strictAvatar) ||
|
|
281
283
|
(0, avatar_types_js_1.isLiveAvatarAvatar)(strictAvatar) ||
|
|
284
|
+
(0, avatar_types_js_1.isSensetimeAvatar)(strictAvatar) ||
|
|
282
285
|
(0, avatar_types_js_1.isAkoolAvatar)(strictAvatar) ||
|
|
283
286
|
(0, avatar_types_js_1.isAnamAvatar)(strictAvatar) ||
|
|
284
287
|
(0, avatar_types_js_1.isGenericAvatar)(strictAvatar)) {
|
|
285
|
-
(0, avatar_types_js_1.validateAvatarConfig)(strictAvatar, {
|
|
288
|
+
(0, avatar_types_js_1.validateAvatarConfig)(strictAvatar, {
|
|
289
|
+
requireSessionFields: (0, avatar_types_js_1.isGenericAvatar)(strictAvatar),
|
|
290
|
+
});
|
|
286
291
|
}
|
|
287
292
|
if (!(0, avatar_types_js_1.isAvatarTokenManaged)(strictAvatar)) {
|
|
288
293
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
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 stt_js_1 = require("../vendors/stt.js");
|
|
9
|
+
const tts_js_1 = require("../vendors/tts.js");
|
|
10
|
+
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
11
|
+
area: index_js_1.Area.US,
|
|
12
|
+
appId: "app-id",
|
|
13
|
+
appCertificate: "app-certificate",
|
|
14
|
+
});
|
|
15
|
+
new Agent_js_1.Agent({ client, turnDetection: { language: "en-US" } })
|
|
16
|
+
.withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }))
|
|
17
|
+
.withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }))
|
|
18
|
+
.withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }))
|
|
19
|
+
.createSession({
|
|
20
|
+
name: "assistant",
|
|
21
|
+
channel: "test-room",
|
|
22
|
+
agentUid: "1",
|
|
23
|
+
remoteUids: ["100"],
|
|
24
|
+
});
|
|
25
|
+
// Area and provider may differ.
|
|
26
|
+
new Agent_js_1.Agent({ client }).withStt(new cn_js_1.FengmingSTT());
|
|
27
|
+
new Agent_js_1.Agent({ client }).withLlm(new cn_js_1.AliyunLLM({ url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions", model: "qwen-plus" }));
|
|
28
|
+
new Agent_js_1.Agent({ client }).withTts(new cn_js_1.MiniMaxCNTTS({ key: "minimax-key", model: "speech-01-turbo", voiceSetting: { voice_id: "female-shaonv" } }));
|
|
29
|
+
{
|
|
30
|
+
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
31
|
+
area: index_js_1.Area.CN,
|
|
32
|
+
appId: "app-id",
|
|
33
|
+
appCertificate: "app-certificate",
|
|
34
|
+
});
|
|
35
|
+
new Agent_js_1.Agent({ client, turnDetection: { language: "zh-CN" } })
|
|
36
|
+
.withStt(new cn_js_1.FengmingSTT())
|
|
37
|
+
.withLlm(new cn_js_1.AliyunLLM({
|
|
38
|
+
url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
39
|
+
model: "qwen-plus",
|
|
40
|
+
}))
|
|
41
|
+
.withTts(new cn_js_1.MiniMaxCNTTS({
|
|
42
|
+
key: "minimax-key",
|
|
43
|
+
model: "speech-01-turbo",
|
|
44
|
+
voiceSetting: { voice_id: "female-shaonv" },
|
|
45
|
+
audioSetting: { sample_rate: 16000 },
|
|
46
|
+
}))
|
|
47
|
+
.createSession({
|
|
48
|
+
name: "assistant",
|
|
49
|
+
channel: "cn-room",
|
|
50
|
+
agentUid: "1",
|
|
51
|
+
remoteUids: ["100"],
|
|
52
|
+
});
|
|
53
|
+
new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
|
|
54
|
+
new Agent_js_1.Agent({ client }).withLlm(new llm_js_1.OpenAI({ model: "gpt-5-mini" }));
|
|
55
|
+
new Agent_js_1.Agent({ client }).withTts(new tts_js_1.MiniMaxTTS({ model: "speech-2.6-turbo", voiceId: "English_captivating_female1" }));
|
|
56
|
+
}
|
|
57
|
+
new Agent_js_1.Agent({ client }).withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en-US" }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
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 stt_js_1 = require("../vendors/stt.js");
|
|
9
|
+
const tts_js_1 = require("../vendors/tts.js");
|
|
10
|
+
const AGENT_PROMPT = "You are a concise, technically credible voice assistant. Keep replies short unless the user asks for detail.";
|
|
11
|
+
const GREETING = "Hi there! I am your Agora voice assistant. How can I help?";
|
|
12
|
+
const SUPPORT_PROMPT = "You are a concise support assistant.";
|
|
13
|
+
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
14
|
+
area: index_js_1.Area.US,
|
|
15
|
+
appId: "app-id",
|
|
16
|
+
appCertificate: "app-certificate",
|
|
17
|
+
});
|
|
18
|
+
new Agent_js_1.Agent({
|
|
19
|
+
client,
|
|
20
|
+
turnDetection: {
|
|
21
|
+
language: "en-US",
|
|
22
|
+
config: {
|
|
23
|
+
speech_threshold: 0.5,
|
|
24
|
+
start_of_speech: {
|
|
25
|
+
mode: "vad",
|
|
26
|
+
vad_config: {
|
|
27
|
+
interrupt_duration_ms: 160,
|
|
28
|
+
prefix_padding_ms: 300,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
end_of_speech: {
|
|
32
|
+
mode: "vad",
|
|
33
|
+
vad_config: {
|
|
34
|
+
silence_duration_ms: 480,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
advancedFeatures: {
|
|
40
|
+
enable_rtm: true,
|
|
41
|
+
enable_tools: true,
|
|
42
|
+
},
|
|
43
|
+
parameters: {
|
|
44
|
+
data_channel: "rtm",
|
|
45
|
+
enable_error_message: true,
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
.withStt(new stt_js_1.DeepgramSTT({ model: "nova-3", language: "en" }))
|
|
49
|
+
.withLlm(new llm_js_1.OpenAI({
|
|
50
|
+
model: "gpt-4o-mini",
|
|
51
|
+
systemMessages: [{ role: "system", content: AGENT_PROMPT }],
|
|
52
|
+
greetingMessage: GREETING,
|
|
53
|
+
failureMessage: "Please wait a moment.",
|
|
54
|
+
maxHistory: 50,
|
|
55
|
+
params: {
|
|
56
|
+
max_tokens: 1024,
|
|
57
|
+
temperature: 0.7,
|
|
58
|
+
top_p: 0.95,
|
|
59
|
+
},
|
|
60
|
+
}))
|
|
61
|
+
.withTts(new tts_js_1.MiniMaxTTS({
|
|
62
|
+
model: "speech_2_6_turbo",
|
|
63
|
+
voiceId: "English_captivating_female1",
|
|
64
|
+
}))
|
|
65
|
+
.createSession({
|
|
66
|
+
name: `conversation-${Date.now()}`,
|
|
67
|
+
channel: `demo-channel-${Date.now()}`,
|
|
68
|
+
agentUid: "123456",
|
|
69
|
+
remoteUids: ["*"],
|
|
70
|
+
idleTimeout: 30,
|
|
71
|
+
});
|
|
72
|
+
{
|
|
73
|
+
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
74
|
+
area: index_js_1.Area.CN,
|
|
75
|
+
appId: "app-id",
|
|
76
|
+
appCertificate: "app-certificate",
|
|
77
|
+
});
|
|
78
|
+
new Agent_js_1.Agent({
|
|
79
|
+
client,
|
|
80
|
+
turnDetection: { language: "zh-CN" },
|
|
81
|
+
})
|
|
82
|
+
.withStt(new cn_js_1.FengmingSTT())
|
|
83
|
+
.withLlm(new cn_js_1.AliyunLLM({
|
|
84
|
+
url: "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions",
|
|
85
|
+
model: "qwen-plus",
|
|
86
|
+
}))
|
|
87
|
+
.withTts(new cn_js_1.MiniMaxCNTTS({
|
|
88
|
+
key: "minimax-key",
|
|
89
|
+
model: "speech-01-turbo",
|
|
90
|
+
voiceSetting: { voice_id: "female-shaonv" },
|
|
91
|
+
audioSetting: { sample_rate: 16000 },
|
|
92
|
+
}))
|
|
93
|
+
.createSession({
|
|
94
|
+
name: `conversation-${Date.now()}`,
|
|
95
|
+
channel: `demo-channel-${Date.now()}`,
|
|
96
|
+
agentUid: "1001",
|
|
97
|
+
remoteUids: ["100"],
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
{
|
|
101
|
+
const client = new AgoraPoolClient_js_1.AgoraClient({
|
|
102
|
+
area: index_js_1.Area.US,
|
|
103
|
+
appId: "app-id",
|
|
104
|
+
appCertificate: "app-certificate",
|
|
105
|
+
});
|
|
106
|
+
new Agent_js_1.Agent({ client, turnDetection: { language: "en-US" } })
|
|
107
|
+
.withStt(new stt_js_1.DeepgramSTT({
|
|
108
|
+
apiKey: "deepgram-key",
|
|
109
|
+
model: "nova-3",
|
|
110
|
+
language: "en",
|
|
111
|
+
}))
|
|
112
|
+
.withLlm(new llm_js_1.OpenAI({
|
|
113
|
+
apiKey: "openai-key",
|
|
114
|
+
url: "https://api.openai.com/v1/chat/completions",
|
|
115
|
+
model: "gpt-4o-mini",
|
|
116
|
+
systemMessages: [{ role: "system", content: SUPPORT_PROMPT }],
|
|
117
|
+
greetingMessage: GREETING,
|
|
118
|
+
maxTokens: 1024,
|
|
119
|
+
temperature: 0.7,
|
|
120
|
+
topP: 0.95,
|
|
121
|
+
}))
|
|
122
|
+
.withTts(new tts_js_1.MiniMaxTTS({
|
|
123
|
+
model: "speech_2_6_turbo",
|
|
124
|
+
voiceId: "English_captivating_female1",
|
|
125
|
+
}));
|
|
126
|
+
}
|