@elevenlabs/elevenlabs-js 2.12.0 → 2.12.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/Client.d.ts +0 -160
- package/Client.js +2 -687
- package/api/index.d.ts +0 -1
- package/api/index.js +0 -1
- package/api/resources/conversationalAi/client/Client.d.ts +3 -0
- package/api/resources/conversationalAi/client/Client.js +25 -20
- package/api/resources/conversationalAi/resources/agents/client/Client.d.ts +18 -0
- package/api/resources/conversationalAi/resources/agents/client/Client.js +80 -0
- package/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.d.ts +1 -1
- package/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
- package/api/resources/conversationalAi/resources/index.d.ts +3 -0
- package/api/resources/conversationalAi/resources/index.js +4 -1
- package/api/types/ClientEvent.d.ts +2 -1
- package/api/types/ClientEvent.js +1 -0
- package/api/types/FeaturesUsageCommonModel.d.ts +1 -0
- package/api/types/TestsFeatureUsageCommonModel.d.ts +8 -0
- package/api/types/UnitTestRunResponseModel.d.ts +1 -0
- package/api/types/index.d.ts +1 -2
- package/api/types/index.js +1 -2
- package/dist/Client.d.ts +0 -160
- package/dist/Client.js +2 -687
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.js +0 -1
- package/dist/api/resources/conversationalAi/client/Client.d.ts +3 -0
- package/dist/api/resources/conversationalAi/client/Client.js +25 -20
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.d.ts +18 -0
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.js +80 -0
- package/dist/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.d.ts +1 -1
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/api/resources/conversationalAi/resources/index.d.ts +3 -0
- package/dist/api/resources/conversationalAi/resources/index.js +4 -1
- package/dist/api/types/ClientEvent.d.ts +2 -1
- package/dist/api/types/ClientEvent.js +1 -0
- package/dist/api/types/FeaturesUsageCommonModel.d.ts +1 -0
- package/dist/api/types/TestsFeatureUsageCommonModel.d.ts +8 -0
- package/dist/api/types/UnitTestRunResponseModel.d.ts +1 -0
- package/dist/api/types/index.d.ts +1 -2
- package/dist/api/types/index.js +1 -2
- package/dist/serialization/index.d.ts +0 -1
- package/dist/serialization/index.js +0 -1
- package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
- package/dist/serialization/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +3 -3
- package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/conversationalAi/resources/agents/client/requests/index.js +3 -1
- package/dist/serialization/resources/conversationalAi/resources/index.d.ts +3 -0
- package/dist/serialization/resources/conversationalAi/resources/index.js +4 -1
- package/dist/serialization/types/ClientEvent.d.ts +1 -1
- package/dist/serialization/types/ClientEvent.js +1 -0
- package/dist/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
- package/dist/serialization/types/FeaturesUsageCommonModel.js +2 -0
- package/dist/serialization/types/TestsFeatureUsageCommonModel.d.ts +14 -0
- package/{serialization/types/CreateUnitTestRequestDynamicVariablesValue.js → dist/serialization/types/TestsFeatureUsageCommonModel.js} +6 -7
- package/dist/serialization/types/UnitTestRunResponseModel.d.ts +1 -0
- package/dist/serialization/types/UnitTestRunResponseModel.js +1 -0
- package/dist/serialization/types/index.d.ts +1 -2
- package/dist/serialization/types/index.js +1 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +648 -0
- package/serialization/index.d.ts +0 -1
- package/serialization/index.js +0 -1
- package/serialization/resources/conversationalAi/resources/agents/client/requests/RunAgentTestsRequestModel.d.ts +15 -0
- package/serialization/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +3 -3
- package/serialization/resources/conversationalAi/resources/agents/client/requests/index.d.ts +1 -0
- package/serialization/resources/conversationalAi/resources/agents/client/requests/index.js +3 -1
- package/serialization/resources/conversationalAi/resources/index.d.ts +3 -0
- package/serialization/resources/conversationalAi/resources/index.js +4 -1
- package/serialization/types/ClientEvent.d.ts +1 -1
- package/serialization/types/ClientEvent.js +1 -0
- package/serialization/types/FeaturesUsageCommonModel.d.ts +2 -0
- package/serialization/types/FeaturesUsageCommonModel.js +2 -0
- package/serialization/types/TestsFeatureUsageCommonModel.d.ts +14 -0
- package/{dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.js → serialization/types/TestsFeatureUsageCommonModel.js} +6 -7
- package/serialization/types/UnitTestRunResponseModel.d.ts +1 -0
- package/serialization/types/UnitTestRunResponseModel.js +1 -0
- package/serialization/types/index.d.ts +1 -2
- package/serialization/types/index.js +1 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/client/index.d.ts +0 -1
- package/api/client/index.js +0 -17
- package/api/client/requests/CreateUnitTestRequest.d.ts +0 -37
- package/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +0 -21
- package/api/client/requests/ListTestsByIdsRequestModel.d.ts +0 -13
- package/api/client/requests/ListTestsByIdsRequestModel.js +0 -5
- package/api/client/requests/ResubmitTestsRequestModel.d.ts +0 -19
- package/api/client/requests/ResubmitTestsRequestModel.js +0 -5
- package/api/client/requests/UpdateUnitTestRequest.d.ts +0 -37
- package/api/client/requests/UpdateUnitTestRequest.js +0 -5
- package/api/client/requests/index.d.ts +0 -6
- package/api/client/requests/index.js +0 -2
- package/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -4
- package/api/types/CreateUnitTestRequestDynamicVariablesValue.js +0 -5
- package/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -4
- package/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +0 -5
- package/dist/api/client/index.d.ts +0 -1
- package/dist/api/client/index.js +0 -17
- package/dist/api/client/requests/CreateUnitTestRequest.d.ts +0 -37
- package/dist/api/client/requests/CreateUnitTestRequest.js +0 -5
- package/dist/api/client/requests/ListChatResponseTestsRouteRequest.d.ts +0 -21
- package/dist/api/client/requests/ListChatResponseTestsRouteRequest.js +0 -5
- package/dist/api/client/requests/ListTestsByIdsRequestModel.d.ts +0 -13
- package/dist/api/client/requests/ListTestsByIdsRequestModel.js +0 -5
- package/dist/api/client/requests/ResubmitTestsRequestModel.d.ts +0 -19
- package/dist/api/client/requests/ResubmitTestsRequestModel.js +0 -5
- package/dist/api/client/requests/UpdateUnitTestRequest.d.ts +0 -37
- package/dist/api/client/requests/UpdateUnitTestRequest.js +0 -5
- package/dist/api/client/requests/index.d.ts +0 -6
- package/dist/api/client/requests/index.js +0 -2
- package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -4
- package/dist/api/types/CreateUnitTestRequestDynamicVariablesValue.js +0 -5
- package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -4
- package/dist/api/types/UpdateUnitTestRequestDynamicVariablesValue.js +0 -5
- package/dist/serialization/client/index.d.ts +0 -1
- package/dist/serialization/client/index.js +0 -17
- package/dist/serialization/client/requests/CreateUnitTestRequest.d.ts +0 -23
- package/dist/serialization/client/requests/CreateUnitTestRequest.js +0 -56
- package/dist/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +0 -12
- package/dist/serialization/client/requests/ListTestsByIdsRequestModel.js +0 -43
- package/dist/serialization/client/requests/ResubmitTestsRequestModel.d.ts +0 -15
- package/dist/serialization/client/requests/ResubmitTestsRequestModel.js +0 -46
- package/dist/serialization/client/requests/RunAgentTestsRequestModel.d.ts +0 -15
- package/dist/serialization/client/requests/UpdateUnitTestRequest.d.ts +0 -23
- package/dist/serialization/client/requests/UpdateUnitTestRequest.js +0 -56
- package/dist/serialization/client/requests/index.d.ts +0 -5
- package/dist/serialization/client/requests/index.js +0 -13
- package/dist/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
- package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
- package/dist/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +0 -46
- package/serialization/client/index.d.ts +0 -1
- package/serialization/client/index.js +0 -17
- package/serialization/client/requests/CreateUnitTestRequest.d.ts +0 -23
- package/serialization/client/requests/CreateUnitTestRequest.js +0 -56
- package/serialization/client/requests/ListTestsByIdsRequestModel.d.ts +0 -12
- package/serialization/client/requests/ListTestsByIdsRequestModel.js +0 -43
- package/serialization/client/requests/ResubmitTestsRequestModel.d.ts +0 -15
- package/serialization/client/requests/ResubmitTestsRequestModel.js +0 -46
- package/serialization/client/requests/RunAgentTestsRequestModel.d.ts +0 -15
- package/serialization/client/requests/UpdateUnitTestRequest.d.ts +0 -23
- package/serialization/client/requests/UpdateUnitTestRequest.js +0 -56
- package/serialization/client/requests/index.d.ts +0 -5
- package/serialization/client/requests/index.js +0 -13
- package/serialization/types/CreateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
- package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.d.ts +0 -10
- package/serialization/types/UpdateUnitTestRequestDynamicVariablesValue.js +0 -46
- /package/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +0 -0
- /package/api/{client/requests/CreateUnitTestRequest.js → types/TestsFeatureUsageCommonModel.js} +0 -0
- /package/dist/api/{client → resources/conversationalAi/resources/agents/client}/requests/RunAgentTestsRequestModel.js +0 -0
- /package/{api/client/requests/ListChatResponseTestsRouteRequest.js → dist/api/types/TestsFeatureUsageCommonModel.js} +0 -0
package/api/index.d.ts
CHANGED
package/api/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as ElevenLabs from "../../../index";
|
|
|
7
7
|
import { Conversations } from "../resources/conversations/client/Client";
|
|
8
8
|
import { Twilio } from "../resources/twilio/client/Client";
|
|
9
9
|
import { Agents } from "../resources/agents/client/Client";
|
|
10
|
+
import { Tests } from "../resources/tests/client/Client";
|
|
10
11
|
import { PhoneNumbers } from "../resources/phoneNumbers/client/Client";
|
|
11
12
|
import { LlmUsage } from "../resources/llmUsage/client/Client";
|
|
12
13
|
import { KnowledgeBase } from "../resources/knowledgeBase/client/Client";
|
|
@@ -45,6 +46,7 @@ export declare class ConversationalAi {
|
|
|
45
46
|
protected _conversations: Conversations | undefined;
|
|
46
47
|
protected _twilio: Twilio | undefined;
|
|
47
48
|
protected _agents: Agents | undefined;
|
|
49
|
+
protected _tests: Tests | undefined;
|
|
48
50
|
protected _phoneNumbers: PhoneNumbers | undefined;
|
|
49
51
|
protected _llmUsage: LlmUsage | undefined;
|
|
50
52
|
protected _knowledgeBase: KnowledgeBase | undefined;
|
|
@@ -59,6 +61,7 @@ export declare class ConversationalAi {
|
|
|
59
61
|
get conversations(): Conversations;
|
|
60
62
|
get twilio(): Twilio;
|
|
61
63
|
get agents(): Agents;
|
|
64
|
+
get tests(): Tests;
|
|
62
65
|
get phoneNumbers(): PhoneNumbers;
|
|
63
66
|
get llmUsage(): LlmUsage;
|
|
64
67
|
get knowledgeBase(): KnowledgeBase;
|
|
@@ -55,16 +55,17 @@ const errors = __importStar(require("../../../../errors/index"));
|
|
|
55
55
|
const Client_1 = require("../resources/conversations/client/Client");
|
|
56
56
|
const Client_2 = require("../resources/twilio/client/Client");
|
|
57
57
|
const Client_3 = require("../resources/agents/client/Client");
|
|
58
|
-
const Client_4 = require("../resources/
|
|
59
|
-
const Client_5 = require("../resources/
|
|
60
|
-
const Client_6 = require("../resources/
|
|
61
|
-
const Client_7 = require("../resources/
|
|
62
|
-
const Client_8 = require("../resources/
|
|
63
|
-
const Client_9 = require("../resources/
|
|
64
|
-
const Client_10 = require("../resources/
|
|
65
|
-
const Client_11 = require("../resources/
|
|
66
|
-
const Client_12 = require("../resources/
|
|
67
|
-
const Client_13 = require("../resources/
|
|
58
|
+
const Client_4 = require("../resources/tests/client/Client");
|
|
59
|
+
const Client_5 = require("../resources/phoneNumbers/client/Client");
|
|
60
|
+
const Client_6 = require("../resources/llmUsage/client/Client");
|
|
61
|
+
const Client_7 = require("../resources/knowledgeBase/client/Client");
|
|
62
|
+
const Client_8 = require("../resources/tools/client/Client");
|
|
63
|
+
const Client_9 = require("../resources/settings/client/Client");
|
|
64
|
+
const Client_10 = require("../resources/secrets/client/Client");
|
|
65
|
+
const Client_11 = require("../resources/batchCalls/client/Client");
|
|
66
|
+
const Client_12 = require("../resources/sipTrunk/client/Client");
|
|
67
|
+
const Client_13 = require("../resources/mcpServers/client/Client");
|
|
68
|
+
const Client_14 = require("../resources/dashboard/client/Client");
|
|
68
69
|
class ConversationalAi {
|
|
69
70
|
constructor(_options = {}) {
|
|
70
71
|
this._options = _options;
|
|
@@ -81,45 +82,49 @@ class ConversationalAi {
|
|
|
81
82
|
var _a;
|
|
82
83
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_3.Agents(this._options)));
|
|
83
84
|
}
|
|
85
|
+
get tests() {
|
|
86
|
+
var _a;
|
|
87
|
+
return ((_a = this._tests) !== null && _a !== void 0 ? _a : (this._tests = new Client_4.Tests(this._options)));
|
|
88
|
+
}
|
|
84
89
|
get phoneNumbers() {
|
|
85
90
|
var _a;
|
|
86
|
-
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new
|
|
91
|
+
return ((_a = this._phoneNumbers) !== null && _a !== void 0 ? _a : (this._phoneNumbers = new Client_5.PhoneNumbers(this._options)));
|
|
87
92
|
}
|
|
88
93
|
get llmUsage() {
|
|
89
94
|
var _a;
|
|
90
|
-
return ((_a = this._llmUsage) !== null && _a !== void 0 ? _a : (this._llmUsage = new
|
|
95
|
+
return ((_a = this._llmUsage) !== null && _a !== void 0 ? _a : (this._llmUsage = new Client_6.LlmUsage(this._options)));
|
|
91
96
|
}
|
|
92
97
|
get knowledgeBase() {
|
|
93
98
|
var _a;
|
|
94
|
-
return ((_a = this._knowledgeBase) !== null && _a !== void 0 ? _a : (this._knowledgeBase = new
|
|
99
|
+
return ((_a = this._knowledgeBase) !== null && _a !== void 0 ? _a : (this._knowledgeBase = new Client_7.KnowledgeBase(this._options)));
|
|
95
100
|
}
|
|
96
101
|
get tools() {
|
|
97
102
|
var _a;
|
|
98
|
-
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new
|
|
103
|
+
return ((_a = this._tools) !== null && _a !== void 0 ? _a : (this._tools = new Client_8.Tools(this._options)));
|
|
99
104
|
}
|
|
100
105
|
get settings() {
|
|
101
106
|
var _a;
|
|
102
|
-
return ((_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = new
|
|
107
|
+
return ((_a = this._settings) !== null && _a !== void 0 ? _a : (this._settings = new Client_9.Settings(this._options)));
|
|
103
108
|
}
|
|
104
109
|
get secrets() {
|
|
105
110
|
var _a;
|
|
106
|
-
return ((_a = this._secrets) !== null && _a !== void 0 ? _a : (this._secrets = new
|
|
111
|
+
return ((_a = this._secrets) !== null && _a !== void 0 ? _a : (this._secrets = new Client_10.Secrets(this._options)));
|
|
107
112
|
}
|
|
108
113
|
get batchCalls() {
|
|
109
114
|
var _a;
|
|
110
|
-
return ((_a = this._batchCalls) !== null && _a !== void 0 ? _a : (this._batchCalls = new
|
|
115
|
+
return ((_a = this._batchCalls) !== null && _a !== void 0 ? _a : (this._batchCalls = new Client_11.BatchCalls(this._options)));
|
|
111
116
|
}
|
|
112
117
|
get sipTrunk() {
|
|
113
118
|
var _a;
|
|
114
|
-
return ((_a = this._sipTrunk) !== null && _a !== void 0 ? _a : (this._sipTrunk = new
|
|
119
|
+
return ((_a = this._sipTrunk) !== null && _a !== void 0 ? _a : (this._sipTrunk = new Client_12.SipTrunk(this._options)));
|
|
115
120
|
}
|
|
116
121
|
get mcpServers() {
|
|
117
122
|
var _a;
|
|
118
|
-
return ((_a = this._mcpServers) !== null && _a !== void 0 ? _a : (this._mcpServers = new
|
|
123
|
+
return ((_a = this._mcpServers) !== null && _a !== void 0 ? _a : (this._mcpServers = new Client_13.McpServers(this._options)));
|
|
119
124
|
}
|
|
120
125
|
get dashboard() {
|
|
121
126
|
var _a;
|
|
122
|
-
return ((_a = this._dashboard) !== null && _a !== void 0 ? _a : (this._dashboard = new
|
|
127
|
+
return ((_a = this._dashboard) !== null && _a !== void 0 ? _a : (this._dashboard = new Client_14.Dashboard(this._options)));
|
|
123
128
|
}
|
|
124
129
|
/**
|
|
125
130
|
* Upload a file or webpage URL to create a knowledge base document. <br> <Note> After creating the document, update the agent's knowledge base by calling [Update agent](/docs/api-reference/agents/update). </Note>
|
|
@@ -166,4 +166,22 @@ export declare class Agents {
|
|
|
166
166
|
*/
|
|
167
167
|
simulateConversationStream(agentId: string, request: ElevenLabs.conversationalAi.BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
|
|
168
168
|
private __simulateConversationStream;
|
|
169
|
+
/**
|
|
170
|
+
* Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
|
|
171
|
+
*
|
|
172
|
+
* @param {string} agentId - The id of an agent. This is returned on agent creation.
|
|
173
|
+
* @param {ElevenLabs.conversationalAi.RunAgentTestsRequestModel} request
|
|
174
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
175
|
+
*
|
|
176
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* await client.conversationalAi.agents.runTests("21m00Tcm4TlvDq8ikWAM", {
|
|
180
|
+
* tests: [{
|
|
181
|
+
* testId: "test_id"
|
|
182
|
+
* }]
|
|
183
|
+
* })
|
|
184
|
+
*/
|
|
185
|
+
runTests(agentId: string, request: ElevenLabs.conversationalAi.RunAgentTestsRequestModel, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetTestSuiteInvocationResponseModel>;
|
|
186
|
+
private __runTests;
|
|
169
187
|
}
|
|
@@ -671,5 +671,85 @@ class Agents {
|
|
|
671
671
|
}
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
|
|
676
|
+
*
|
|
677
|
+
* @param {string} agentId - The id of an agent. This is returned on agent creation.
|
|
678
|
+
* @param {ElevenLabs.conversationalAi.RunAgentTestsRequestModel} request
|
|
679
|
+
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
680
|
+
*
|
|
681
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
682
|
+
*
|
|
683
|
+
* @example
|
|
684
|
+
* await client.conversationalAi.agents.runTests("21m00Tcm4TlvDq8ikWAM", {
|
|
685
|
+
* tests: [{
|
|
686
|
+
* testId: "test_id"
|
|
687
|
+
* }]
|
|
688
|
+
* })
|
|
689
|
+
*/
|
|
690
|
+
runTests(agentId, request, requestOptions) {
|
|
691
|
+
return core.HttpResponsePromise.fromPromise(this.__runTests(agentId, request, requestOptions));
|
|
692
|
+
}
|
|
693
|
+
__runTests(agentId, request, requestOptions) {
|
|
694
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
695
|
+
var _a, _b, _c;
|
|
696
|
+
const _response = yield core.fetcher({
|
|
697
|
+
url: core.url.join((_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, `v1/convai/agents/${encodeURIComponent(agentId)}/run-tests`),
|
|
698
|
+
method: "POST",
|
|
699
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
700
|
+
contentType: "application/json",
|
|
701
|
+
requestType: "json",
|
|
702
|
+
body: serializers.conversationalAi.RunAgentTestsRequestModel.jsonOrThrow(request, {
|
|
703
|
+
unrecognizedObjectKeys: "strip",
|
|
704
|
+
}),
|
|
705
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
706
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
707
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
708
|
+
});
|
|
709
|
+
if (_response.ok) {
|
|
710
|
+
return {
|
|
711
|
+
data: serializers.GetTestSuiteInvocationResponseModel.parseOrThrow(_response.body, {
|
|
712
|
+
unrecognizedObjectKeys: "passthrough",
|
|
713
|
+
allowUnrecognizedUnionMembers: true,
|
|
714
|
+
allowUnrecognizedEnumValues: true,
|
|
715
|
+
breadcrumbsPrefix: ["response"],
|
|
716
|
+
}),
|
|
717
|
+
rawResponse: _response.rawResponse,
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
if (_response.error.reason === "status-code") {
|
|
721
|
+
switch (_response.error.statusCode) {
|
|
722
|
+
case 422:
|
|
723
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
724
|
+
unrecognizedObjectKeys: "passthrough",
|
|
725
|
+
allowUnrecognizedUnionMembers: true,
|
|
726
|
+
allowUnrecognizedEnumValues: true,
|
|
727
|
+
breadcrumbsPrefix: ["response"],
|
|
728
|
+
}), _response.rawResponse);
|
|
729
|
+
default:
|
|
730
|
+
throw new errors.ElevenLabsError({
|
|
731
|
+
statusCode: _response.error.statusCode,
|
|
732
|
+
body: _response.error.body,
|
|
733
|
+
rawResponse: _response.rawResponse,
|
|
734
|
+
});
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
switch (_response.error.reason) {
|
|
738
|
+
case "non-json":
|
|
739
|
+
throw new errors.ElevenLabsError({
|
|
740
|
+
statusCode: _response.error.statusCode,
|
|
741
|
+
body: _response.error.rawBody,
|
|
742
|
+
rawResponse: _response.rawResponse,
|
|
743
|
+
});
|
|
744
|
+
case "timeout":
|
|
745
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/convai/agents/{agent_id}/run-tests.");
|
|
746
|
+
case "unknown":
|
|
747
|
+
throw new errors.ElevenLabsError({
|
|
748
|
+
message: _response.error.errorMessage,
|
|
749
|
+
rawResponse: _response.rawResponse,
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
});
|
|
753
|
+
}
|
|
674
754
|
}
|
|
675
755
|
exports.Agents = Agents;
|
|
@@ -4,3 +4,4 @@ export { type AgentsListRequest } from "./AgentsListRequest";
|
|
|
4
4
|
export { type BodyDuplicateAgentV1ConvaiAgentsAgentIdDuplicatePost } from "./BodyDuplicateAgentV1ConvaiAgentsAgentIdDuplicatePost";
|
|
5
5
|
export { type BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost } from "./BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost";
|
|
6
6
|
export { type BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost } from "./BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost";
|
|
7
|
+
export { type RunAgentTestsRequestModel } from "./RunAgentTestsRequestModel";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * as conversations from "./conversations";
|
|
2
2
|
export * from "./conversations/types";
|
|
3
|
+
export * as tests from "./tests";
|
|
4
|
+
export * from "./tests/types";
|
|
3
5
|
export * as phoneNumbers from "./phoneNumbers";
|
|
4
6
|
export * from "./phoneNumbers/types";
|
|
5
7
|
export * as dashboard from "./dashboard";
|
|
@@ -16,6 +18,7 @@ export * as mcpServers from "./mcpServers";
|
|
|
16
18
|
export * from "./conversations/client/requests";
|
|
17
19
|
export * from "./twilio/client/requests";
|
|
18
20
|
export * from "./agents/client/requests";
|
|
21
|
+
export * from "./tests/client/requests";
|
|
19
22
|
export * from "./phoneNumbers/client/requests";
|
|
20
23
|
export * from "./llmUsage/client/requests";
|
|
21
24
|
export * from "./knowledgeBase/client/requests";
|
|
@@ -36,9 +36,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.mcpServers = exports.sipTrunk = exports.batchCalls = exports.secrets = exports.settings = exports.tools = exports.llmUsage = exports.agents = exports.twilio = exports.knowledgeBase = exports.dashboard = exports.phoneNumbers = exports.conversations = void 0;
|
|
39
|
+
exports.mcpServers = exports.sipTrunk = exports.batchCalls = exports.secrets = exports.settings = exports.tools = exports.llmUsage = exports.agents = exports.twilio = exports.knowledgeBase = exports.dashboard = exports.phoneNumbers = exports.tests = exports.conversations = void 0;
|
|
40
40
|
exports.conversations = __importStar(require("./conversations"));
|
|
41
41
|
__exportStar(require("./conversations/types"), exports);
|
|
42
|
+
exports.tests = __importStar(require("./tests"));
|
|
43
|
+
__exportStar(require("./tests/types"), exports);
|
|
42
44
|
exports.phoneNumbers = __importStar(require("./phoneNumbers"));
|
|
43
45
|
__exportStar(require("./phoneNumbers/types"), exports);
|
|
44
46
|
exports.dashboard = __importStar(require("./dashboard"));
|
|
@@ -55,6 +57,7 @@ exports.mcpServers = __importStar(require("./mcpServers"));
|
|
|
55
57
|
__exportStar(require("./conversations/client/requests"), exports);
|
|
56
58
|
__exportStar(require("./twilio/client/requests"), exports);
|
|
57
59
|
__exportStar(require("./agents/client/requests"), exports);
|
|
60
|
+
__exportStar(require("./tests/client/requests"), exports);
|
|
58
61
|
__exportStar(require("./phoneNumbers/client/requests"), exports);
|
|
59
62
|
__exportStar(require("./llmUsage/client/requests"), exports);
|
|
60
63
|
__exportStar(require("./knowledgeBase/client/requests"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
export type ClientEvent = "conversation_initiation_metadata" | "asr_initiation_metadata" | "ping" | "audio" | "interruption" | "user_transcript" | "agent_response" | "agent_response_correction" | "client_tool_call" | "mcp_tool_call" | "mcp_connection_status" | "agent_tool_response" | "vad_score" | "internal_turn_probability" | "internal_tentative_agent_response";
|
|
4
|
+
export type ClientEvent = "conversation_initiation_metadata" | "asr_initiation_metadata" | "ping" | "audio" | "interruption" | "user_transcript" | "tentative_user_transcript" | "agent_response" | "agent_response_correction" | "client_tool_call" | "mcp_tool_call" | "mcp_connection_status" | "agent_tool_response" | "vad_score" | "internal_turn_probability" | "internal_tentative_agent_response";
|
|
5
5
|
export declare const ClientEvent: {
|
|
6
6
|
readonly ConversationInitiationMetadata: "conversation_initiation_metadata";
|
|
7
7
|
readonly AsrInitiationMetadata: "asr_initiation_metadata";
|
|
@@ -9,6 +9,7 @@ export declare const ClientEvent: {
|
|
|
9
9
|
readonly Audio: "audio";
|
|
10
10
|
readonly Interruption: "interruption";
|
|
11
11
|
readonly UserTranscript: "user_transcript";
|
|
12
|
+
readonly TentativeUserTranscript: "tentative_user_transcript";
|
|
12
13
|
readonly AgentResponse: "agent_response";
|
|
13
14
|
readonly AgentResponseCorrection: "agent_response_correction";
|
|
14
15
|
readonly ClientToolCall: "client_tool_call";
|
package/api/types/ClientEvent.js
CHANGED
|
@@ -11,6 +11,7 @@ exports.ClientEvent = {
|
|
|
11
11
|
Audio: "audio",
|
|
12
12
|
Interruption: "interruption",
|
|
13
13
|
UserTranscript: "user_transcript",
|
|
14
|
+
TentativeUserTranscript: "tentative_user_transcript",
|
|
14
15
|
AgentResponse: "agent_response",
|
|
15
16
|
AgentResponseCorrection: "agent_response_correction",
|
|
16
17
|
ClientToolCall: "client_tool_call",
|
package/api/types/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export * from "./BadRequestErrorBody";
|
|
2
|
-
export * from "./CreateUnitTestRequestDynamicVariablesValue";
|
|
3
|
-
export * from "./UpdateUnitTestRequestDynamicVariablesValue";
|
|
4
2
|
export * from "./AsrConversationalConfig";
|
|
5
3
|
export * from "./AsrInputFormat";
|
|
6
4
|
export * from "./AsrProvider";
|
|
@@ -511,6 +509,7 @@ export * from "./TestConditionRationaleCommonModel";
|
|
|
511
509
|
export * from "./TestConditionResultCommonModel";
|
|
512
510
|
export * from "./TestRunStatus";
|
|
513
511
|
export * from "./TestToolResultModel";
|
|
512
|
+
export * from "./TestsFeatureUsageCommonModel";
|
|
514
513
|
export * from "./TokenResponseModel";
|
|
515
514
|
export * from "./Tool";
|
|
516
515
|
export * from "./ToolAnnotations";
|
package/api/types/index.js
CHANGED
|
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BadRequestErrorBody"), exports);
|
|
18
|
-
__exportStar(require("./CreateUnitTestRequestDynamicVariablesValue"), exports);
|
|
19
|
-
__exportStar(require("./UpdateUnitTestRequestDynamicVariablesValue"), exports);
|
|
20
18
|
__exportStar(require("./AsrConversationalConfig"), exports);
|
|
21
19
|
__exportStar(require("./AsrInputFormat"), exports);
|
|
22
20
|
__exportStar(require("./AsrProvider"), exports);
|
|
@@ -527,6 +525,7 @@ __exportStar(require("./TestConditionRationaleCommonModel"), exports);
|
|
|
527
525
|
__exportStar(require("./TestConditionResultCommonModel"), exports);
|
|
528
526
|
__exportStar(require("./TestRunStatus"), exports);
|
|
529
527
|
__exportStar(require("./TestToolResultModel"), exports);
|
|
528
|
+
__exportStar(require("./TestsFeatureUsageCommonModel"), exports);
|
|
530
529
|
__exportStar(require("./TokenResponseModel"), exports);
|
|
531
530
|
__exportStar(require("./Tool"), exports);
|
|
532
531
|
__exportStar(require("./ToolAnnotations"), exports);
|
package/dist/Client.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as environments from "./environments";
|
|
5
5
|
import * as core from "./core";
|
|
6
|
-
import * as ElevenLabs from "./api/index";
|
|
7
6
|
import { History } from "./api/resources/history/client/Client";
|
|
8
7
|
import { TextToSoundEffects } from "./api/resources/textToSoundEffects/client/Client";
|
|
9
8
|
import { AudioIsolation } from "./api/resources/audioIsolation/client/Client";
|
|
@@ -99,165 +98,6 @@ export declare class ElevenLabsClient {
|
|
|
99
98
|
get conversationalAi(): ConversationalAi;
|
|
100
99
|
get music(): Music;
|
|
101
100
|
get workspace(): Workspace;
|
|
102
|
-
/**
|
|
103
|
-
* Creates a new agent response test.
|
|
104
|
-
*
|
|
105
|
-
* @param {ElevenLabs.CreateUnitTestRequest} request
|
|
106
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
|
-
*
|
|
108
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* await client.createAgentResponseTestRoute({
|
|
112
|
-
* chatHistory: [{
|
|
113
|
-
* role: "user",
|
|
114
|
-
* timeInCallSecs: 1
|
|
115
|
-
* }],
|
|
116
|
-
* successCondition: "success_condition",
|
|
117
|
-
* successExamples: [{
|
|
118
|
-
* response: "response",
|
|
119
|
-
* type: "success"
|
|
120
|
-
* }],
|
|
121
|
-
* failureExamples: [{
|
|
122
|
-
* response: "response",
|
|
123
|
-
* type: "failure"
|
|
124
|
-
* }],
|
|
125
|
-
* name: "name"
|
|
126
|
-
* })
|
|
127
|
-
*/
|
|
128
|
-
createAgentResponseTestRoute(request: ElevenLabs.CreateUnitTestRequest, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.CreateUnitTestResponseModel>;
|
|
129
|
-
private __createAgentResponseTestRoute;
|
|
130
|
-
/**
|
|
131
|
-
* Gets an agent response test by ID.
|
|
132
|
-
*
|
|
133
|
-
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
134
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
135
|
-
*
|
|
136
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* await client.getAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
|
|
140
|
-
*/
|
|
141
|
-
getAgentResponseTestRoute(testId: string, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetUnitTestResponseModel>;
|
|
142
|
-
private __getAgentResponseTestRoute;
|
|
143
|
-
/**
|
|
144
|
-
* Updates an agent response test by ID.
|
|
145
|
-
*
|
|
146
|
-
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
147
|
-
* @param {ElevenLabs.UpdateUnitTestRequest} request
|
|
148
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
149
|
-
*
|
|
150
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
151
|
-
*
|
|
152
|
-
* @example
|
|
153
|
-
* await client.updateAgentResponseTestRoute("TeaqRRdTcIfIu2i7BYfT", {
|
|
154
|
-
* chatHistory: [{
|
|
155
|
-
* role: "user",
|
|
156
|
-
* timeInCallSecs: 1
|
|
157
|
-
* }],
|
|
158
|
-
* successCondition: "success_condition",
|
|
159
|
-
* successExamples: [{
|
|
160
|
-
* response: "response",
|
|
161
|
-
* type: "success"
|
|
162
|
-
* }],
|
|
163
|
-
* failureExamples: [{
|
|
164
|
-
* response: "response",
|
|
165
|
-
* type: "failure"
|
|
166
|
-
* }],
|
|
167
|
-
* name: "name"
|
|
168
|
-
* })
|
|
169
|
-
*/
|
|
170
|
-
updateAgentResponseTestRoute(testId: string, request: ElevenLabs.UpdateUnitTestRequest, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetUnitTestResponseModel>;
|
|
171
|
-
private __updateAgentResponseTestRoute;
|
|
172
|
-
/**
|
|
173
|
-
* Deletes an agent response test by ID.
|
|
174
|
-
*
|
|
175
|
-
* @param {string} testId - The id of a chat response test. This is returned on test creation.
|
|
176
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
177
|
-
*
|
|
178
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* await client.deleteChatResponseTestRoute("TeaqRRdTcIfIu2i7BYfT")
|
|
182
|
-
*/
|
|
183
|
-
deleteChatResponseTestRoute(testId: string, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
184
|
-
private __deleteChatResponseTestRoute;
|
|
185
|
-
/**
|
|
186
|
-
* Gets multiple agent response tests by their IDs. Returns a dictionary mapping test IDs to test summaries.
|
|
187
|
-
*
|
|
188
|
-
* @param {ElevenLabs.ListTestsByIdsRequestModel} request
|
|
189
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
190
|
-
*
|
|
191
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
192
|
-
*
|
|
193
|
-
* @example
|
|
194
|
-
* await client.getAgentResponseTestsSummariesRoute({
|
|
195
|
-
* testIds: ["test_id_1", "test_id_2"]
|
|
196
|
-
* })
|
|
197
|
-
*/
|
|
198
|
-
getAgentResponseTestsSummariesRoute(request: ElevenLabs.ListTestsByIdsRequestModel, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetTestsSummariesByIdsResponseModel>;
|
|
199
|
-
private __getAgentResponseTestsSummariesRoute;
|
|
200
|
-
/**
|
|
201
|
-
* Lists all agent response tests with pagination support and optional search filtering.
|
|
202
|
-
*
|
|
203
|
-
* @param {ElevenLabs.ListChatResponseTestsRouteRequest} request
|
|
204
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
205
|
-
*
|
|
206
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* await client.listChatResponseTestsRoute()
|
|
210
|
-
*/
|
|
211
|
-
listChatResponseTestsRoute(request?: ElevenLabs.ListChatResponseTestsRouteRequest, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetTestsPageResponseModel>;
|
|
212
|
-
private __listChatResponseTestsRoute;
|
|
213
|
-
/**
|
|
214
|
-
* Run selected tests on the agent with provided configuration. If the agent configuration is provided, it will be used to override default agent configuration.
|
|
215
|
-
*
|
|
216
|
-
* @param {string} agentId - The id of an agent. This is returned on agent creation.
|
|
217
|
-
* @param {ElevenLabs.RunAgentTestsRequestModel} request
|
|
218
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
219
|
-
*
|
|
220
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
221
|
-
*
|
|
222
|
-
* @example
|
|
223
|
-
* await client.runAgentTestSuiteRoute("21m00Tcm4TlvDq8ikWAM", {
|
|
224
|
-
* tests: [{
|
|
225
|
-
* testId: "test_id"
|
|
226
|
-
* }]
|
|
227
|
-
* })
|
|
228
|
-
*/
|
|
229
|
-
runAgentTestSuiteRoute(agentId: string, request: ElevenLabs.RunAgentTestsRequestModel, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetTestSuiteInvocationResponseModel>;
|
|
230
|
-
private __runAgentTestSuiteRoute;
|
|
231
|
-
/**
|
|
232
|
-
* Gets a test invocation by ID.
|
|
233
|
-
*
|
|
234
|
-
* @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
|
|
235
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
236
|
-
*
|
|
237
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
238
|
-
*
|
|
239
|
-
* @example
|
|
240
|
-
* await client.getTestInvocationRoute("test_invocation_id")
|
|
241
|
-
*/
|
|
242
|
-
getTestInvocationRoute(testInvocationId: string, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<ElevenLabs.GetTestSuiteInvocationResponseModel>;
|
|
243
|
-
private __getTestInvocationRoute;
|
|
244
|
-
/**
|
|
245
|
-
* Resubmits specific test runs from a test invocation.
|
|
246
|
-
*
|
|
247
|
-
* @param {string} testInvocationId - The id of a test invocation. This is returned when tests are run.
|
|
248
|
-
* @param {ElevenLabs.ResubmitTestsRequestModel} request
|
|
249
|
-
* @param {ElevenLabsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
250
|
-
*
|
|
251
|
-
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* await client.resubmitTestsRoute("test_invocation_id", {
|
|
255
|
-
* testRunIds: ["test_run_ids"],
|
|
256
|
-
* agentId: "agent_id"
|
|
257
|
-
* })
|
|
258
|
-
*/
|
|
259
|
-
resubmitTestsRoute(testInvocationId: string, request: ElevenLabs.ResubmitTestsRequestModel, requestOptions?: ElevenLabsClient.RequestOptions): core.HttpResponsePromise<unknown>;
|
|
260
|
-
private __resubmitTestsRoute;
|
|
261
101
|
/**
|
|
262
102
|
* Add a generated voice to the voice library.
|
|
263
103
|
*
|