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.
- package/README.md +3 -3
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/agentkit/Agent.d.ts +1 -1
- package/dist/cjs/agentkit/Agent.js +27 -12
- package/dist/cjs/agentkit/AgentSession.d.ts +0 -3
- package/dist/cjs/agentkit/AgentSession.js +3 -3
- package/dist/cjs/agentkit/debug.d.ts +2 -4
- package/dist/cjs/agentkit/debug.js +15 -6
- package/dist/cjs/agentkit/index.d.ts +7 -5
- package/dist/cjs/agentkit/index.js +15 -12
- package/dist/cjs/agentkit/preview/client.d.ts +6 -5
- package/dist/cjs/agentkit/preview/client.js +10 -5
- package/dist/cjs/agentkit/preview/index.d.ts +6 -5
- package/dist/cjs/agentkit/preview/index.js +8 -6
- package/dist/cjs/agentkit/preview/vendors.d.ts +65 -63
- package/dist/cjs/agentkit/preview/vendors.js +71 -36
- package/dist/cjs/agentkit/types.d.ts +23 -41
- package/dist/cjs/agentkit/vendors/base.d.ts +6 -2
- package/dist/cjs/agentkit/vendors/base.js +4 -0
- package/dist/cjs/agentkit/vendors/cn.js +7 -5
- package/dist/cjs/agentkit/vendors/llm.js +8 -1
- package/dist/cjs/agentkit/vendors/stt.d.ts +45 -2
- package/dist/cjs/agentkit/vendors/stt.js +53 -5
- package/dist/cjs/agentkit/vendors/tts.js +1 -1
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.d.ts +12 -20
- package/dist/cjs/api/resources/agents/client/requests/StartAgentsRequest.js +1 -1
- package/dist/cjs/api/types/Asr.d.ts +4 -1
- package/dist/cjs/api/types/GeminiAsr.d.ts +10 -0
- package/dist/cjs/api/types/GeminiAsr.js +3 -0
- package/dist/cjs/api/types/GeminiAsrParams.d.ts +33 -0
- package/dist/cjs/api/types/GeminiAsrParams.js +12 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +5 -3
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/agentkit/Agent.d.mts +1 -1
- package/dist/esm/agentkit/Agent.mjs +27 -12
- package/dist/esm/agentkit/AgentSession.d.mts +0 -3
- package/dist/esm/agentkit/AgentSession.mjs +3 -3
- package/dist/esm/agentkit/debug.d.mts +2 -4
- package/dist/esm/agentkit/debug.mjs +15 -6
- package/dist/esm/agentkit/index.d.mts +7 -5
- package/dist/esm/agentkit/index.mjs +3 -2
- package/dist/esm/agentkit/preview/client.d.mts +6 -5
- package/dist/esm/agentkit/preview/client.mjs +10 -5
- package/dist/esm/agentkit/preview/index.d.mts +6 -5
- package/dist/esm/agentkit/preview/index.mjs +4 -4
- package/dist/esm/agentkit/preview/vendors.d.mts +65 -63
- package/dist/esm/agentkit/preview/vendors.mjs +69 -35
- package/dist/esm/agentkit/types.d.mts +23 -41
- package/dist/esm/agentkit/vendors/base.d.mts +6 -2
- package/dist/esm/agentkit/vendors/base.mjs +4 -0
- package/dist/esm/agentkit/vendors/cn.mjs +7 -5
- package/dist/esm/agentkit/vendors/llm.mjs +8 -1
- package/dist/esm/agentkit/vendors/stt.d.mts +45 -2
- package/dist/esm/agentkit/vendors/stt.mjs +51 -4
- package/dist/esm/agentkit/vendors/tts.mjs +1 -1
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.d.mts +12 -20
- package/dist/esm/api/resources/agents/client/requests/StartAgentsRequest.mjs +1 -1
- package/dist/esm/api/types/Asr.d.mts +4 -1
- package/dist/esm/api/types/GeminiAsr.d.mts +10 -0
- package/dist/esm/api/types/GeminiAsr.mjs +2 -0
- package/dist/esm/api/types/GeminiAsrParams.d.mts +33 -0
- package/dist/esm/api/types/GeminiAsrParams.mjs +9 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/index.d.mts +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +4 -2
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.d.ts +0 -1
- package/dist/cjs/agentkit/__tests__/area-aware-vendors.test.js +0 -87
- package/dist/cjs/agentkit/__tests__/preview-types.test.d.ts +0 -7
- package/dist/cjs/agentkit/__tests__/preview-types.test.js +0 -57
- package/dist/cjs/agentkit/__tests__/readme-examples.test.d.ts +0 -1
- package/dist/cjs/agentkit/__tests__/readme-examples.test.js +0 -126
- package/dist/cjs/agentkit/__tests__/type-safety.test.d.ts +0 -14
- package/dist/cjs/agentkit/__tests__/type-safety.test.js +0 -321
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.d.mts +0 -1
- package/dist/esm/agentkit/__tests__/area-aware-vendors.test.mjs +0 -85
- package/dist/esm/agentkit/__tests__/preview-types.test.d.mts +0 -7
- package/dist/esm/agentkit/__tests__/preview-types.test.mjs +0 -55
- package/dist/esm/agentkit/__tests__/readme-examples.test.d.mts +0 -1
- package/dist/esm/agentkit/__tests__/readme-examples.test.mjs +0 -124
- package/dist/esm/agentkit/__tests__/type-safety.test.d.mts +0 -14
- package/dist/esm/agentkit/__tests__/type-safety.test.mjs +0 -319
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Agora Conversational AI TypeScript SDK
|
|
2
2
|
|
|
3
|
-
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FAgoraIO
|
|
3
|
+
[](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FAgoraIO%2Fagora-agents-ts)
|
|
4
4
|
[](https://www.npmjs.com/package/agora-agents)
|
|
5
|
-
[](https://github.com/AgoraIO/agora-agents-ts/actions/workflows/ci.yml)
|
|
6
|
+
[](https://codecov.io/gh/AgoraIO/agora-agents-ts/branch/main)
|
|
7
7
|
|
|
8
8
|
The Agora Agents SDK for TypeScript lets you build real-time voice agents on Agora Conversational AI with a high-level `Agent` / `AgentSession` API and a generated REST client.
|
|
9
9
|
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -41,8 +41,8 @@ function normalizeClientOptions(options) {
|
|
|
41
41
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
42
42
|
"X-Fern-Language": "JavaScript",
|
|
43
43
|
"X-Fern-SDK-Name": "agora-agents",
|
|
44
|
-
"X-Fern-SDK-Version": "v2.
|
|
45
|
-
"User-Agent": "agora-agents/v2.
|
|
44
|
+
"X-Fern-SDK-Version": "v2.8.1",
|
|
45
|
+
"User-Agent": "agora-agents/v2.8.1",
|
|
46
46
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
47
47
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
48
48
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -246,7 +246,7 @@ export declare class Agent<TTSSampleRate extends number = number, TArea extends
|
|
|
246
246
|
*/
|
|
247
247
|
withAdvancedFeatures(features: AdvancedFeatures): Agent<TTSSampleRate, TArea>;
|
|
248
248
|
/**
|
|
249
|
-
* Returns a new Agent with MCP tool invocation enabled or disabled.
|
|
249
|
+
* Returns a new Agent with MCP and inline REST tool invocation enabled or disabled.
|
|
250
250
|
*/
|
|
251
251
|
withTools(enabled?: boolean): Agent<TTSSampleRate, TArea>;
|
|
252
252
|
/**
|
|
@@ -11,8 +11,14 @@ exports.Agent = void 0;
|
|
|
11
11
|
const index_js_1 = require("../core/domain/index.js");
|
|
12
12
|
const AgentSession_js_1 = require("./AgentSession.js");
|
|
13
13
|
const constants_js_1 = require("./constants.js");
|
|
14
|
+
const vendors_js_1 = require("./preview/vendors.js");
|
|
14
15
|
const token_js_1 = require("./token.js");
|
|
15
16
|
const DEFAULT_TURN_DETECTION_LANGUAGE = "en-US";
|
|
17
|
+
function toGeneratedMllm(config) {
|
|
18
|
+
// The preview vendor predates its generated schema enum. Keep the assertion at
|
|
19
|
+
// this wire boundary so the public and builder APIs remain accurately typed.
|
|
20
|
+
return config;
|
|
21
|
+
}
|
|
16
22
|
const INTERACTION_LANGUAGES = new Set([
|
|
17
23
|
"ar-EG",
|
|
18
24
|
"ar-JO",
|
|
@@ -306,7 +312,7 @@ class Agent {
|
|
|
306
312
|
return newAgent;
|
|
307
313
|
}
|
|
308
314
|
/**
|
|
309
|
-
* Returns a new Agent with MCP tool invocation enabled or disabled.
|
|
315
|
+
* Returns a new Agent with MCP and inline REST tool invocation enabled or disabled.
|
|
310
316
|
*/
|
|
311
317
|
withTools(enabled = true) {
|
|
312
318
|
const newAgent = this._clone();
|
|
@@ -627,7 +633,7 @@ class Agent {
|
|
|
627
633
|
remote_rtc_uids: opts.remoteUids,
|
|
628
634
|
idle_timeout: opts.idleTimeout,
|
|
629
635
|
enable_string_uid: opts.enableStringUid,
|
|
630
|
-
mllm: this._mllm,
|
|
636
|
+
mllm: toGeneratedMllm(this._mllm),
|
|
631
637
|
interruption: this._interruption,
|
|
632
638
|
sal: this._sal,
|
|
633
639
|
avatar: this._avatar,
|
|
@@ -639,15 +645,11 @@ class Agent {
|
|
|
639
645
|
filler_words: this._fillerWords,
|
|
640
646
|
};
|
|
641
647
|
if (isMllmMode) {
|
|
642
|
-
const mllmConfig = this._mllm ? Object.assign({}, this._mllm) : undefined;
|
|
648
|
+
const mllmConfig = toGeneratedMllm(this._mllm ? Object.assign({}, this._mllm) : undefined);
|
|
643
649
|
if (mllmConfig) {
|
|
644
650
|
// Vendor config wins: only apply agent-level values when the vendor hasn't already set them.
|
|
645
651
|
// Consistent with Python (setdefault) and Go (!exists) semantics.
|
|
646
652
|
//
|
|
647
|
-
// These are production wire spellings. A route that spells one of them
|
|
648
|
-
// differently needs a rename entry in `preview/client.ts`, or the value
|
|
649
|
-
// lands in a field the provider ignores and fails silently. See
|
|
650
|
-
// docs/guides/preview-endpoint.md#the-vendor-class-is-not-the-whole-wire-shape.
|
|
651
653
|
const c = mllmConfig;
|
|
652
654
|
if (this._greeting !== undefined && c.greeting_message === undefined) {
|
|
653
655
|
c.greeting_message = this._greeting;
|
|
@@ -656,7 +658,14 @@ class Agent {
|
|
|
656
658
|
c.failure_message = this._failureMessage;
|
|
657
659
|
}
|
|
658
660
|
}
|
|
659
|
-
|
|
661
|
+
const isOpenAIGPTLive = (0, vendors_js_1.isOpenAIGPTLiveConfig)(mllmConfig);
|
|
662
|
+
if (isOpenAIGPTLive && this._turnDetection !== undefined) {
|
|
663
|
+
console.warn("GPT Live v3 ignores agent-level turn_detection; endpointing is internal");
|
|
664
|
+
}
|
|
665
|
+
return Object.assign(Object.assign(Object.assign({}, base), { mllm: mllmConfig }), (!isOpenAIGPTLive &&
|
|
666
|
+
this._turnDetection !== undefined && {
|
|
667
|
+
turn_detection: this._turnDetection,
|
|
668
|
+
}));
|
|
660
669
|
}
|
|
661
670
|
const skipCategories = new Set((_c = opts.skipVendorValidationCategories) !== null && _c !== void 0 ? _c : []);
|
|
662
671
|
const allowMissingCategories = new Set((_d = opts.allowMissingVendorCategories) !== null && _d !== void 0 ? _d : []);
|
|
@@ -729,10 +738,16 @@ class Agent {
|
|
|
729
738
|
: {
|
|
730
739
|
vendor: this._client.area === index_js_1.Area.CN ? "fengming" : "ares",
|
|
731
740
|
};
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
741
|
+
if (asrConfig.vendor === "gemini" && asrConfig.params !== undefined) {
|
|
742
|
+
const params = Object.assign({}, asrConfig.params);
|
|
743
|
+
if (params.language_hints === undefined && params.language_codes !== undefined) {
|
|
744
|
+
params.language_hints = params.language_codes;
|
|
745
|
+
}
|
|
746
|
+
delete params.language_codes;
|
|
747
|
+
asrConfig.params = params;
|
|
748
|
+
}
|
|
749
|
+
// Turn detection is the single source of truth for the top-level
|
|
750
|
+
// interaction language. Provider-specific languages remain in params.
|
|
736
751
|
asrConfig.language = turnDetectionConfig.language;
|
|
737
752
|
return Object.keys(asrConfig).length > 0 ? asrConfig : undefined;
|
|
738
753
|
}
|
|
@@ -137,9 +137,6 @@ export declare class AgentSession {
|
|
|
137
137
|
/**
|
|
138
138
|
* Client-level default headers, for debug logging only.
|
|
139
139
|
*
|
|
140
|
-
* These carry the preview `agora-feature` gate, which the generated client
|
|
141
|
-
* merges in below the SDK's view — so without this the header that decides
|
|
142
|
-
* whether a request reaches a preview provider is invisible in debug output.
|
|
143
140
|
* Reaches into `_options` the same way `authMode` is read in the constructor;
|
|
144
141
|
* supplier-valued headers are skipped rather than resolved, since debug
|
|
145
142
|
* logging must not trigger side effects.
|
|
@@ -120,9 +120,6 @@ class AgentSession {
|
|
|
120
120
|
/**
|
|
121
121
|
* Client-level default headers, for debug logging only.
|
|
122
122
|
*
|
|
123
|
-
* These carry the preview `agora-feature` gate, which the generated client
|
|
124
|
-
* merges in below the SDK's view — so without this the header that decides
|
|
125
|
-
* whether a request reaches a preview provider is invisible in debug output.
|
|
126
123
|
* Reaches into `_options` the same way `authMode` is read in the constructor;
|
|
127
124
|
* supplier-valued headers are skipped rather than resolved, since debug
|
|
128
125
|
* logging must not trigger side effects.
|
|
@@ -139,6 +136,9 @@ class AgentSession {
|
|
|
139
136
|
result[key] = value;
|
|
140
137
|
}
|
|
141
138
|
}
|
|
139
|
+
if (this._previewFeatures.length > 0) {
|
|
140
|
+
return (0, client_js_1.previewRequestHeaders)(this._previewFeatures, result);
|
|
141
|
+
}
|
|
142
142
|
return result;
|
|
143
143
|
}
|
|
144
144
|
/**
|
|
@@ -25,9 +25,7 @@ export declare function redactSecrets(value: unknown): unknown;
|
|
|
25
25
|
/**
|
|
26
26
|
* Redacts request headers for debug logging.
|
|
27
27
|
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* the authorization scheme's credential, whose scheme name is preserved so the
|
|
31
|
-
* active auth mode stays visible.
|
|
28
|
+
* Non-authorization headers are kept. The authorization credential is removed,
|
|
29
|
+
* while its scheme name stays visible so the active auth mode can be diagnosed.
|
|
32
30
|
*/
|
|
33
31
|
export declare function redactHeadersForDebug(headers: Record<string, string>): Record<string, string>;
|
|
@@ -46,6 +46,10 @@ const SENSITIVE_BODY_KEYS = new Set([
|
|
|
46
46
|
"agora_token",
|
|
47
47
|
"agoratoken",
|
|
48
48
|
"authorization",
|
|
49
|
+
"headers",
|
|
50
|
+
"x-api-key",
|
|
51
|
+
"cookie",
|
|
52
|
+
"set-cookie",
|
|
49
53
|
"appid",
|
|
50
54
|
"app_id",
|
|
51
55
|
"agora_appid",
|
|
@@ -68,7 +72,7 @@ function redactQueryKeys(value) {
|
|
|
68
72
|
}
|
|
69
73
|
let changed = false;
|
|
70
74
|
for (const key of [...parsed.searchParams.keys()]) {
|
|
71
|
-
if (
|
|
75
|
+
if (!isSensitiveKey(key)) {
|
|
72
76
|
continue;
|
|
73
77
|
}
|
|
74
78
|
const current = parsed.searchParams.getAll(key);
|
|
@@ -115,18 +119,23 @@ function redactSecrets(value) {
|
|
|
115
119
|
/**
|
|
116
120
|
* Redacts request headers for debug logging.
|
|
117
121
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* the authorization scheme's credential, whose scheme name is preserved so the
|
|
121
|
-
* active auth mode stays visible.
|
|
122
|
+
* Non-authorization headers are kept. The authorization credential is removed,
|
|
123
|
+
* while its scheme name stays visible so the active auth mode can be diagnosed.
|
|
122
124
|
*/
|
|
123
125
|
function redactHeadersForDebug(headers) {
|
|
124
126
|
const result = {};
|
|
125
127
|
for (const [key, value] of Object.entries(headers)) {
|
|
126
|
-
|
|
128
|
+
const normalized = key.toLowerCase();
|
|
129
|
+
const sensitive = isSensitiveKey(normalized) ||
|
|
130
|
+
["authorization", "api-key", "api_key", "token", "secret", "credential", "cookie"].some((marker) => normalized.includes(marker));
|
|
131
|
+
if (!sensitive || value.length === 0) {
|
|
127
132
|
result[key] = value;
|
|
128
133
|
continue;
|
|
129
134
|
}
|
|
135
|
+
if (normalized !== "authorization") {
|
|
136
|
+
result[key] = exports.REDACTED;
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
130
139
|
const scheme = value.split(/[\s=]/, 1)[0];
|
|
131
140
|
result[key] = scheme && scheme !== value ? `${scheme} ${exports.REDACTED}` : exports.REDACTED;
|
|
132
141
|
}
|
|
@@ -29,12 +29,14 @@ export { AudioScenario, CredentialMode, DataChannel, FillerWordsSelectionRule, G
|
|
|
29
29
|
export { REDACTED, redactHeadersForDebug, redactSecrets } from "./debug.js";
|
|
30
30
|
export type { AgentPreset, AsrPreset, DeepgramPresetModel, LlmPreset, MiniMaxPresetModel, OpenAIPresetModel, OpenAITtsPresetModel, PresetCategory, PresetInput, TtsPreset, } from "./presets.js";
|
|
31
31
|
export { AgentPresets, normalizePresetInput } from "./presets.js";
|
|
32
|
-
export type {
|
|
33
|
-
export { createPreviewRoute,
|
|
32
|
+
export type { PreviewFeature, PreviewRoute } from "./preview/client.js";
|
|
33
|
+
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./preview/client.js";
|
|
34
|
+
export type { OpenAIGPTLiveOptions } from "./preview/vendors.js";
|
|
35
|
+
export { OpenAIGPTLive } from "./preview/vendors.js";
|
|
34
36
|
export type { AvatarVendor, CNAvatarVendor, CNLlmVendor, CNMllmVendor, CNSttVendor, CNTtsVendor, GlobalAvatarVendor, GlobalLlmVendor, GlobalMllmVendor, GlobalSttVendor, GlobalTtsVendor, LlmVendor, SttVendor, TtsVendor, } from "./region-vendors.js";
|
|
35
37
|
export type { GenerateConvoAITokenOptions, GenerateTokenOptions, } from "./token.js";
|
|
36
38
|
export { ExpiresIn, generateConvoAIToken, generateRtcToken, MAX_EXPIRY_SECONDS, } from "./token.js";
|
|
37
|
-
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
|
|
39
|
+
export type { AdvancedFeatures, AgentConfig, AgentConfigUpdate, AmazonTts, AmazonTtsParams, AsrConfig, AsrVendorName, AvatarConfig, AvatarWireVendor, CartesiaTts, CartesiaTtsParams, ConversationHistory, ConversationRole, ConversationSessionTurn, ConversationTurn, ConversationTurns, Eagerness, ElevenLabsTts, ElevenLabsTtsParams, EndOfSpeechConfig, EndOfSpeechMode, EndOfSpeechSemanticConfig, EndOfSpeechVadConfig, FarewellConfig, FillerWordsConfig, FillerWordsContent, FillerWordsContentGeneratedConfig, FillerWordsContentSelectionRule, FillerWordsContentStaticConfig, FillerWordsGeneratedLlmProvider, FillerWordsTrigger, FillerWordsTriggerFixedTimeConfig, FishAudioTts, FishAudioTtsParams, GeminiAsrParams, GenericTts, GenericTtsParams, GeofenceArea, GeofenceConfig, GeofenceExcludeArea, GetTurnsOptions, GoogleTts, GoogleTtsParams, GradiumTts, GradiumTtsParams, HumeAiTts, HumeAiTtsParams, InterruptionConfig, InterruptionMode, InterruptMode, Labels, LlmConfig, LlmGreetingConfigs, LlmGreetingConfigsMode, LlmStyle, LlmTool, LlmToolExecution, LlmToolFunction, LlmToolServer, McpServersItem, MicrosoftTts, MicrosoftTtsParams, MinimaxTts, MinimaxTtsParams, MistralTts, MistralTtsParams, MllmConfig, MllmTurnDetectionConfig, MllmTurnDetectionMode, MllmVendor, MurfTts, MurfTtsParams, OpenAiTts, OpenAiTtsParams, ParametersAudioScenario, ParametersDataChannel, RimeTts, RimeTtsParams, RtcConfig, SalConfig, SalMode, SarvamTts, SarvamTtsParams, SayOptions, SessionInfo, SessionListResponse, SessionOptions, SessionParams, SessionParamsInput, SessionStatus, SessionSummary, SilenceAction, SilenceConfig, SpatiusAvatarParams, SpeakPriority, StartOfSpeechConfig, StartOfSpeechDisabledConfig, StartOfSpeechDisabledConfigStrategy, StartOfSpeechKeywordsConfig, StartOfSpeechMode, StartOfSpeechVadConfig, SttConfig, ThinkOnListeningAction, ThinkOnSpeakingAction, ThinkOnThinkingAction, ThinkOptions, ThinkResponse, TtsConfig, TurnDetectionConfig, TurnDetectionLanguage, TurnDetectionNestedConfig, TurnDetectionType, TypecastTts, TypecastTtsParams, XAiAsr, XAiAsrParams, XAiTts, XAiTtsParams, } from "./types.js";
|
|
38
40
|
export type { AkoolAvatarOptions, AnamAvatarOptions, GenericAvatarOptions, HeyGenAvatarOptions, LiveAvatarAvatarOptions, } from "./vendors/avatar.js";
|
|
39
41
|
export { AkoolAvatar, AnamAvatar, GenericAvatar, HeyGenAvatar, LiveAvatarAvatar, } from "./vendors/avatar.js";
|
|
40
42
|
export type { AkoolSampleRate, CartesiaSampleRate, ElevenLabsSampleRate, HeyGenSampleRate, LiveAvatarSampleRate, MicrosoftSampleRate, SampleRate, } from "./vendors/base.js";
|
|
@@ -45,7 +47,7 @@ export type { AmazonBedrockOptions, AnthropicOptions, AzureOpenAIOptions, Custom
|
|
|
45
47
|
export { AmazonBedrock, Anthropic, AzureOpenAI, CustomLLM, Dify, Gemini, Groq, OpenAI, VertexAILLM, } from "./vendors/llm.js";
|
|
46
48
|
export type { AzureOpenAIRealtimeOptions, AzureOpenAIRealtimeParams, GeminiLiveOptions, OpenAIRealtimeOptions, QwenOmniOptions, VertexAIOptions, XaiGrokOptions, } from "./vendors/mllm.js";
|
|
47
49
|
export { AzureOpenAIRealtime, GeminiLive, OpenAIRealtime, QwenOmni, VertexAI, XaiGrok, } from "./vendors/mllm.js";
|
|
48
|
-
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
49
|
-
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
50
|
+
export type { AmazonSTTOptions, AresSTTOptions, AssemblyAISTTOptions, DeepgramSTTOptions, GeminiSTTModel, GeminiSTTOptions, GoogleSTTOptions, MicrosoftSTTOptions, OpenAISTTOptions, SarvamSTTOptions, SpeechmaticsSTTOptions, XAiSTTOptions, } from "./vendors/stt.js";
|
|
51
|
+
export { AmazonSTT, AresSTT, AssemblyAISTT, DeepgramSTT, GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode, GoogleSTT, MicrosoftSTT, OpenAISTT, SarvamSTT, SpeechmaticsSTT, XAiSTT, } from "./vendors/stt.js";
|
|
50
52
|
export type { AmazonTTSOptions, CartesiaTTSOptions, DeepgramTTSOptions, ElevenLabsTTSOptions, FishAudioTTSOptions, GenericTTSOptions, GoogleTTSOptions, GradiumTTSOptions, HumeAITTSOptions, MicrosoftTTSOptions, MiniMaxTTSOptions, MistralTTSOptions, MurfTTSOptions, OpenAITTSOptions, RimeTTSOptions, SarvamTTSOptions, TypecastTTSOptions, XAiTTSOptions, } from "./vendors/tts.js";
|
|
51
53
|
export { AmazonTTS, CartesiaTTS, DeepgramTTS, ElevenLabsTTS, FishAudioTTS, GenericTTS, GoogleTTS, GradiumTTS, HumeAITTS, MicrosoftTTS, MiniMaxTTS, MistralTTS, MurfTTS, OpenAITTS, RimeTTS, SarvamTTS, TypecastTTS, XAiTTS, } from "./vendors/tts.js";
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
* parts that need manual updates when adding new sugar.
|
|
21
21
|
*/
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.
|
|
24
|
-
exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.
|
|
25
|
-
exports.XAiTTS = exports.TypecastTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.VertexAILLM =
|
|
23
|
+
exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.normalizePresetInput = exports.AgentPresets = exports.redactSecrets = exports.redactHeadersForDebug = exports.REDACTED = exports.TurnDetectionTypeValues = exports.ThinkOnThinkingActionInterrupt = exports.ThinkOnThinkingActionIgnore = exports.ThinkOnSpeakingActionInterrupt = exports.ThinkOnSpeakingActionIgnore = exports.ThinkOnListeningActionInterrupt = exports.ThinkOnListeningActionInject = exports.ThinkOnListeningActionIgnore = exports.SpeakPriorityValues = exports.SpeakPriorityInterrupt = exports.SpeakPriorityIgnore = exports.SpeakPriorityAppend = exports.SilenceActionValues = exports.SalModeValues = exports.MllmTurnDetectionModeValues = exports.MllmTurnDetectionModeServerVad = exports.MllmTurnDetectionModeSemanticVad = exports.MllmTurnDetectionModeAgoraVad = exports.InterruptionModeValues = exports.InterruptionModeStartOfSpeech = exports.InterruptionModeKeywords = exports.InterruptionDisabledStrategyIgnore = exports.InterruptionDisabledStrategyAppend = exports.InterruptionDisabledStrategy = exports.Geofence = exports.FillerWordsSelectionRule = exports.DataChannel = exports.CredentialMode = exports.AudioScenario = exports.validateTtsSampleRate = exports.validateAvatarConfig = exports.toBaseAvatarConfig = exports.isSpatiusAvatar = exports.isSensetimeAvatar = exports.isLiveAvatarAvatar = exports.isHeyGenAvatar = exports.isGenericAvatar = exports.isAvatarTokenManaged = exports.isAnamAvatar = exports.isAkoolAvatar = exports.AgentSession = exports.Agent = void 0;
|
|
24
|
+
exports.OpenAI = exports.Groq = exports.Gemini = exports.Dify = exports.CustomLLM = exports.AzureOpenAI = exports.Anthropic = exports.AmazonBedrock = exports.XfyunSTT = exports.XfyunDialectSTT = exports.XfyunBigModelSTT = exports.TencentTTS = exports.TencentSTT = exports.TencentLLM = exports.StepFunTTS = exports.SpatiusAvatar = exports.SensetimeAvatar = exports.MiniMaxCNTTS = exports.MicrosoftCNTTS = exports.MicrosoftCNSTT = exports.FengmingSTT = exports.DeepSeekLLM = exports.CosyVoiceTTS = exports.BytedanceTTS = exports.BytedanceLLM = exports.BytedanceDuplexTTS = exports.AliyunLLM = exports.BaseTTS = exports.BaseSTT = exports.BaseMLLM = exports.BaseLLM = exports.BaseCNTTS = exports.BaseCNSTT = exports.BaseCNMLLM = exports.BaseCNLLM = exports.BaseCNAvatar = exports.BaseAvatar = exports.LiveAvatarAvatar = exports.HeyGenAvatar = exports.GenericAvatar = exports.AnamAvatar = exports.AkoolAvatar = exports.MAX_EXPIRY_SECONDS = exports.generateRtcToken = exports.generateConvoAIToken = exports.ExpiresIn = exports.OpenAIGPTLive = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = void 0;
|
|
25
|
+
exports.XAiTTS = exports.TypecastTTS = exports.SarvamTTS = exports.RimeTTS = exports.OpenAITTS = exports.MurfTTS = exports.MistralTTS = exports.MiniMaxTTS = exports.MicrosoftTTS = exports.HumeAITTS = exports.GradiumTTS = exports.GoogleTTS = exports.GenericTTS = exports.FishAudioTTS = exports.ElevenLabsTTS = exports.DeepgramTTS = exports.CartesiaTTS = exports.AmazonTTS = exports.XAiSTT = exports.SpeechmaticsSTT = exports.SarvamSTT = exports.OpenAISTT = exports.MicrosoftSTT = exports.GoogleSTT = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = exports.DeepgramSTT = exports.AssemblyAISTT = exports.AresSTT = exports.AmazonSTT = exports.XaiGrok = exports.VertexAI = exports.QwenOmni = exports.OpenAIRealtime = exports.GeminiLive = exports.AzureOpenAIRealtime = exports.VertexAILLM = void 0;
|
|
26
26
|
// Core classes
|
|
27
27
|
var Agent_js_1 = require("./Agent.js");
|
|
28
28
|
Object.defineProperty(exports, "Agent", { enumerable: true, get: function () { return Agent_js_1.Agent; } });
|
|
@@ -78,15 +78,15 @@ Object.defineProperty(exports, "redactSecrets", { enumerable: true, get: functio
|
|
|
78
78
|
var presets_js_1 = require("./presets.js");
|
|
79
79
|
Object.defineProperty(exports, "AgentPresets", { enumerable: true, get: function () { return presets_js_1.AgentPresets; } });
|
|
80
80
|
Object.defineProperty(exports, "normalizePresetInput", { enumerable: true, get: function () { return presets_js_1.normalizePresetInput; } });
|
|
81
|
-
var
|
|
82
|
-
Object.defineProperty(exports, "createPreviewRoute", { enumerable: true, get: function () { return
|
|
83
|
-
Object.defineProperty(exports, "
|
|
84
|
-
Object.defineProperty(exports, "
|
|
85
|
-
Object.defineProperty(exports, "
|
|
86
|
-
Object.defineProperty(exports, "
|
|
87
|
-
Object.defineProperty(exports, "
|
|
88
|
-
|
|
89
|
-
Object.defineProperty(exports, "
|
|
81
|
+
var client_js_1 = require("./preview/client.js");
|
|
82
|
+
Object.defineProperty(exports, "createPreviewRoute", { enumerable: true, get: function () { return client_js_1.createPreviewRoute; } });
|
|
83
|
+
Object.defineProperty(exports, "PREVIEW_API_BASE_URL", { enumerable: true, get: function () { return client_js_1.PREVIEW_API_BASE_URL; } });
|
|
84
|
+
Object.defineProperty(exports, "PREVIEW_FEATURE_HEADER", { enumerable: true, get: function () { return client_js_1.PREVIEW_FEATURE_HEADER; } });
|
|
85
|
+
Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: function () { return client_js_1.PreviewFeatures; } });
|
|
86
|
+
Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
|
|
87
|
+
Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
|
|
88
|
+
var vendors_js_1 = require("./preview/vendors.js");
|
|
89
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return vendors_js_1.OpenAIGPTLive; } });
|
|
90
90
|
// Token generation
|
|
91
91
|
var token_js_1 = require("./token.js");
|
|
92
92
|
Object.defineProperty(exports, "ExpiresIn", { enumerable: true, get: function () { return token_js_1.ExpiresIn; } });
|
|
@@ -157,6 +157,9 @@ Object.defineProperty(exports, "AmazonSTT", { enumerable: true, get: function ()
|
|
|
157
157
|
Object.defineProperty(exports, "AresSTT", { enumerable: true, get: function () { return stt_js_1.AresSTT; } });
|
|
158
158
|
Object.defineProperty(exports, "AssemblyAISTT", { enumerable: true, get: function () { return stt_js_1.AssemblyAISTT; } });
|
|
159
159
|
Object.defineProperty(exports, "DeepgramSTT", { enumerable: true, get: function () { return stt_js_1.DeepgramSTT; } });
|
|
160
|
+
Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
|
|
161
|
+
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
|
|
162
|
+
Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
|
|
160
163
|
Object.defineProperty(exports, "GoogleSTT", { enumerable: true, get: function () { return stt_js_1.GoogleSTT; } });
|
|
161
164
|
Object.defineProperty(exports, "MicrosoftSTT", { enumerable: true, get: function () { return stt_js_1.MicrosoftSTT; } });
|
|
162
165
|
Object.defineProperty(exports, "OpenAISTT", { enumerable: true, get: function () { return stt_js_1.OpenAISTT; } });
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* and binds that session to the preview host while ordinary AgoraClient calls
|
|
8
8
|
* remain on the regional production endpoint.
|
|
9
9
|
*
|
|
10
|
-
* Everything under `agentkit/preview/` is temporary. When
|
|
11
|
-
*
|
|
12
|
-
* into
|
|
10
|
+
* Everything under `agentkit/preview/` is temporary. When a provider ships on
|
|
11
|
+
* the production gateway, remove its preview registration and move its class
|
|
12
|
+
* into the corresponding production vendor module.
|
|
13
13
|
*/
|
|
14
14
|
import type { AgoraClient } from "../../AgoraPoolClient.js";
|
|
15
15
|
import type * as Agora from "../../api/index.js";
|
|
@@ -31,10 +31,11 @@ export declare const PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
31
31
|
* preview endpoint.
|
|
32
32
|
*/
|
|
33
33
|
export declare const PreviewFeatures: {
|
|
34
|
-
/** Gemini
|
|
34
|
+
/** @deprecated Gemini ASR now uses the production endpoint. */
|
|
35
35
|
readonly GeminiLive: "gemini-live";
|
|
36
|
+
readonly LiveModels: "live-models";
|
|
36
37
|
};
|
|
37
|
-
/** A preview provider family
|
|
38
|
+
/** A preview provider family gate value. */
|
|
38
39
|
export type PreviewFeature = (typeof PreviewFeatures)[keyof typeof PreviewFeatures];
|
|
39
40
|
/** Session-scoped clients bound to one resolved route. */
|
|
40
41
|
export interface PreviewRoute {
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* and binds that session to the preview host while ordinary AgoraClient calls
|
|
9
9
|
* remain on the regional production endpoint.
|
|
10
10
|
*
|
|
11
|
-
* Everything under `agentkit/preview/` is temporary. When
|
|
12
|
-
*
|
|
13
|
-
* into
|
|
11
|
+
* Everything under `agentkit/preview/` is temporary. When a provider ships on
|
|
12
|
+
* the production gateway, remove its preview registration and move its class
|
|
13
|
+
* into the corresponding production vendor module.
|
|
14
14
|
*/
|
|
15
15
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
16
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -28,6 +28,7 @@ exports.createPreviewRoute = createPreviewRoute;
|
|
|
28
28
|
exports.requiredPreviewFeatures = requiredPreviewFeatures;
|
|
29
29
|
const Client_js_1 = require("../../api/resources/agentManagement/client/Client.js");
|
|
30
30
|
const Client_js_2 = require("../../api/resources/agents/client/Client.js");
|
|
31
|
+
const vendors_js_1 = require("./vendors.js");
|
|
31
32
|
/** Base URL that serves the preview providers. */
|
|
32
33
|
exports.PREVIEW_API_BASE_URL = "https://partner.ai.agora.io/preview/api/conversational-ai-agent";
|
|
33
34
|
/**
|
|
@@ -44,8 +45,9 @@ exports.PREVIEW_FEATURE_HEADER = "agora-feature";
|
|
|
44
45
|
* preview endpoint.
|
|
45
46
|
*/
|
|
46
47
|
exports.PreviewFeatures = {
|
|
47
|
-
/** Gemini
|
|
48
|
+
/** @deprecated Gemini ASR now uses the production endpoint. */
|
|
48
49
|
GeminiLive: "gemini-live",
|
|
50
|
+
LiveModels: "live-models",
|
|
49
51
|
};
|
|
50
52
|
/**
|
|
51
53
|
* Pins the gate after any caller headers. This is also used for per-call auth
|
|
@@ -72,7 +74,7 @@ function createPreviewRoute(client, features) {
|
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
76
|
/** ASR vendor served only by the preview endpoint. */
|
|
75
|
-
const PREVIEW_ASR_VENDORS = new Set(
|
|
77
|
+
const PREVIEW_ASR_VENDORS = new Set();
|
|
76
78
|
/**
|
|
77
79
|
* Returns the preview features a start request needs, derived from the request
|
|
78
80
|
* body rather than from the vendor classes — so hand-written configs are
|
|
@@ -85,5 +87,8 @@ function requiredPreviewFeatures(properties) {
|
|
|
85
87
|
if (asrVendor !== undefined && PREVIEW_ASR_VENDORS.has(asrVendor)) {
|
|
86
88
|
features.add(exports.PreviewFeatures.GeminiLive);
|
|
87
89
|
}
|
|
90
|
+
if ((0, vendors_js_1.isOpenAIGPTLiveConfig)(properties.mllm)) {
|
|
91
|
+
features.add(exports.PreviewFeatures.LiveModels);
|
|
92
|
+
}
|
|
88
93
|
return [...features];
|
|
89
94
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Preview provider surface.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `vendors/stt.ts`.
|
|
4
|
+
* Preview routing stays here while provider implementations can graduate to
|
|
5
|
+
* the production vendor modules independently.
|
|
7
6
|
*/
|
|
7
|
+
export type { GeminiSTTModel, GeminiSTTOptions } from "../vendors/stt.js";
|
|
8
|
+
export { GeminiSTT, GeminiSTTModels, GeminiTranscriptionMode } from "../vendors/stt.js";
|
|
8
9
|
export type { PreviewFeature, PreviewRoute } from "./client.js";
|
|
9
10
|
export { createPreviewRoute, PREVIEW_API_BASE_URL, PREVIEW_FEATURE_HEADER, PreviewFeatures, previewRequestHeaders, requiredPreviewFeatures, } from "./client.js";
|
|
10
|
-
export type {
|
|
11
|
-
export {
|
|
11
|
+
export type { OpenAIGPTLiveOptions } from "./vendors.js";
|
|
12
|
+
export { OpenAIGPTLive } from "./vendors.js";
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Preview provider surface.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `vendors/stt.ts`.
|
|
5
|
+
* Preview routing stays here while provider implementations can graduate to
|
|
6
|
+
* the production vendor modules independently.
|
|
8
7
|
*/
|
|
9
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
9
|
+
exports.OpenAIGPTLive = exports.requiredPreviewFeatures = exports.previewRequestHeaders = exports.PreviewFeatures = exports.PREVIEW_FEATURE_HEADER = exports.PREVIEW_API_BASE_URL = exports.createPreviewRoute = exports.GeminiTranscriptionMode = exports.GeminiSTTModels = exports.GeminiSTT = void 0;
|
|
10
|
+
var stt_js_1 = require("../vendors/stt.js");
|
|
11
|
+
Object.defineProperty(exports, "GeminiSTT", { enumerable: true, get: function () { return stt_js_1.GeminiSTT; } });
|
|
12
|
+
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return stt_js_1.GeminiSTTModels; } });
|
|
13
|
+
Object.defineProperty(exports, "GeminiTranscriptionMode", { enumerable: true, get: function () { return stt_js_1.GeminiTranscriptionMode; } });
|
|
11
14
|
var client_js_1 = require("./client.js");
|
|
12
15
|
Object.defineProperty(exports, "createPreviewRoute", { enumerable: true, get: function () { return client_js_1.createPreviewRoute; } });
|
|
13
16
|
Object.defineProperty(exports, "PREVIEW_API_BASE_URL", { enumerable: true, get: function () { return client_js_1.PREVIEW_API_BASE_URL; } });
|
|
@@ -16,5 +19,4 @@ Object.defineProperty(exports, "PreviewFeatures", { enumerable: true, get: funct
|
|
|
16
19
|
Object.defineProperty(exports, "previewRequestHeaders", { enumerable: true, get: function () { return client_js_1.previewRequestHeaders; } });
|
|
17
20
|
Object.defineProperty(exports, "requiredPreviewFeatures", { enumerable: true, get: function () { return client_js_1.requiredPreviewFeatures; } });
|
|
18
21
|
var vendors_js_1 = require("./vendors.js");
|
|
19
|
-
Object.defineProperty(exports, "
|
|
20
|
-
Object.defineProperty(exports, "GeminiSTTModels", { enumerable: true, get: function () { return vendors_js_1.GeminiSTTModels; } });
|
|
22
|
+
Object.defineProperty(exports, "OpenAIGPTLive", { enumerable: true, get: function () { return vendors_js_1.OpenAIGPTLive; } });
|
|
@@ -2,71 +2,73 @@
|
|
|
2
2
|
* Preview provider vendor classes.
|
|
3
3
|
*
|
|
4
4
|
* These follow the same shape as the GA vendor classes in `vendors/` —
|
|
5
|
-
* camelCase constructor options in, snake_case wire config out — so they
|
|
6
|
-
*
|
|
7
|
-
* endpoint
|
|
5
|
+
* camelCase constructor options in, snake_case wire config out — so they work
|
|
6
|
+
* with the corresponding Agent builder method. AgentSession routes them to the
|
|
7
|
+
* preview endpoint automatically.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* A Gemini preview transcription model. Known model names autocomplete; any
|
|
18
|
-
* string is accepted so a newly published preview model can be used before this
|
|
19
|
-
* SDK is updated.
|
|
20
|
-
*/
|
|
21
|
-
export type GeminiSTTModel = (typeof GeminiSTTModels)[keyof typeof GeminiSTTModels] | (string & {});
|
|
22
|
-
/** Constructor options for {@link GeminiSTT}. */
|
|
23
|
-
export interface GeminiSTTOptions {
|
|
24
|
-
/** Google API key. */
|
|
9
|
+
import type { McpServersItem, MllmConfig, MllmTurnDetectionConfig } from "../types.js";
|
|
10
|
+
import { BaseMLLM } from "../vendors/base.js";
|
|
11
|
+
export declare const OPENAI_GPT_LIVE_VENDOR: "openai_gpt_live";
|
|
12
|
+
export declare function isOpenAIGPTLiveConfig(config: unknown): boolean;
|
|
13
|
+
/** GPT Live v3 alpha options. Not for production traffic. */
|
|
14
|
+
export interface OpenAIGPTLiveOptions {
|
|
25
15
|
apiKey: string;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
16
|
+
/** Full WebSocket URL, used verbatim except OpenAI's legacy /v1/live route. */
|
|
17
|
+
url?: string;
|
|
18
|
+
/** @deprecated Use prompt. Serialized as prompt; an explicit prompt wins. */
|
|
19
|
+
instructions?: string;
|
|
20
|
+
greeting?: string;
|
|
21
|
+
failureMessage?: string;
|
|
22
|
+
inputModalities?: string[];
|
|
23
|
+
outputModalities?: string[];
|
|
24
|
+
messages?: Record<string, unknown>[];
|
|
25
|
+
/** MCP servers exposed to GPT Live. Requires Agent.withTools(). */
|
|
26
|
+
mcpServers?: McpServersItem[];
|
|
27
|
+
/** Additional provider fields; explicit options take precedence. */
|
|
28
|
+
params?: Record<string, unknown>;
|
|
29
|
+
/** @deprecated Unsupported in v3; setting this raises an error. */
|
|
30
|
+
inputAudioTranscription?: Record<string, unknown>;
|
|
31
|
+
/** @deprecated Ignored with a warning; v3 performs endpointing internally. */
|
|
32
|
+
turnDetection?: MllmTurnDetectionConfig;
|
|
33
|
+
/** Defaults to gpt-live-1. */
|
|
34
|
+
model?: string;
|
|
35
|
+
/** Output voice; provider default marin. Custom voice objects require PR #1522; use params after rollout. */
|
|
36
|
+
voice?: string;
|
|
37
|
+
/** Session instructions. */
|
|
38
|
+
prompt?: string;
|
|
39
|
+
/** Host when url is omitted; default wss://api.openai.com. */
|
|
40
|
+
baseUrl?: string;
|
|
41
|
+
/** WebSocket path; default /v1/live/sessions. */
|
|
42
|
+
path?: string;
|
|
43
|
+
/** Optional OpenAI-Alpha selector for preview contracts. Omitted by default. */
|
|
44
|
+
alphaSelector?: string;
|
|
45
|
+
/** Extra provider request headers as a JSON string; protocol headers win. */
|
|
46
|
+
headers?: string;
|
|
47
|
+
/** Assistant silence boundary in ms; provider default 600. Zero disables inference. */
|
|
48
|
+
outputIdleEndMs?: number;
|
|
49
|
+
/** Caller silence boundary in ms; provider default 1500. */
|
|
50
|
+
inputIdleEndMs?: number;
|
|
51
|
+
/** Speech amplitude threshold on the 16-bit scale; provider default 50. */
|
|
52
|
+
outputSilencePeak?: number;
|
|
53
|
+
/** Graph PCM sample rate; provider default 24000. */
|
|
54
|
+
outputSampleRate?: number;
|
|
55
|
+
/** Initial audio cushion; provider default 0. Negative disables pacing. */
|
|
56
|
+
outputBufferMs?: number;
|
|
57
|
+
/** Mic append batching in ms. Join default 0; extension class default 100. */
|
|
58
|
+
inputBatchMs?: number;
|
|
59
|
+
/** Advertise graph tools; provider default false. Does not control delegate built-ins. */
|
|
60
|
+
toolEnabled?: boolean;
|
|
61
|
+
/** Tool delegation mode; provider default responses. Fixed for the session. */
|
|
62
|
+
delegation?: "client" | "responses";
|
|
63
|
+
/** Tool delegate model; provider default gpt-5.6-sol. */
|
|
64
|
+
responsesModel?: string;
|
|
65
|
+
/** Interrupt playback on caller speech; provider default false. */
|
|
66
|
+
interruptOnUserTurn?: boolean;
|
|
67
|
+
/** Unmodelled v3 session fields. Cannot override model, delegation, audio, instructions or input. */
|
|
68
|
+
sessionParams?: Record<string, unknown>;
|
|
56
69
|
}
|
|
57
|
-
|
|
58
|
-
* Gemini 3.5 Transcribe ASR vendor (preview).
|
|
59
|
-
*
|
|
60
|
-
* @example
|
|
61
|
-
* ```typescript
|
|
62
|
-
* const agent = new Agent({ client }).withStt(new GeminiSTT({
|
|
63
|
-
* apiKey: process.env.GOOGLE_API_KEY!,
|
|
64
|
-
* languageCodes: ['en-US'],
|
|
65
|
-
* }));
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export declare class GeminiSTT extends BaseSTT {
|
|
70
|
+
export declare class OpenAIGPTLive extends BaseMLLM {
|
|
69
71
|
private readonly options;
|
|
70
|
-
constructor(options:
|
|
71
|
-
toConfig():
|
|
72
|
+
constructor(options: OpenAIGPTLiveOptions);
|
|
73
|
+
toConfig(): MllmConfig;
|
|
72
74
|
}
|