@elevenlabs/elevenlabs-js 2.19.0 → 2.20.0
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/Client.js +2 -2
- package/api/resources/conversationalAi/resources/agents/client/Client.d.ts +3 -5
- package/api/resources/conversationalAi/resources/agents/client/Client.js +11 -15
- package/api/resources/conversationalAi/resources/agents/client/requests/AgentsListRequest.d.ts +3 -0
- package/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +0 -1
- package/api/resources/studio/client/Client.d.ts +1 -0
- package/api/resources/studio/client/Client.js +18 -2
- package/api/resources/studio/client/requests/BodyCreatePodcastV1StudioPodcastsPost.d.ts +3 -0
- package/api/types/AgentDefinitionSource.d.ts +7 -0
- package/api/types/AgentDefinitionSource.js +10 -0
- package/api/types/AgentSummaryResponseModel.d.ts +2 -0
- package/api/types/ClientToolConfigInput.d.ts +2 -0
- package/api/types/ClientToolConfigOutput.d.ts +2 -0
- package/api/types/ConversationHistoryMetadataCommonModel.d.ts +3 -0
- package/api/types/CreateAgentResponseModel.d.ts +0 -4
- package/api/types/GetAgentResponseModel.d.ts +0 -2
- package/api/types/ProjectExtendedResponse.d.ts +2 -0
- package/api/types/ProjectResponse.d.ts +2 -0
- package/api/types/ToolExecutionMode.d.ts +6 -0
- package/api/types/ToolExecutionMode.js +9 -0
- package/api/types/WebhookToolConfigInput.d.ts +2 -0
- package/api/types/WebhookToolConfigOutput.d.ts +2 -0
- package/api/types/WhatsAppConversationInfo.d.ts +4 -0
- package/api/types/index.d.ts +3 -10
- package/api/types/index.js +3 -10
- package/dist/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.d.ts +3 -5
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.js +11 -15
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/AgentsListRequest.d.ts +3 -0
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +0 -1
- package/dist/api/resources/studio/client/Client.d.ts +1 -0
- package/dist/api/resources/studio/client/Client.js +18 -2
- package/dist/api/resources/studio/client/requests/BodyCreatePodcastV1StudioPodcastsPost.d.ts +3 -0
- package/dist/api/types/AgentDefinitionSource.d.ts +7 -0
- package/dist/api/types/AgentDefinitionSource.js +10 -0
- package/dist/api/types/AgentSummaryResponseModel.d.ts +2 -0
- package/dist/api/types/ClientToolConfigInput.d.ts +2 -0
- package/dist/api/types/ClientToolConfigOutput.d.ts +2 -0
- package/dist/api/types/ConversationHistoryMetadataCommonModel.d.ts +3 -0
- package/dist/api/types/CreateAgentResponseModel.d.ts +0 -4
- package/dist/api/types/GetAgentResponseModel.d.ts +0 -2
- package/dist/api/types/ProjectExtendedResponse.d.ts +2 -0
- package/dist/api/types/ProjectResponse.d.ts +2 -0
- package/dist/api/types/ToolExecutionMode.d.ts +6 -0
- package/dist/api/types/ToolExecutionMode.js +9 -0
- package/dist/api/types/WebhookToolConfigInput.d.ts +2 -0
- package/dist/api/types/WebhookToolConfigOutput.d.ts +2 -0
- package/dist/api/types/WhatsAppConversationInfo.d.ts +4 -0
- package/dist/api/types/index.d.ts +3 -10
- package/dist/api/types/index.js +3 -10
- package/dist/serialization/resources/studio/client/requests/BodyCreatePodcastV1StudioPodcastsPost.d.ts +1 -1
- package/dist/serialization/types/AgentDefinitionSource.d.ts +7 -0
- package/dist/serialization/types/{WhatsAppChangeMessages.js → AgentDefinitionSource.js} +2 -2
- package/dist/serialization/types/AgentSummaryResponseModel.d.ts +1 -0
- package/dist/serialization/types/AgentSummaryResponseModel.js +1 -0
- package/dist/serialization/types/ClientToolConfigInput.d.ts +2 -0
- package/dist/serialization/types/ClientToolConfigInput.js +2 -0
- package/dist/serialization/types/ClientToolConfigOutput.d.ts +2 -0
- package/dist/serialization/types/ClientToolConfigOutput.js +2 -0
- package/dist/serialization/types/ConversationHistoryMetadataCommonModel.d.ts +5 -0
- package/dist/serialization/types/ConversationHistoryMetadataCommonModel.js +5 -0
- package/dist/serialization/types/CreateAgentResponseModel.d.ts +0 -2
- package/dist/serialization/types/CreateAgentResponseModel.js +0 -2
- package/dist/serialization/types/GetAgentResponseModel.d.ts +0 -1
- package/dist/serialization/types/GetAgentResponseModel.js +0 -1
- package/dist/serialization/types/ProjectExtendedResponse.d.ts +1 -0
- package/dist/serialization/types/ProjectExtendedResponse.js +1 -0
- package/dist/serialization/types/ProjectResponse.d.ts +1 -0
- package/dist/serialization/types/ProjectResponse.js +1 -0
- package/dist/serialization/types/ToolExecutionMode.d.ts +7 -0
- package/{serialization/types/WhatsAppCallDirection.js → dist/serialization/types/ToolExecutionMode.js} +2 -2
- package/dist/serialization/types/WebhookToolConfigInput.d.ts +2 -0
- package/dist/serialization/types/WebhookToolConfigInput.js +2 -0
- package/dist/serialization/types/WebhookToolConfigOutput.d.ts +2 -0
- package/dist/serialization/types/WebhookToolConfigOutput.js +2 -0
- package/dist/serialization/types/WhatsAppConversationInfo.d.ts +10 -0
- package/dist/serialization/types/{WhatsAppMetadata.js → WhatsAppConversationInfo.js} +4 -3
- package/dist/serialization/types/index.d.ts +3 -10
- package/dist/serialization/types/index.js +3 -10
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/ElevenLabsClient.d.ts +3 -0
- package/dist/wrapper/ElevenLabsClient.js +7 -0
- package/dist/wrapper/index.d.ts +2 -0
- package/dist/wrapper/index.js +8 -1
- package/dist/wrapper/realtime/connection.d.ts +179 -0
- package/dist/wrapper/realtime/connection.js +261 -0
- package/dist/wrapper/realtime/index.d.ts +2 -0
- package/dist/wrapper/realtime/index.js +10 -0
- package/dist/wrapper/realtime/scribe.d.ts +107 -0
- package/dist/wrapper/realtime/scribe.js +262 -0
- package/dist/wrapper/speechToText.d.ts +6 -0
- package/dist/wrapper/speechToText.js +14 -0
- package/package.json +1 -1
- package/reference.md +4 -12
- package/serialization/resources/studio/client/requests/BodyCreatePodcastV1StudioPodcastsPost.d.ts +1 -1
- package/serialization/types/AgentDefinitionSource.d.ts +7 -0
- package/serialization/types/{WhatsAppChangeMessages.js → AgentDefinitionSource.js} +2 -2
- package/serialization/types/AgentSummaryResponseModel.d.ts +1 -0
- package/serialization/types/AgentSummaryResponseModel.js +1 -0
- package/serialization/types/ClientToolConfigInput.d.ts +2 -0
- package/serialization/types/ClientToolConfigInput.js +2 -0
- package/serialization/types/ClientToolConfigOutput.d.ts +2 -0
- package/serialization/types/ClientToolConfigOutput.js +2 -0
- package/serialization/types/ConversationHistoryMetadataCommonModel.d.ts +5 -0
- package/serialization/types/ConversationHistoryMetadataCommonModel.js +5 -0
- package/serialization/types/CreateAgentResponseModel.d.ts +0 -2
- package/serialization/types/CreateAgentResponseModel.js +0 -2
- package/serialization/types/GetAgentResponseModel.d.ts +0 -1
- package/serialization/types/GetAgentResponseModel.js +0 -1
- package/serialization/types/ProjectExtendedResponse.d.ts +1 -0
- package/serialization/types/ProjectExtendedResponse.js +1 -0
- package/serialization/types/ProjectResponse.d.ts +1 -0
- package/serialization/types/ProjectResponse.js +1 -0
- package/serialization/types/ToolExecutionMode.d.ts +7 -0
- package/{dist/serialization/types/WhatsAppCallDirection.js → serialization/types/ToolExecutionMode.js} +2 -2
- package/serialization/types/WebhookToolConfigInput.d.ts +2 -0
- package/serialization/types/WebhookToolConfigInput.js +2 -0
- package/serialization/types/WebhookToolConfigOutput.d.ts +2 -0
- package/serialization/types/WebhookToolConfigOutput.js +2 -0
- package/serialization/types/WhatsAppConversationInfo.d.ts +10 -0
- package/{dist/serialization/types/WhatsAppChangeCalls.js → serialization/types/WhatsAppConversationInfo.js} +4 -4
- package/serialization/types/index.d.ts +3 -10
- package/serialization/types/index.js +3 -10
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/ElevenLabsClient.d.ts +3 -0
- package/wrapper/ElevenLabsClient.js +7 -0
- package/wrapper/index.d.ts +2 -0
- package/wrapper/index.js +8 -1
- package/wrapper/realtime/connection.d.ts +179 -0
- package/wrapper/realtime/connection.js +261 -0
- package/wrapper/realtime/index.d.ts +2 -0
- package/wrapper/realtime/index.js +10 -0
- package/wrapper/realtime/scribe.d.ts +107 -0
- package/wrapper/realtime/scribe.js +262 -0
- package/wrapper/speechToText.d.ts +6 -0
- package/wrapper/speechToText.js +14 -0
- package/api/resources/conversationalAi/resources/agents/client/requests/AgentsGetRequest.d.ts +0 -10
- package/api/types/WhatsAppBusinessAccount.d.ts +0 -5
- package/api/types/WhatsAppBusinessAccountChangesItem.d.ts +0 -10
- package/api/types/WhatsAppBusinessAccountChangesItem.js +0 -3
- package/api/types/WhatsAppCall.d.ts +0 -10
- package/api/types/WhatsAppCall.js +0 -3
- package/api/types/WhatsAppCallDirection.d.ts +0 -5
- package/api/types/WhatsAppCallDirection.js +0 -8
- package/api/types/WhatsAppCalls.d.ts +0 -5
- package/api/types/WhatsAppCalls.js +0 -3
- package/api/types/WhatsAppChangeCalls.d.ts +0 -4
- package/api/types/WhatsAppChangeCalls.js +0 -3
- package/api/types/WhatsAppChangeMessages.d.ts +0 -2
- package/api/types/WhatsAppChangeMessages.js +0 -3
- package/api/types/WhatsAppEventRequest.d.ts +0 -5
- package/api/types/WhatsAppEventRequest.js +0 -3
- package/api/types/WhatsAppMetadata.d.ts +0 -3
- package/api/types/WhatsAppMetadata.js +0 -3
- package/api/types/WhatsAppSession.d.ts +0 -4
- package/api/types/WhatsAppSession.js +0 -3
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/AgentsGetRequest.d.ts +0 -10
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/AgentsGetRequest.js +0 -3
- package/dist/api/types/WhatsAppBusinessAccount.d.ts +0 -5
- package/dist/api/types/WhatsAppBusinessAccount.js +0 -3
- package/dist/api/types/WhatsAppBusinessAccountChangesItem.d.ts +0 -10
- package/dist/api/types/WhatsAppBusinessAccountChangesItem.js +0 -3
- package/dist/api/types/WhatsAppCall.d.ts +0 -10
- package/dist/api/types/WhatsAppCall.js +0 -3
- package/dist/api/types/WhatsAppCallDirection.d.ts +0 -5
- package/dist/api/types/WhatsAppCallDirection.js +0 -8
- package/dist/api/types/WhatsAppCalls.d.ts +0 -5
- package/dist/api/types/WhatsAppCalls.js +0 -3
- package/dist/api/types/WhatsAppChangeCalls.d.ts +0 -4
- package/dist/api/types/WhatsAppChangeCalls.js +0 -3
- package/dist/api/types/WhatsAppChangeMessages.d.ts +0 -2
- package/dist/api/types/WhatsAppChangeMessages.js +0 -3
- package/dist/api/types/WhatsAppEventRequest.d.ts +0 -5
- package/dist/api/types/WhatsAppEventRequest.js +0 -3
- package/dist/api/types/WhatsAppMetadata.d.ts +0 -3
- package/dist/api/types/WhatsAppMetadata.js +0 -3
- package/dist/api/types/WhatsAppSession.d.ts +0 -4
- package/dist/api/types/WhatsAppSession.js +0 -3
- package/dist/serialization/types/WhatsAppBusinessAccount.d.ts +0 -11
- package/dist/serialization/types/WhatsAppBusinessAccount.js +0 -43
- package/dist/serialization/types/WhatsAppBusinessAccountChangesItem.d.ts +0 -15
- package/dist/serialization/types/WhatsAppBusinessAccountChangesItem.js +0 -49
- package/dist/serialization/types/WhatsAppCall.d.ts +0 -17
- package/dist/serialization/types/WhatsAppCall.js +0 -49
- package/dist/serialization/types/WhatsAppCallDirection.d.ts +0 -7
- package/dist/serialization/types/WhatsAppCalls.d.ts +0 -12
- package/dist/serialization/types/WhatsAppCalls.js +0 -44
- package/dist/serialization/types/WhatsAppChangeCalls.d.ts +0 -10
- package/dist/serialization/types/WhatsAppChangeMessages.d.ts +0 -8
- package/dist/serialization/types/WhatsAppEventRequest.d.ts +0 -11
- package/dist/serialization/types/WhatsAppEventRequest.js +0 -43
- package/dist/serialization/types/WhatsAppMetadata.d.ts +0 -9
- package/dist/serialization/types/WhatsAppSession.d.ts +0 -10
- package/dist/serialization/types/WhatsAppSession.js +0 -42
- package/serialization/types/WhatsAppBusinessAccount.d.ts +0 -11
- package/serialization/types/WhatsAppBusinessAccount.js +0 -43
- package/serialization/types/WhatsAppBusinessAccountChangesItem.d.ts +0 -15
- package/serialization/types/WhatsAppBusinessAccountChangesItem.js +0 -49
- package/serialization/types/WhatsAppCall.d.ts +0 -17
- package/serialization/types/WhatsAppCall.js +0 -49
- package/serialization/types/WhatsAppCallDirection.d.ts +0 -7
- package/serialization/types/WhatsAppCalls.d.ts +0 -12
- package/serialization/types/WhatsAppCalls.js +0 -44
- package/serialization/types/WhatsAppChangeCalls.d.ts +0 -10
- package/serialization/types/WhatsAppChangeCalls.js +0 -42
- package/serialization/types/WhatsAppChangeMessages.d.ts +0 -8
- package/serialization/types/WhatsAppEventRequest.d.ts +0 -11
- package/serialization/types/WhatsAppEventRequest.js +0 -43
- package/serialization/types/WhatsAppMetadata.d.ts +0 -9
- package/serialization/types/WhatsAppMetadata.js +0 -41
- package/serialization/types/WhatsAppSession.d.ts +0 -10
- package/serialization/types/WhatsAppSession.js +0 -42
- /package/api/{resources/conversationalAi/resources/agents/client/requests/AgentsGetRequest.js → types/WhatsAppConversationInfo.js} +0 -0
- /package/{api/types/WhatsAppBusinessAccount.js → dist/api/types/WhatsAppConversationInfo.js} +0 -0
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
45
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.ScribeRealtime = exports.CommitStrategy = exports.AudioFormat = void 0;
|
|
49
|
+
const ws_1 = __importDefault(require("ws"));
|
|
50
|
+
const connection_1 = require("./connection");
|
|
51
|
+
const core = __importStar(require("../../core"));
|
|
52
|
+
const environments = __importStar(require("../../environments"));
|
|
53
|
+
var AudioFormat;
|
|
54
|
+
(function (AudioFormat) {
|
|
55
|
+
AudioFormat["PCM_8000"] = "pcm_8000";
|
|
56
|
+
AudioFormat["PCM_16000"] = "pcm_16000";
|
|
57
|
+
AudioFormat["PCM_22050"] = "pcm_22050";
|
|
58
|
+
AudioFormat["PCM_24000"] = "pcm_24000";
|
|
59
|
+
AudioFormat["PCM_44100"] = "pcm_44100";
|
|
60
|
+
AudioFormat["PCM_48000"] = "pcm_48000";
|
|
61
|
+
AudioFormat["ULAW_8000"] = "ulaw_8000";
|
|
62
|
+
})(AudioFormat || (exports.AudioFormat = AudioFormat = {}));
|
|
63
|
+
var CommitStrategy;
|
|
64
|
+
(function (CommitStrategy) {
|
|
65
|
+
CommitStrategy["MANUAL"] = "manual";
|
|
66
|
+
CommitStrategy["VAD"] = "vad";
|
|
67
|
+
})(CommitStrategy || (exports.CommitStrategy = CommitStrategy = {}));
|
|
68
|
+
/**
|
|
69
|
+
* Real-time speech-to-text transcription client.
|
|
70
|
+
* @remarks
|
|
71
|
+
* **Node.js only**: This class uses Node.js-specific APIs (WebSocket from 'ws', child_process).
|
|
72
|
+
* It will not work in browsers, Deno, or Cloudflare Workers without modifications.
|
|
73
|
+
*/
|
|
74
|
+
class ScribeRealtime {
|
|
75
|
+
constructor(options = {}) {
|
|
76
|
+
this.options = options;
|
|
77
|
+
}
|
|
78
|
+
getWebSocketUri() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
// Get base URL from options, preferring baseUrl, then environment, then default Production
|
|
82
|
+
const baseUrl = (_b = (_a = (yield core.Supplier.get(this.options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this.options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production;
|
|
83
|
+
// Convert HTTP(S) to WS(S)
|
|
84
|
+
const wsUrl = baseUrl.replace(/^https?:\/\//i, (match) => match.toLowerCase() === "https://" ? "wss://" : "ws://");
|
|
85
|
+
return `${wsUrl}/v1/speech-to-text/realtime-beta`;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
checkFfmpegInstalled() {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
try {
|
|
91
|
+
const { execSync } = yield Promise.resolve().then(() => __importStar(require("node:child_process")));
|
|
92
|
+
const command = process.platform === "win32" ? "where ffmpeg" : "which ffmpeg";
|
|
93
|
+
execSync(command, { stdio: "ignore" });
|
|
94
|
+
}
|
|
95
|
+
catch (_a) {
|
|
96
|
+
throw new Error("ffmpeg is required for URL streaming but was not found. " +
|
|
97
|
+
"Please install ffmpeg and ensure it is available in your PATH. " +
|
|
98
|
+
"Visit https://ffmpeg.org/download.html for installation instructions.");
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
buildWebSocketUri(options) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
const baseUri = yield this.getWebSocketUri();
|
|
105
|
+
const params = new URLSearchParams();
|
|
106
|
+
// Model ID is required, so no check required
|
|
107
|
+
params.append("model_id", options.modelId);
|
|
108
|
+
// Add optional parameters if provided, with validation
|
|
109
|
+
if (options.commitStrategy !== undefined) {
|
|
110
|
+
params.append("commit_strategy", options.commitStrategy);
|
|
111
|
+
}
|
|
112
|
+
if (options.vadSilenceThresholdSecs !== undefined) {
|
|
113
|
+
if (options.vadSilenceThresholdSecs <= 0.3 || options.vadSilenceThresholdSecs > 3.0) {
|
|
114
|
+
throw new Error("vadSilenceThresholdSecs must be between 0.3 and 3.0");
|
|
115
|
+
}
|
|
116
|
+
params.append("vad_silence_threshold_secs", options.vadSilenceThresholdSecs.toString());
|
|
117
|
+
}
|
|
118
|
+
if (options.vadThreshold !== undefined) {
|
|
119
|
+
if (options.vadThreshold < 0.1 || options.vadThreshold > 0.9) {
|
|
120
|
+
throw new Error("vadThreshold must be between 0.1 and 0.9");
|
|
121
|
+
}
|
|
122
|
+
params.append("vad_threshold", options.vadThreshold.toString());
|
|
123
|
+
}
|
|
124
|
+
if (options.minSpeechDurationMs !== undefined) {
|
|
125
|
+
if (options.minSpeechDurationMs <= 50 || options.minSpeechDurationMs > 2000) {
|
|
126
|
+
throw new Error("minSpeechDurationMs must be between 50 and 2000");
|
|
127
|
+
}
|
|
128
|
+
params.append("min_speech_duration_ms", options.minSpeechDurationMs.toString());
|
|
129
|
+
}
|
|
130
|
+
if (options.minSilenceDurationMs !== undefined) {
|
|
131
|
+
if (options.minSilenceDurationMs <= 50 || options.minSilenceDurationMs > 2000) {
|
|
132
|
+
throw new Error("minSilenceDurationMs must be between 50 and 2000");
|
|
133
|
+
}
|
|
134
|
+
params.append("min_silence_duration_ms", options.minSilenceDurationMs.toString());
|
|
135
|
+
}
|
|
136
|
+
const queryString = params.toString();
|
|
137
|
+
return queryString ? `${baseUri}?${queryString}` : baseUri;
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Establishes a WebSocket connection for real-time speech-to-text transcription.
|
|
142
|
+
*
|
|
143
|
+
* @param options - Configuration options for the connection
|
|
144
|
+
* @returns A promise that resolves to a RealtimeConnection instance
|
|
145
|
+
*
|
|
146
|
+
* @remarks
|
|
147
|
+
* **Node.js only**: This method uses Node.js-specific APIs.
|
|
148
|
+
*
|
|
149
|
+
* When using `UrlOptions` with a URL, ffmpeg must be installed and available in PATH.
|
|
150
|
+
* The SDK will automatically convert the stream to 16kHz mono PCM format.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* // Manual audio streaming
|
|
155
|
+
* const connection = await client.speechToText.realtime.connect({
|
|
156
|
+
* modelId: "scribe_realtime_v2",
|
|
157
|
+
* audioFormat: AudioFormat.PCM_16000,
|
|
158
|
+
* sampleRate: 16000,
|
|
159
|
+
* });
|
|
160
|
+
*
|
|
161
|
+
* // Automatic URL streaming (requires ffmpeg)
|
|
162
|
+
* const connection = await client.speechToText.realtime.connect({
|
|
163
|
+
* modelId: "scribe_realtime_v2",
|
|
164
|
+
* url: "https://example.com/stream.mp3",
|
|
165
|
+
* });
|
|
166
|
+
* ```
|
|
167
|
+
*/
|
|
168
|
+
connect(options) {
|
|
169
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
+
let apiKey = this.options.apiKey;
|
|
171
|
+
if (!apiKey) {
|
|
172
|
+
throw new Error("API key is required");
|
|
173
|
+
}
|
|
174
|
+
// Resolve API key if it's a function or promise
|
|
175
|
+
if (typeof apiKey === "function") {
|
|
176
|
+
apiKey = apiKey();
|
|
177
|
+
}
|
|
178
|
+
if (apiKey instanceof Promise) {
|
|
179
|
+
apiKey = yield apiKey;
|
|
180
|
+
}
|
|
181
|
+
if (!apiKey) {
|
|
182
|
+
throw new Error("API key is required");
|
|
183
|
+
}
|
|
184
|
+
if (!options.modelId) {
|
|
185
|
+
throw new Error("modelId is required");
|
|
186
|
+
}
|
|
187
|
+
// Create connection object first so users can attach event listeners before messages arrive
|
|
188
|
+
const sampleRate = "url" in options ? 16000 : options.sampleRate;
|
|
189
|
+
const connection = new connection_1.RealtimeConnection(sampleRate);
|
|
190
|
+
// Build WebSocket URI with query parameters
|
|
191
|
+
const uri = yield this.buildWebSocketUri(options);
|
|
192
|
+
return new Promise((resolve) => {
|
|
193
|
+
const websocket = new ws_1.default(uri, {
|
|
194
|
+
headers: {
|
|
195
|
+
"xi-api-key": apiKey,
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
// Attach websocket to connection immediately so error handlers are registered
|
|
199
|
+
// This ensures errors during handshake (like 403) are properly emitted via event emitter
|
|
200
|
+
connection.setWebSocket(websocket);
|
|
201
|
+
// Resolve immediately with connection so users can attach listeners
|
|
202
|
+
resolve(connection);
|
|
203
|
+
websocket.on("open", () => {
|
|
204
|
+
var _a;
|
|
205
|
+
// If UrlOptions, start streaming from URL with ffmpeg
|
|
206
|
+
if ("url" in options) {
|
|
207
|
+
const commitStrategy = (_a = options.commitStrategy) !== null && _a !== void 0 ? _a : CommitStrategy.MANUAL;
|
|
208
|
+
this.streamFromUrl(options, connection, commitStrategy);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
streamFromUrl(options, connection, commitStrategy) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
var _a, _b, _c;
|
|
217
|
+
// Check if ffmpeg is installed before attempting to use it
|
|
218
|
+
yield this.checkFfmpegInstalled();
|
|
219
|
+
// Dynamically import spawn to avoid bundling issues in non-Node.js environments
|
|
220
|
+
const { spawn } = yield Promise.resolve().then(() => __importStar(require("node:child_process")));
|
|
221
|
+
// Spawn ffmpeg to convert the stream to 16kHz mono PCM
|
|
222
|
+
const ffmpegProcess = spawn("ffmpeg", [
|
|
223
|
+
"-i", options.url,
|
|
224
|
+
"-f", "s16le", // 16-bit PCM, little-endian
|
|
225
|
+
"-acodec", "pcm_s16le", // PCM codec
|
|
226
|
+
"-ar", "16000", // 16kHz sample rate
|
|
227
|
+
"-ac", "1", // mono (1 channel)
|
|
228
|
+
"pipe:1" // output to stdout
|
|
229
|
+
]);
|
|
230
|
+
connection.setFfmpegProcess(ffmpegProcess);
|
|
231
|
+
(_a = ffmpegProcess.stdout) === null || _a === void 0 ? void 0 : _a.on("data", (chunk) => {
|
|
232
|
+
const base64Audio = chunk.toString("base64");
|
|
233
|
+
connection.send({
|
|
234
|
+
audioBase64: base64Audio,
|
|
235
|
+
});
|
|
236
|
+
});
|
|
237
|
+
(_b = ffmpegProcess.stdout) === null || _b === void 0 ? void 0 : _b.on("end", () => {
|
|
238
|
+
if (commitStrategy === CommitStrategy.MANUAL) {
|
|
239
|
+
// Manual strategy: commit to finalize transcription, then close
|
|
240
|
+
console.log("Stream ended, sending final commit");
|
|
241
|
+
connection.commit();
|
|
242
|
+
}
|
|
243
|
+
// Close connection since no more audio will be sent
|
|
244
|
+
connection.close();
|
|
245
|
+
});
|
|
246
|
+
(_c = ffmpegProcess.stderr) === null || _c === void 0 ? void 0 : _c.on("data", (data) => {
|
|
247
|
+
// ffmpeg outputs progress info to stderr, only log errors
|
|
248
|
+
const message = data.toString();
|
|
249
|
+
if (message.includes("Error") || message.includes("error")) {
|
|
250
|
+
console.error("ffmpeg error:", message);
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
ffmpegProcess.on("error", (error) => {
|
|
254
|
+
console.error("Failed to start ffmpeg:", error);
|
|
255
|
+
});
|
|
256
|
+
ffmpegProcess.on("close", (code) => {
|
|
257
|
+
console.log(`ffmpeg process exited with code ${code}`);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
exports.ScribeRealtime = ScribeRealtime;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SpeechToText as GeneratedSpeechToText } from "../api/resources/speechToText/client/Client";
|
|
2
|
+
import { ScribeRealtime } from "./realtime";
|
|
3
|
+
export declare class SpeechToText extends GeneratedSpeechToText {
|
|
4
|
+
private _realtime;
|
|
5
|
+
get realtime(): ScribeRealtime;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpeechToText = void 0;
|
|
4
|
+
const Client_1 = require("../api/resources/speechToText/client/Client");
|
|
5
|
+
const realtime_1 = require("./realtime");
|
|
6
|
+
class SpeechToText extends Client_1.SpeechToText {
|
|
7
|
+
get realtime() {
|
|
8
|
+
if (!this._realtime) {
|
|
9
|
+
this._realtime = new realtime_1.ScribeRealtime(this._options);
|
|
10
|
+
}
|
|
11
|
+
return this._realtime;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SpeechToText = SpeechToText;
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2074,6 +2074,7 @@ Create and auto-convert a podcast project. Currently, the LLM cost is covered by
|
|
|
2074
2074
|
|
|
2075
2075
|
```typescript
|
|
2076
2076
|
await client.studio.createPodcast({
|
|
2077
|
+
safetyIdentifier: "safety-identifier",
|
|
2077
2078
|
modelId: "eleven_multilingual_v2",
|
|
2078
2079
|
mode: {
|
|
2079
2080
|
type: "conversation",
|
|
@@ -4334,7 +4335,7 @@ await client.conversationalAi.agents.create({
|
|
|
4334
4335
|
</dl>
|
|
4335
4336
|
</details>
|
|
4336
4337
|
|
|
4337
|
-
<details><summary><code>client.conversationalAi.agents.<a href="/src/api/resources/conversationalAi/resources/agents/client/Client.ts">get</a>(agentId
|
|
4338
|
+
<details><summary><code>client.conversationalAi.agents.<a href="/src/api/resources/conversationalAi/resources/agents/client/Client.ts">get</a>(agentId) -> ElevenLabs.GetAgentResponseModel</code></summary>
|
|
4338
4339
|
<dl>
|
|
4339
4340
|
<dd>
|
|
4340
4341
|
|
|
@@ -4362,9 +4363,7 @@ Retrieve config for an agent
|
|
|
4362
4363
|
<dd>
|
|
4363
4364
|
|
|
4364
4365
|
```typescript
|
|
4365
|
-
await client.conversationalAi.agents.get("agent_3701k3ttaq12ewp8b7qv5rfyszkz"
|
|
4366
|
-
versionId: "version_id",
|
|
4367
|
-
});
|
|
4366
|
+
await client.conversationalAi.agents.get("agent_3701k3ttaq12ewp8b7qv5rfyszkz");
|
|
4368
4367
|
```
|
|
4369
4368
|
|
|
4370
4369
|
</dd>
|
|
@@ -4388,14 +4387,6 @@ await client.conversationalAi.agents.get("agent_3701k3ttaq12ewp8b7qv5rfyszkz", {
|
|
|
4388
4387
|
<dl>
|
|
4389
4388
|
<dd>
|
|
4390
4389
|
|
|
4391
|
-
**request:** `ElevenLabs.conversationalAi.AgentsGetRequest`
|
|
4392
|
-
|
|
4393
|
-
</dd>
|
|
4394
|
-
</dl>
|
|
4395
|
-
|
|
4396
|
-
<dl>
|
|
4397
|
-
<dd>
|
|
4398
|
-
|
|
4399
4390
|
**requestOptions:** `Agents.RequestOptions`
|
|
4400
4391
|
|
|
4401
4392
|
</dd>
|
|
@@ -4572,6 +4563,7 @@ Returns a list of your agents and their metadata.
|
|
|
4572
4563
|
await client.conversationalAi.agents.list({
|
|
4573
4564
|
pageSize: 1,
|
|
4574
4565
|
search: "search",
|
|
4566
|
+
archived: true,
|
|
4575
4567
|
sortDirection: "asc",
|
|
4576
4568
|
sortBy: "name",
|
|
4577
4569
|
cursor: "cursor",
|
package/serialization/resources/studio/client/requests/BodyCreatePodcastV1StudioPodcastsPost.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { BodyCreatePodcastV1StudioPodcastsPostSource } from "../../types/BodyCre
|
|
|
6
6
|
import { BodyCreatePodcastV1StudioPodcastsPostQualityPreset } from "../../types/BodyCreatePodcastV1StudioPodcastsPostQualityPreset";
|
|
7
7
|
import { BodyCreatePodcastV1StudioPodcastsPostDurationScale } from "../../types/BodyCreatePodcastV1StudioPodcastsPostDurationScale";
|
|
8
8
|
import { BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization } from "../../types/BodyCreatePodcastV1StudioPodcastsPostApplyTextNormalization";
|
|
9
|
-
export declare const BodyCreatePodcastV1StudioPodcastsPost: core.serialization.Schema<serializers.BodyCreatePodcastV1StudioPodcastsPost.Raw, ElevenLabs.BodyCreatePodcastV1StudioPodcastsPost
|
|
9
|
+
export declare const BodyCreatePodcastV1StudioPodcastsPost: core.serialization.Schema<serializers.BodyCreatePodcastV1StudioPodcastsPost.Raw, Omit<ElevenLabs.BodyCreatePodcastV1StudioPodcastsPost, "safetyIdentifier">>;
|
|
10
10
|
export declare namespace BodyCreatePodcastV1StudioPodcastsPost {
|
|
11
11
|
interface Raw {
|
|
12
12
|
model_id: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as serializers from "../index";
|
|
2
|
+
import * as ElevenLabs from "../../api/index";
|
|
3
|
+
import * as core from "../../core";
|
|
4
|
+
export declare const AgentDefinitionSource: core.serialization.Schema<serializers.AgentDefinitionSource.Raw, ElevenLabs.AgentDefinitionSource>;
|
|
5
|
+
export declare namespace AgentDefinitionSource {
|
|
6
|
+
type Raw = "cli" | "ui" | "api" | "unknown";
|
|
7
|
+
}
|
|
@@ -34,6 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
37
|
+
exports.AgentDefinitionSource = void 0;
|
|
38
38
|
const core = __importStar(require("../../core"));
|
|
39
|
-
exports.
|
|
39
|
+
exports.AgentDefinitionSource = core.serialization.enum_(["cli", "ui", "api", "unknown"]);
|
|
@@ -44,4 +44,5 @@ exports.AgentSummaryResponseModel = core.serialization.object({
|
|
|
44
44
|
createdAtUnixSecs: core.serialization.property("created_at_unix_secs", core.serialization.number()),
|
|
45
45
|
accessInfo: core.serialization.property("access_info", ResourceAccessInfo_1.ResourceAccessInfo),
|
|
46
46
|
lastCallTimeUnixSecs: core.serialization.property("last_call_time_unix_secs", core.serialization.number().optional()),
|
|
47
|
+
archived: core.serialization.boolean().optional(),
|
|
47
48
|
});
|
|
@@ -3,6 +3,7 @@ import * as ElevenLabs from "../../api/index";
|
|
|
3
3
|
import * as core from "../../core";
|
|
4
4
|
import { DynamicVariableAssignment } from "./DynamicVariableAssignment";
|
|
5
5
|
import { DynamicVariablesConfig } from "./DynamicVariablesConfig";
|
|
6
|
+
import { ToolExecutionMode } from "./ToolExecutionMode";
|
|
6
7
|
export declare const ClientToolConfigInput: core.serialization.ObjectSchema<serializers.ClientToolConfigInput.Raw, ElevenLabs.ClientToolConfigInput>;
|
|
7
8
|
export declare namespace ClientToolConfigInput {
|
|
8
9
|
interface Raw {
|
|
@@ -15,5 +16,6 @@ export declare namespace ClientToolConfigInput {
|
|
|
15
16
|
parameters?: serializers.ObjectJsonSchemaPropertyInput.Raw | null;
|
|
16
17
|
expects_response?: boolean | null;
|
|
17
18
|
dynamic_variables?: DynamicVariablesConfig.Raw | null;
|
|
19
|
+
execution_mode?: ToolExecutionMode.Raw | null;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -39,6 +39,7 @@ const serializers = __importStar(require("../index"));
|
|
|
39
39
|
const core = __importStar(require("../../core"));
|
|
40
40
|
const DynamicVariableAssignment_1 = require("./DynamicVariableAssignment");
|
|
41
41
|
const DynamicVariablesConfig_1 = require("./DynamicVariablesConfig");
|
|
42
|
+
const ToolExecutionMode_1 = require("./ToolExecutionMode");
|
|
42
43
|
exports.ClientToolConfigInput = core.serialization.object({
|
|
43
44
|
name: core.serialization.string(),
|
|
44
45
|
description: core.serialization.string(),
|
|
@@ -49,4 +50,5 @@ exports.ClientToolConfigInput = core.serialization.object({
|
|
|
49
50
|
parameters: core.serialization.lazyObject(() => serializers.ObjectJsonSchemaPropertyInput).optional(),
|
|
50
51
|
expectsResponse: core.serialization.property("expects_response", core.serialization.boolean().optional()),
|
|
51
52
|
dynamicVariables: core.serialization.property("dynamic_variables", DynamicVariablesConfig_1.DynamicVariablesConfig.optional()),
|
|
53
|
+
executionMode: core.serialization.property("execution_mode", ToolExecutionMode_1.ToolExecutionMode.optional()),
|
|
52
54
|
});
|
|
@@ -3,6 +3,7 @@ import * as ElevenLabs from "../../api/index";
|
|
|
3
3
|
import * as core from "../../core";
|
|
4
4
|
import { DynamicVariableAssignment } from "./DynamicVariableAssignment";
|
|
5
5
|
import { DynamicVariablesConfig } from "./DynamicVariablesConfig";
|
|
6
|
+
import { ToolExecutionMode } from "./ToolExecutionMode";
|
|
6
7
|
export declare const ClientToolConfigOutput: core.serialization.ObjectSchema<serializers.ClientToolConfigOutput.Raw, ElevenLabs.ClientToolConfigOutput>;
|
|
7
8
|
export declare namespace ClientToolConfigOutput {
|
|
8
9
|
interface Raw {
|
|
@@ -15,5 +16,6 @@ export declare namespace ClientToolConfigOutput {
|
|
|
15
16
|
parameters?: serializers.ObjectJsonSchemaPropertyOutput.Raw | null;
|
|
16
17
|
expects_response?: boolean | null;
|
|
17
18
|
dynamic_variables?: DynamicVariablesConfig.Raw | null;
|
|
19
|
+
execution_mode?: ToolExecutionMode.Raw | null;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -39,6 +39,7 @@ const serializers = __importStar(require("../index"));
|
|
|
39
39
|
const core = __importStar(require("../../core"));
|
|
40
40
|
const DynamicVariableAssignment_1 = require("./DynamicVariableAssignment");
|
|
41
41
|
const DynamicVariablesConfig_1 = require("./DynamicVariablesConfig");
|
|
42
|
+
const ToolExecutionMode_1 = require("./ToolExecutionMode");
|
|
42
43
|
exports.ClientToolConfigOutput = core.serialization.object({
|
|
43
44
|
name: core.serialization.string(),
|
|
44
45
|
description: core.serialization.string(),
|
|
@@ -49,4 +50,5 @@ exports.ClientToolConfigOutput = core.serialization.object({
|
|
|
49
50
|
parameters: core.serialization.lazyObject(() => serializers.ObjectJsonSchemaPropertyOutput).optional(),
|
|
50
51
|
expectsResponse: core.serialization.property("expects_response", core.serialization.boolean().optional()),
|
|
51
52
|
dynamicVariables: core.serialization.property("dynamic_variables", DynamicVariablesConfig_1.DynamicVariablesConfig.optional()),
|
|
53
|
+
executionMode: core.serialization.property("execution_mode", ToolExecutionMode_1.ToolExecutionMode.optional()),
|
|
52
54
|
});
|
|
@@ -14,6 +14,8 @@ import { ConversationHistoryElevenAssistantCommonModel } from "./ConversationHis
|
|
|
14
14
|
import { ConversationInitiationSource } from "./ConversationInitiationSource";
|
|
15
15
|
import { ConversationHistoryMetadataCommonModelInitiationTrigger } from "./ConversationHistoryMetadataCommonModelInitiationTrigger";
|
|
16
16
|
import { AsyncConversationMetadata } from "./AsyncConversationMetadata";
|
|
17
|
+
import { WhatsAppConversationInfo } from "./WhatsAppConversationInfo";
|
|
18
|
+
import { AgentDefinitionSource } from "./AgentDefinitionSource";
|
|
17
19
|
export declare const ConversationHistoryMetadataCommonModel: core.serialization.ObjectSchema<serializers.ConversationHistoryMetadataCommonModel.Raw, ElevenLabs.ConversationHistoryMetadataCommonModel>;
|
|
18
20
|
export declare namespace ConversationHistoryMetadataCommonModel {
|
|
19
21
|
interface Raw {
|
|
@@ -40,5 +42,8 @@ export declare namespace ConversationHistoryMetadataCommonModel {
|
|
|
40
42
|
timezone?: string | null;
|
|
41
43
|
initiation_trigger?: ConversationHistoryMetadataCommonModelInitiationTrigger.Raw | null;
|
|
42
44
|
async_metadata?: AsyncConversationMetadata.Raw | null;
|
|
45
|
+
whatsapp?: WhatsAppConversationInfo.Raw | null;
|
|
46
|
+
agent_created_from?: AgentDefinitionSource.Raw | null;
|
|
47
|
+
agent_last_updated_from?: AgentDefinitionSource.Raw | null;
|
|
43
48
|
}
|
|
44
49
|
}
|
|
@@ -49,6 +49,8 @@ const ConversationHistoryElevenAssistantCommonModel_1 = require("./ConversationH
|
|
|
49
49
|
const ConversationInitiationSource_1 = require("./ConversationInitiationSource");
|
|
50
50
|
const ConversationHistoryMetadataCommonModelInitiationTrigger_1 = require("./ConversationHistoryMetadataCommonModelInitiationTrigger");
|
|
51
51
|
const AsyncConversationMetadata_1 = require("./AsyncConversationMetadata");
|
|
52
|
+
const WhatsAppConversationInfo_1 = require("./WhatsAppConversationInfo");
|
|
53
|
+
const AgentDefinitionSource_1 = require("./AgentDefinitionSource");
|
|
52
54
|
exports.ConversationHistoryMetadataCommonModel = core.serialization.object({
|
|
53
55
|
startTimeUnixSecs: core.serialization.property("start_time_unix_secs", core.serialization.number()),
|
|
54
56
|
acceptedTimeUnixSecs: core.serialization.property("accepted_time_unix_secs", core.serialization.number().optional()),
|
|
@@ -73,4 +75,7 @@ exports.ConversationHistoryMetadataCommonModel = core.serialization.object({
|
|
|
73
75
|
timezone: core.serialization.string().optional(),
|
|
74
76
|
initiationTrigger: core.serialization.property("initiation_trigger", ConversationHistoryMetadataCommonModelInitiationTrigger_1.ConversationHistoryMetadataCommonModelInitiationTrigger.optional()),
|
|
75
77
|
asyncMetadata: core.serialization.property("async_metadata", AsyncConversationMetadata_1.AsyncConversationMetadata.optional()),
|
|
78
|
+
whatsapp: WhatsAppConversationInfo_1.WhatsAppConversationInfo.optional(),
|
|
79
|
+
agentCreatedFrom: core.serialization.property("agent_created_from", AgentDefinitionSource_1.AgentDefinitionSource.optional()),
|
|
80
|
+
agentLastUpdatedFrom: core.serialization.property("agent_last_updated_from", AgentDefinitionSource_1.AgentDefinitionSource.optional()),
|
|
76
81
|
});
|
|
@@ -38,6 +38,4 @@ exports.CreateAgentResponseModel = void 0;
|
|
|
38
38
|
const core = __importStar(require("../../core"));
|
|
39
39
|
exports.CreateAgentResponseModel = core.serialization.object({
|
|
40
40
|
agentId: core.serialization.property("agent_id", core.serialization.string()),
|
|
41
|
-
mainBranchId: core.serialization.property("main_branch_id", core.serialization.string().optional()),
|
|
42
|
-
initialVersionId: core.serialization.property("initial_version_id", core.serialization.string().optional()),
|
|
43
41
|
});
|
|
@@ -52,5 +52,4 @@ exports.GetAgentResponseModel = core.serialization.object({
|
|
|
52
52
|
workflow: AgentWorkflowResponseModel_1.AgentWorkflowResponseModel.optional(),
|
|
53
53
|
accessInfo: core.serialization.property("access_info", ResourceAccessInfo_1.ResourceAccessInfo.optional()),
|
|
54
54
|
tags: core.serialization.list(core.serialization.string()).optional(),
|
|
55
|
-
versionId: core.serialization.property("version_id", core.serialization.string().optional()),
|
|
56
55
|
});
|
|
@@ -53,6 +53,7 @@ exports.ProjectExtendedResponse = core.serialization.object({
|
|
|
53
53
|
projectId: core.serialization.property("project_id", core.serialization.string()),
|
|
54
54
|
name: core.serialization.string(),
|
|
55
55
|
createDateUnix: core.serialization.property("create_date_unix", core.serialization.number()),
|
|
56
|
+
createdByUserId: core.serialization.property("created_by_user_id", core.serialization.string().optional()),
|
|
56
57
|
defaultTitleVoiceId: core.serialization.property("default_title_voice_id", core.serialization.string()),
|
|
57
58
|
defaultParagraphVoiceId: core.serialization.property("default_paragraph_voice_id", core.serialization.string()),
|
|
58
59
|
defaultModelId: core.serialization.property("default_model_id", core.serialization.string()),
|
|
@@ -48,6 +48,7 @@ exports.ProjectResponse = core.serialization.object({
|
|
|
48
48
|
projectId: core.serialization.property("project_id", core.serialization.string()),
|
|
49
49
|
name: core.serialization.string(),
|
|
50
50
|
createDateUnix: core.serialization.property("create_date_unix", core.serialization.number()),
|
|
51
|
+
createdByUserId: core.serialization.property("created_by_user_id", core.serialization.string().optional()),
|
|
51
52
|
defaultTitleVoiceId: core.serialization.property("default_title_voice_id", core.serialization.string()),
|
|
52
53
|
defaultParagraphVoiceId: core.serialization.property("default_paragraph_voice_id", core.serialization.string()),
|
|
53
54
|
defaultModelId: core.serialization.property("default_model_id", core.serialization.string()),
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as serializers from "../index";
|
|
2
|
+
import * as ElevenLabs from "../../api/index";
|
|
3
|
+
import * as core from "../../core";
|
|
4
|
+
export declare const ToolExecutionMode: core.serialization.Schema<serializers.ToolExecutionMode.Raw, ElevenLabs.ToolExecutionMode>;
|
|
5
|
+
export declare namespace ToolExecutionMode {
|
|
6
|
+
type Raw = "immediate" | "post_tool_speech" | "async";
|
|
7
|
+
}
|
|
@@ -34,6 +34,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.
|
|
37
|
+
exports.ToolExecutionMode = void 0;
|
|
38
38
|
const core = __importStar(require("../../core"));
|
|
39
|
-
exports.
|
|
39
|
+
exports.ToolExecutionMode = core.serialization.enum_(["immediate", "post_tool_speech", "async"]);
|
|
@@ -4,6 +4,7 @@ import * as core from "../../core";
|
|
|
4
4
|
import { DynamicVariableAssignment } from "./DynamicVariableAssignment";
|
|
5
5
|
import { WebhookToolApiSchemaConfigInput } from "./WebhookToolApiSchemaConfigInput";
|
|
6
6
|
import { DynamicVariablesConfig } from "./DynamicVariablesConfig";
|
|
7
|
+
import { ToolExecutionMode } from "./ToolExecutionMode";
|
|
7
8
|
export declare const WebhookToolConfigInput: core.serialization.ObjectSchema<serializers.WebhookToolConfigInput.Raw, ElevenLabs.WebhookToolConfigInput>;
|
|
8
9
|
export declare namespace WebhookToolConfigInput {
|
|
9
10
|
interface Raw {
|
|
@@ -15,5 +16,6 @@ export declare namespace WebhookToolConfigInput {
|
|
|
15
16
|
assignments?: DynamicVariableAssignment.Raw[] | null;
|
|
16
17
|
api_schema: WebhookToolApiSchemaConfigInput.Raw;
|
|
17
18
|
dynamic_variables?: DynamicVariablesConfig.Raw | null;
|
|
19
|
+
execution_mode?: ToolExecutionMode.Raw | null;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -39,6 +39,7 @@ const core = __importStar(require("../../core"));
|
|
|
39
39
|
const DynamicVariableAssignment_1 = require("./DynamicVariableAssignment");
|
|
40
40
|
const WebhookToolApiSchemaConfigInput_1 = require("./WebhookToolApiSchemaConfigInput");
|
|
41
41
|
const DynamicVariablesConfig_1 = require("./DynamicVariablesConfig");
|
|
42
|
+
const ToolExecutionMode_1 = require("./ToolExecutionMode");
|
|
42
43
|
exports.WebhookToolConfigInput = core.serialization.object({
|
|
43
44
|
name: core.serialization.string(),
|
|
44
45
|
description: core.serialization.string(),
|
|
@@ -48,4 +49,5 @@ exports.WebhookToolConfigInput = core.serialization.object({
|
|
|
48
49
|
assignments: core.serialization.list(DynamicVariableAssignment_1.DynamicVariableAssignment).optional(),
|
|
49
50
|
apiSchema: core.serialization.property("api_schema", WebhookToolApiSchemaConfigInput_1.WebhookToolApiSchemaConfigInput),
|
|
50
51
|
dynamicVariables: core.serialization.property("dynamic_variables", DynamicVariablesConfig_1.DynamicVariablesConfig.optional()),
|
|
52
|
+
executionMode: core.serialization.property("execution_mode", ToolExecutionMode_1.ToolExecutionMode.optional()),
|
|
51
53
|
});
|
|
@@ -4,6 +4,7 @@ import * as core from "../../core";
|
|
|
4
4
|
import { DynamicVariableAssignment } from "./DynamicVariableAssignment";
|
|
5
5
|
import { WebhookToolApiSchemaConfigOutput } from "./WebhookToolApiSchemaConfigOutput";
|
|
6
6
|
import { DynamicVariablesConfig } from "./DynamicVariablesConfig";
|
|
7
|
+
import { ToolExecutionMode } from "./ToolExecutionMode";
|
|
7
8
|
export declare const WebhookToolConfigOutput: core.serialization.ObjectSchema<serializers.WebhookToolConfigOutput.Raw, ElevenLabs.WebhookToolConfigOutput>;
|
|
8
9
|
export declare namespace WebhookToolConfigOutput {
|
|
9
10
|
interface Raw {
|
|
@@ -15,5 +16,6 @@ export declare namespace WebhookToolConfigOutput {
|
|
|
15
16
|
assignments?: DynamicVariableAssignment.Raw[] | null;
|
|
16
17
|
api_schema: WebhookToolApiSchemaConfigOutput.Raw;
|
|
17
18
|
dynamic_variables?: DynamicVariablesConfig.Raw | null;
|
|
19
|
+
execution_mode?: ToolExecutionMode.Raw | null;
|
|
18
20
|
}
|
|
19
21
|
}
|
|
@@ -39,6 +39,7 @@ const core = __importStar(require("../../core"));
|
|
|
39
39
|
const DynamicVariableAssignment_1 = require("./DynamicVariableAssignment");
|
|
40
40
|
const WebhookToolApiSchemaConfigOutput_1 = require("./WebhookToolApiSchemaConfigOutput");
|
|
41
41
|
const DynamicVariablesConfig_1 = require("./DynamicVariablesConfig");
|
|
42
|
+
const ToolExecutionMode_1 = require("./ToolExecutionMode");
|
|
42
43
|
exports.WebhookToolConfigOutput = core.serialization.object({
|
|
43
44
|
name: core.serialization.string(),
|
|
44
45
|
description: core.serialization.string(),
|
|
@@ -48,4 +49,5 @@ exports.WebhookToolConfigOutput = core.serialization.object({
|
|
|
48
49
|
assignments: core.serialization.list(DynamicVariableAssignment_1.DynamicVariableAssignment).optional(),
|
|
49
50
|
apiSchema: core.serialization.property("api_schema", WebhookToolApiSchemaConfigOutput_1.WebhookToolApiSchemaConfigOutput),
|
|
50
51
|
dynamicVariables: core.serialization.property("dynamic_variables", DynamicVariablesConfig_1.DynamicVariablesConfig.optional()),
|
|
52
|
+
executionMode: core.serialization.property("execution_mode", ToolExecutionMode_1.ToolExecutionMode.optional()),
|
|
51
53
|
});
|