retell-sdk 4.7.0 → 4.9.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/CHANGELOG.md +26 -0
- package/README.md +21 -8
- package/_shims/node-types.d.ts +1 -1
- package/core.d.ts +9 -6
- package/core.d.ts.map +1 -1
- package/core.js +25 -9
- package/core.js.map +1 -1
- package/core.mjs +22 -7
- package/core.mjs.map +1 -1
- package/error.d.ts.map +1 -1
- package/index.d.mts +19 -34
- package/index.d.ts +19 -34
- package/index.d.ts.map +1 -1
- package/index.js +30 -10
- package/index.js.map +1 -1
- package/index.mjs +17 -10
- package/index.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/agent.d.ts +87 -19
- package/resources/agent.d.ts.map +1 -1
- package/resources/agent.js +0 -2
- package/resources/agent.js.map +1 -1
- package/resources/agent.mjs +0 -2
- package/resources/agent.mjs.map +1 -1
- package/resources/call.d.ts +2 -10
- package/resources/call.d.ts.map +1 -1
- package/resources/call.js +1 -3
- package/resources/call.js.map +1 -1
- package/resources/call.mjs +1 -3
- package/resources/call.mjs.map +1 -1
- package/resources/concurrency.d.ts +1 -2
- package/resources/concurrency.d.ts.map +1 -1
- package/resources/concurrency.js +0 -2
- package/resources/concurrency.js.map +1 -1
- package/resources/concurrency.mjs +0 -2
- package/resources/concurrency.mjs.map +1 -1
- package/resources/index.d.ts +7 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -2
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge-base.d.ts +144 -0
- package/resources/knowledge-base.d.ts.map +1 -0
- package/resources/knowledge-base.js +60 -0
- package/resources/knowledge-base.js.map +1 -0
- package/resources/knowledge-base.mjs +33 -0
- package/resources/knowledge-base.mjs.map +1 -0
- package/resources/llm.d.ts +244 -28
- package/resources/llm.d.ts.map +1 -1
- package/resources/llm.js +0 -2
- package/resources/llm.js.map +1 -1
- package/resources/llm.mjs +0 -2
- package/resources/llm.mjs.map +1 -1
- package/resources/phone-number.d.ts +1 -6
- package/resources/phone-number.d.ts.map +1 -1
- package/resources/phone-number.js +0 -2
- package/resources/phone-number.js.map +1 -1
- package/resources/phone-number.mjs +0 -2
- package/resources/phone-number.mjs.map +1 -1
- package/resources/voice.d.ts +1 -3
- package/resources/voice.d.ts.map +1 -1
- package/resources/voice.js +0 -2
- package/resources/voice.js.map +1 -1
- package/resources/voice.mjs +0 -2
- package/resources/voice.mjs.map +1 -1
- package/shims/node.d.ts +1 -0
- package/shims/node.d.ts.map +1 -1
- package/src/_shims/node-types.d.ts +1 -1
- package/src/core.ts +39 -13
- package/src/error.ts +1 -1
- package/src/index.ts +98 -42
- package/src/resources/agent.ts +109 -21
- package/src/resources/call.ts +12 -11
- package/src/resources/concurrency.ts +2 -3
- package/src/resources/index.ts +35 -17
- package/src/resources/knowledge-base.ts +200 -0
- package/src/resources/llm.ts +313 -30
- package/src/resources/phone-number.ts +8 -7
- package/src/resources/voice.ts +2 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/voice.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice.js","sourceRoot":"","sources":["../src/resources/voice.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;
|
|
1
|
+
{"version":3,"file":"voice.js","sourceRoot":"","sources":["../src/resources/voice.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,6CAA0C;AAG1C,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF;AAdD,sBAcC"}
|
package/resources/voice.mjs
CHANGED
package/resources/voice.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voice.mjs","sourceRoot":"","sources":["../src/resources/voice.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"voice.mjs","sourceRoot":"","sources":["../src/resources/voice.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAGtB,MAAM,OAAO,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,QAAQ,CAAC,OAAe,EAAE,OAA6B;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,OAA6B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF"}
|
package/shims/node.d.ts
CHANGED
package/shims/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/shims/node.ts"],"names":[],"mappings":";;;;AACA,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAK9C,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,MAAM,CAAC;QAEtB,KAAY,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAEhC,MAAM,QAAQ,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAElC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAEpC,KAAY,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;QAE5C,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC;QAEpD,KAAY,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;QAE5D,MAAM,QAAQ,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAExC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,MAAM,QAAQ,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QAEhC,KAAY,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAEtC,KAAY,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;QAE9C,MAAM,QAAQ,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;KACrD;CACF"}
|
|
@@ -7,7 +7,7 @@ import * as fd from 'formdata-node';
|
|
|
7
7
|
export { type Agent } from 'node:http';
|
|
8
8
|
export { type Readable } from 'node:stream';
|
|
9
9
|
export { type ReadStream as FsReadStream } from 'node:fs';
|
|
10
|
-
export { ReadableStream } from 'web
|
|
10
|
+
export { ReadableStream } from 'node:stream/web';
|
|
11
11
|
|
|
12
12
|
export const fetch: typeof nf.default;
|
|
13
13
|
|
package/src/core.ts
CHANGED
|
@@ -84,8 +84,10 @@ export class APIPromise<T> extends Promise<T> {
|
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
_thenUnwrap<U>(transform: (data: T) => U): APIPromise<U> {
|
|
88
|
-
return new APIPromise(this.responsePromise, async (props) =>
|
|
87
|
+
_thenUnwrap<U>(transform: (data: T, props: APIResponseProps) => U): APIPromise<U> {
|
|
88
|
+
return new APIPromise(this.responsePromise, async (props) =>
|
|
89
|
+
transform(await this.parseResponse(props), props),
|
|
90
|
+
);
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
@@ -274,7 +276,10 @@ export abstract class APIClient {
|
|
|
274
276
|
return null;
|
|
275
277
|
}
|
|
276
278
|
|
|
277
|
-
buildRequest<Req>(
|
|
279
|
+
buildRequest<Req>(
|
|
280
|
+
options: FinalRequestOptions<Req>,
|
|
281
|
+
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
282
|
+
): { req: RequestInit; url: string; timeout: number } {
|
|
278
283
|
const { method, path, query, headers: headers = {} } = options;
|
|
279
284
|
|
|
280
285
|
const body =
|
|
@@ -306,7 +311,7 @@ export abstract class APIClient {
|
|
|
306
311
|
headers[this.idempotencyHeader] = options.idempotencyKey;
|
|
307
312
|
}
|
|
308
313
|
|
|
309
|
-
const reqHeaders = this.buildHeaders({ options, headers, contentLength });
|
|
314
|
+
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
|
|
310
315
|
|
|
311
316
|
const req: RequestInit = {
|
|
312
317
|
method,
|
|
@@ -325,10 +330,12 @@ export abstract class APIClient {
|
|
|
325
330
|
options,
|
|
326
331
|
headers,
|
|
327
332
|
contentLength,
|
|
333
|
+
retryCount,
|
|
328
334
|
}: {
|
|
329
335
|
options: FinalRequestOptions;
|
|
330
336
|
headers: Record<string, string | null | undefined>;
|
|
331
337
|
contentLength: string | null | undefined;
|
|
338
|
+
retryCount: number;
|
|
332
339
|
}): Record<string, string> {
|
|
333
340
|
const reqHeaders: Record<string, string> = {};
|
|
334
341
|
if (contentLength) {
|
|
@@ -344,6 +351,16 @@ export abstract class APIClient {
|
|
|
344
351
|
delete reqHeaders['content-type'];
|
|
345
352
|
}
|
|
346
353
|
|
|
354
|
+
// Don't set the retry count header if it was already set or removed through default headers or by the
|
|
355
|
+
// caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to
|
|
356
|
+
// account for the removal case.
|
|
357
|
+
if (
|
|
358
|
+
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
|
|
359
|
+
getHeader(headers, 'x-stainless-retry-count') === undefined
|
|
360
|
+
) {
|
|
361
|
+
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
362
|
+
}
|
|
363
|
+
|
|
347
364
|
this.validateHeaders(reqHeaders, headers);
|
|
348
365
|
|
|
349
366
|
return reqHeaders;
|
|
@@ -379,7 +396,7 @@ export abstract class APIClient {
|
|
|
379
396
|
error: Object | undefined,
|
|
380
397
|
message: string | undefined,
|
|
381
398
|
headers: Headers | undefined,
|
|
382
|
-
) {
|
|
399
|
+
): APIError {
|
|
383
400
|
return APIError.generate(status, error, message, headers);
|
|
384
401
|
}
|
|
385
402
|
|
|
@@ -395,13 +412,14 @@ export abstract class APIClient {
|
|
|
395
412
|
retriesRemaining: number | null,
|
|
396
413
|
): Promise<APIResponseProps> {
|
|
397
414
|
const options = await optionsInput;
|
|
415
|
+
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
398
416
|
if (retriesRemaining == null) {
|
|
399
|
-
retriesRemaining =
|
|
417
|
+
retriesRemaining = maxRetries;
|
|
400
418
|
}
|
|
401
419
|
|
|
402
420
|
await this.prepareOptions(options);
|
|
403
421
|
|
|
404
|
-
const { req, url, timeout } = this.buildRequest(options);
|
|
422
|
+
const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining });
|
|
405
423
|
|
|
406
424
|
await this.prepareRequest(req, { url, options });
|
|
407
425
|
|
|
@@ -650,9 +668,9 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
650
668
|
return await this.#client.requestAPIList(this.constructor as any, nextOptions);
|
|
651
669
|
}
|
|
652
670
|
|
|
653
|
-
async *iterPages() {
|
|
671
|
+
async *iterPages(): AsyncGenerator<this> {
|
|
654
672
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
655
|
-
let page:
|
|
673
|
+
let page: this = this;
|
|
656
674
|
yield page;
|
|
657
675
|
while (page.hasNextPage()) {
|
|
658
676
|
page = await page.getNextPage();
|
|
@@ -660,7 +678,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
660
678
|
}
|
|
661
679
|
}
|
|
662
680
|
|
|
663
|
-
async *[Symbol.asyncIterator]() {
|
|
681
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
664
682
|
for await (const page of this.iterPages()) {
|
|
665
683
|
for (const item of page.getPaginatedItems()) {
|
|
666
684
|
yield item;
|
|
@@ -703,7 +721,7 @@ export class PagePromise<
|
|
|
703
721
|
* console.log(item)
|
|
704
722
|
* }
|
|
705
723
|
*/
|
|
706
|
-
async *[Symbol.asyncIterator]() {
|
|
724
|
+
async *[Symbol.asyncIterator](): AsyncGenerator<Item> {
|
|
707
725
|
const page = await this;
|
|
708
726
|
for await (const item of page) {
|
|
709
727
|
yield item;
|
|
@@ -1120,7 +1138,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => {
|
|
|
1120
1138
|
return typeof headers?.get === 'function';
|
|
1121
1139
|
};
|
|
1122
1140
|
|
|
1123
|
-
export const getRequiredHeader = (headers: HeadersLike, header: string): string => {
|
|
1141
|
+
export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => {
|
|
1142
|
+
const foundHeader = getHeader(headers, header);
|
|
1143
|
+
if (foundHeader === undefined) {
|
|
1144
|
+
throw new Error(`Could not find ${header} header`);
|
|
1145
|
+
}
|
|
1146
|
+
return foundHeader;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1149
|
+
export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => {
|
|
1124
1150
|
const lowerCasedHeader = header.toLowerCase();
|
|
1125
1151
|
if (isHeadersProtocol(headers)) {
|
|
1126
1152
|
// to deal with the case where the header looks like Stainless-Event-Id
|
|
@@ -1146,7 +1172,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string
|
|
|
1146
1172
|
}
|
|
1147
1173
|
}
|
|
1148
1174
|
|
|
1149
|
-
|
|
1175
|
+
return undefined;
|
|
1150
1176
|
};
|
|
1151
1177
|
|
|
1152
1178
|
/**
|
package/src/error.ts
CHANGED
|
@@ -47,7 +47,7 @@ export class APIError extends RetellError {
|
|
|
47
47
|
errorResponse: Object | undefined,
|
|
48
48
|
message: string | undefined,
|
|
49
49
|
headers: Headers | undefined,
|
|
50
|
-
) {
|
|
50
|
+
): APIError {
|
|
51
51
|
if (!status) {
|
|
52
52
|
return new APIConnectionError({ message, cause: castToError(errorResponse) });
|
|
53
53
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,45 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import * as Errors from './error';
|
|
4
|
-
import * as Uploads from './uploads';
|
|
5
3
|
import { type Agent } from './_shims/index';
|
|
6
4
|
import * as Core from './core';
|
|
5
|
+
import * as Errors from './error';
|
|
6
|
+
import * as Uploads from './uploads';
|
|
7
7
|
import * as API from './resources/index';
|
|
8
|
+
import {
|
|
9
|
+
Agent as AgentAPIAgent,
|
|
10
|
+
AgentCreateParams,
|
|
11
|
+
AgentListResponse,
|
|
12
|
+
AgentResponse,
|
|
13
|
+
AgentUpdateParams,
|
|
14
|
+
} from './resources/agent';
|
|
15
|
+
import {
|
|
16
|
+
Call,
|
|
17
|
+
CallCreatePhoneCallParams,
|
|
18
|
+
CallCreateWebCallParams,
|
|
19
|
+
CallListParams,
|
|
20
|
+
CallListResponse,
|
|
21
|
+
CallRegisterPhoneCallParams,
|
|
22
|
+
CallResponse,
|
|
23
|
+
PhoneCallResponse,
|
|
24
|
+
WebCallResponse,
|
|
25
|
+
} from './resources/call';
|
|
26
|
+
import { Concurrency, ConcurrencyRetrieveResponse } from './resources/concurrency';
|
|
27
|
+
import {
|
|
28
|
+
KnowledgeBase,
|
|
29
|
+
KnowledgeBaseCreateParams,
|
|
30
|
+
KnowledgeBaseListResponse,
|
|
31
|
+
KnowledgeBaseResponse,
|
|
32
|
+
} from './resources/knowledge-base';
|
|
33
|
+
import { Llm, LlmCreateParams, LlmListResponse, LlmResponse, LlmUpdateParams } from './resources/llm';
|
|
34
|
+
import {
|
|
35
|
+
PhoneNumber,
|
|
36
|
+
PhoneNumberCreateParams,
|
|
37
|
+
PhoneNumberImportParams,
|
|
38
|
+
PhoneNumberListResponse,
|
|
39
|
+
PhoneNumberResponse,
|
|
40
|
+
PhoneNumberUpdateParams,
|
|
41
|
+
} from './resources/phone-number';
|
|
42
|
+
import { Voice, VoiceListResponse, VoiceResponse } from './resources/voice';
|
|
8
43
|
import * as Webhooks from "./lib/webhook_auth";
|
|
9
44
|
|
|
10
45
|
export interface ClientOptions {
|
|
@@ -117,6 +152,7 @@ export class Retell extends Core.APIClient {
|
|
|
117
152
|
phoneNumber: API.PhoneNumber = new API.PhoneNumber(this);
|
|
118
153
|
agent: API.Agent = new API.Agent(this);
|
|
119
154
|
llm: API.Llm = new API.Llm(this);
|
|
155
|
+
knowledgeBase: API.KnowledgeBase = new API.KnowledgeBase(this);
|
|
120
156
|
voice: API.Voice = new API.Voice(this);
|
|
121
157
|
concurrency: API.Concurrency = new API.Concurrency(this);
|
|
122
158
|
|
|
@@ -159,7 +195,7 @@ export class Retell extends Core.APIClient {
|
|
|
159
195
|
static sign = Webhooks.sign;
|
|
160
196
|
}
|
|
161
197
|
|
|
162
|
-
export
|
|
198
|
+
export {
|
|
163
199
|
RetellError,
|
|
164
200
|
APIError,
|
|
165
201
|
APIConnectionError,
|
|
@@ -173,49 +209,69 @@ export const {
|
|
|
173
209
|
InternalServerError,
|
|
174
210
|
PermissionDeniedError,
|
|
175
211
|
UnprocessableEntityError,
|
|
176
|
-
}
|
|
212
|
+
} from './error';
|
|
177
213
|
|
|
178
214
|
export import toFile = Uploads.toFile;
|
|
179
215
|
export import fileFromPath = Uploads.fileFromPath;
|
|
180
216
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
export
|
|
191
|
-
|
|
192
|
-
export
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
export
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
export
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
Retell.Call = Call;
|
|
218
|
+
Retell.PhoneNumber = PhoneNumber;
|
|
219
|
+
Retell.Agent = AgentAPIAgent;
|
|
220
|
+
Retell.Llm = Llm;
|
|
221
|
+
Retell.KnowledgeBase = KnowledgeBase;
|
|
222
|
+
Retell.Voice = Voice;
|
|
223
|
+
Retell.Concurrency = Concurrency;
|
|
224
|
+
|
|
225
|
+
export declare namespace Retell {
|
|
226
|
+
export type RequestOptions = Core.RequestOptions;
|
|
227
|
+
|
|
228
|
+
export {
|
|
229
|
+
Call as Call,
|
|
230
|
+
type CallResponse as CallResponse,
|
|
231
|
+
type PhoneCallResponse as PhoneCallResponse,
|
|
232
|
+
type WebCallResponse as WebCallResponse,
|
|
233
|
+
type CallListResponse as CallListResponse,
|
|
234
|
+
type CallListParams as CallListParams,
|
|
235
|
+
type CallCreatePhoneCallParams as CallCreatePhoneCallParams,
|
|
236
|
+
type CallCreateWebCallParams as CallCreateWebCallParams,
|
|
237
|
+
type CallRegisterPhoneCallParams as CallRegisterPhoneCallParams,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
export {
|
|
241
|
+
PhoneNumber as PhoneNumber,
|
|
242
|
+
type PhoneNumberResponse as PhoneNumberResponse,
|
|
243
|
+
type PhoneNumberListResponse as PhoneNumberListResponse,
|
|
244
|
+
type PhoneNumberCreateParams as PhoneNumberCreateParams,
|
|
245
|
+
type PhoneNumberUpdateParams as PhoneNumberUpdateParams,
|
|
246
|
+
type PhoneNumberImportParams as PhoneNumberImportParams,
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
export {
|
|
250
|
+
AgentAPIAgent as Agent,
|
|
251
|
+
type AgentResponse as AgentResponse,
|
|
252
|
+
type AgentListResponse as AgentListResponse,
|
|
253
|
+
type AgentCreateParams as AgentCreateParams,
|
|
254
|
+
type AgentUpdateParams as AgentUpdateParams,
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export {
|
|
258
|
+
Llm as Llm,
|
|
259
|
+
type LlmResponse as LlmResponse,
|
|
260
|
+
type LlmListResponse as LlmListResponse,
|
|
261
|
+
type LlmCreateParams as LlmCreateParams,
|
|
262
|
+
type LlmUpdateParams as LlmUpdateParams,
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
export {
|
|
266
|
+
KnowledgeBase as KnowledgeBase,
|
|
267
|
+
type KnowledgeBaseResponse as KnowledgeBaseResponse,
|
|
268
|
+
type KnowledgeBaseListResponse as KnowledgeBaseListResponse,
|
|
269
|
+
type KnowledgeBaseCreateParams as KnowledgeBaseCreateParams,
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export { Voice as Voice, type VoiceResponse as VoiceResponse, type VoiceListResponse as VoiceListResponse };
|
|
273
|
+
|
|
274
|
+
export { Concurrency as Concurrency, type ConcurrencyRetrieveResponse as ConcurrencyRetrieveResponse };
|
|
219
275
|
}
|
|
220
276
|
|
|
221
277
|
export default Retell;
|
package/src/resources/agent.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import * as AgentAPI from './agent';
|
|
6
5
|
|
|
7
6
|
export class Agent extends APIResource {
|
|
8
7
|
/**
|
|
@@ -61,11 +60,9 @@ export interface AgentResponse {
|
|
|
61
60
|
last_modification_timestamp: number;
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
|
-
* The
|
|
65
|
-
* server. Check out [LLM WebSocket](/api-references/llm-websocket) for more about
|
|
66
|
-
* request format (sent from us) and response format (send to us).
|
|
63
|
+
* The response engine to use for the agent.
|
|
67
64
|
*/
|
|
68
|
-
|
|
65
|
+
response_engine: AgentResponse.ResponseEngineRetellLm | AgentResponse.ResponseEngineCustomLm;
|
|
69
66
|
|
|
70
67
|
/**
|
|
71
68
|
* Unique voice id used for the agent. Find list of available voices and their
|
|
@@ -152,6 +149,13 @@ export interface AgentResponse {
|
|
|
152
149
|
*/
|
|
153
150
|
enable_backchannel?: boolean;
|
|
154
151
|
|
|
152
|
+
/**
|
|
153
|
+
* If set to true, will format transcription to number, date, email, etc. If set to
|
|
154
|
+
* false, will return transcripts in raw words. If not set, default value of true
|
|
155
|
+
* will apply.
|
|
156
|
+
*/
|
|
157
|
+
enable_transcription_formatting?: boolean;
|
|
158
|
+
|
|
155
159
|
/**
|
|
156
160
|
* If set to true, will detect whether the call enters a voicemail. Note that this
|
|
157
161
|
* feature is only available for phone calls.
|
|
@@ -337,6 +341,30 @@ export interface AgentResponse {
|
|
|
337
341
|
}
|
|
338
342
|
|
|
339
343
|
export namespace AgentResponse {
|
|
344
|
+
export interface ResponseEngineRetellLm {
|
|
345
|
+
/**
|
|
346
|
+
* id of the Retell LLM to use.
|
|
347
|
+
*/
|
|
348
|
+
llm_id: string;
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* type of the response engine.
|
|
352
|
+
*/
|
|
353
|
+
type: 'retell-llm';
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface ResponseEngineCustomLm {
|
|
357
|
+
/**
|
|
358
|
+
* LLM websocket url of the custom LLM.
|
|
359
|
+
*/
|
|
360
|
+
llm_websocket_url: string;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* type of the response engine.
|
|
364
|
+
*/
|
|
365
|
+
type: 'custom-llm';
|
|
366
|
+
}
|
|
367
|
+
|
|
340
368
|
export interface StringAnalysisData {
|
|
341
369
|
/**
|
|
342
370
|
* Description of the variable.
|
|
@@ -437,11 +465,9 @@ export type AgentListResponse = Array<AgentResponse>;
|
|
|
437
465
|
|
|
438
466
|
export interface AgentCreateParams {
|
|
439
467
|
/**
|
|
440
|
-
* The
|
|
441
|
-
* server. Check out [LLM WebSocket](/api-references/llm-websocket) for more about
|
|
442
|
-
* request format (sent from us) and response format (send to us).
|
|
468
|
+
* The response engine to use for the agent.
|
|
443
469
|
*/
|
|
444
|
-
|
|
470
|
+
response_engine: AgentCreateParams.ResponseEngineRetellLm | AgentCreateParams.ResponseEngineCustomLm;
|
|
445
471
|
|
|
446
472
|
/**
|
|
447
473
|
* Unique voice id used for the agent. Find list of available voices and their
|
|
@@ -528,6 +554,13 @@ export interface AgentCreateParams {
|
|
|
528
554
|
*/
|
|
529
555
|
enable_backchannel?: boolean;
|
|
530
556
|
|
|
557
|
+
/**
|
|
558
|
+
* If set to true, will format transcription to number, date, email, etc. If set to
|
|
559
|
+
* false, will return transcripts in raw words. If not set, default value of true
|
|
560
|
+
* will apply.
|
|
561
|
+
*/
|
|
562
|
+
enable_transcription_formatting?: boolean;
|
|
563
|
+
|
|
531
564
|
/**
|
|
532
565
|
* If set to true, will detect whether the call enters a voicemail. Note that this
|
|
533
566
|
* feature is only available for phone calls.
|
|
@@ -713,6 +746,30 @@ export interface AgentCreateParams {
|
|
|
713
746
|
}
|
|
714
747
|
|
|
715
748
|
export namespace AgentCreateParams {
|
|
749
|
+
export interface ResponseEngineRetellLm {
|
|
750
|
+
/**
|
|
751
|
+
* id of the Retell LLM to use.
|
|
752
|
+
*/
|
|
753
|
+
llm_id: string;
|
|
754
|
+
|
|
755
|
+
/**
|
|
756
|
+
* type of the response engine.
|
|
757
|
+
*/
|
|
758
|
+
type: 'retell-llm';
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
export interface ResponseEngineCustomLm {
|
|
762
|
+
/**
|
|
763
|
+
* LLM websocket url of the custom LLM.
|
|
764
|
+
*/
|
|
765
|
+
llm_websocket_url: string;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* type of the response engine.
|
|
769
|
+
*/
|
|
770
|
+
type: 'custom-llm';
|
|
771
|
+
}
|
|
772
|
+
|
|
716
773
|
export interface StringAnalysisData {
|
|
717
774
|
/**
|
|
718
775
|
* Description of the variable.
|
|
@@ -889,6 +946,13 @@ export interface AgentUpdateParams {
|
|
|
889
946
|
*/
|
|
890
947
|
enable_backchannel?: boolean;
|
|
891
948
|
|
|
949
|
+
/**
|
|
950
|
+
* If set to true, will format transcription to number, date, email, etc. If set to
|
|
951
|
+
* false, will return transcripts in raw words. If not set, default value of true
|
|
952
|
+
* will apply.
|
|
953
|
+
*/
|
|
954
|
+
enable_transcription_formatting?: boolean;
|
|
955
|
+
|
|
892
956
|
/**
|
|
893
957
|
* If set to true, will detect whether the call enters a voicemail. Note that this
|
|
894
958
|
* feature is only available for phone calls.
|
|
@@ -947,13 +1011,6 @@ export interface AgentUpdateParams {
|
|
|
947
1011
|
| 'vi-VN'
|
|
948
1012
|
| 'multi';
|
|
949
1013
|
|
|
950
|
-
/**
|
|
951
|
-
* The URL we will establish LLM websocket for getting response, usually your
|
|
952
|
-
* server. Check out [LLM WebSocket](/api-references/llm-websocket) for more about
|
|
953
|
-
* request format (sent from us) and response format (send to us).
|
|
954
|
-
*/
|
|
955
|
-
llm_websocket_url?: string;
|
|
956
|
-
|
|
957
1014
|
/**
|
|
958
1015
|
* Maximum allowed length for the call, will force end the call if reached. The
|
|
959
1016
|
* minimum value allowed is 60,000 ms (1 min), and maximum value allowed is
|
|
@@ -1012,6 +1069,11 @@ export interface AgentUpdateParams {
|
|
|
1012
1069
|
*/
|
|
1013
1070
|
reminder_trigger_ms?: number;
|
|
1014
1071
|
|
|
1072
|
+
/**
|
|
1073
|
+
* The response engine to use for the agent.
|
|
1074
|
+
*/
|
|
1075
|
+
response_engine?: AgentUpdateParams.ResponseEngineRetellLm | AgentUpdateParams.ResponseEngineCustomLm;
|
|
1076
|
+
|
|
1015
1077
|
/**
|
|
1016
1078
|
* Controls how responsive is the agent. Value ranging from [0,1]. Lower value
|
|
1017
1079
|
* means less responsive agent (wait more, respond slower), while higher value
|
|
@@ -1181,11 +1243,37 @@ export namespace AgentUpdateParams {
|
|
|
1181
1243
|
*/
|
|
1182
1244
|
word: string;
|
|
1183
1245
|
}
|
|
1246
|
+
|
|
1247
|
+
export interface ResponseEngineRetellLm {
|
|
1248
|
+
/**
|
|
1249
|
+
* id of the Retell LLM to use.
|
|
1250
|
+
*/
|
|
1251
|
+
llm_id: string;
|
|
1252
|
+
|
|
1253
|
+
/**
|
|
1254
|
+
* type of the response engine.
|
|
1255
|
+
*/
|
|
1256
|
+
type: 'retell-llm';
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
export interface ResponseEngineCustomLm {
|
|
1260
|
+
/**
|
|
1261
|
+
* LLM websocket url of the custom LLM.
|
|
1262
|
+
*/
|
|
1263
|
+
llm_websocket_url: string;
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* type of the response engine.
|
|
1267
|
+
*/
|
|
1268
|
+
type: 'custom-llm';
|
|
1269
|
+
}
|
|
1184
1270
|
}
|
|
1185
1271
|
|
|
1186
|
-
export namespace Agent {
|
|
1187
|
-
export
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1272
|
+
export declare namespace Agent {
|
|
1273
|
+
export {
|
|
1274
|
+
type AgentResponse as AgentResponse,
|
|
1275
|
+
type AgentListResponse as AgentListResponse,
|
|
1276
|
+
type AgentCreateParams as AgentCreateParams,
|
|
1277
|
+
type AgentUpdateParams as AgentUpdateParams,
|
|
1278
|
+
};
|
|
1191
1279
|
}
|
package/src/resources/call.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import * as CallAPI from './call';
|
|
6
5
|
|
|
7
6
|
export class Call extends APIResource {
|
|
8
7
|
/**
|
|
@@ -40,7 +39,7 @@ export class Call extends APIResource {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
/**
|
|
43
|
-
* Register a new
|
|
42
|
+
* Register a new phone call for custom telephony
|
|
44
43
|
*/
|
|
45
44
|
registerPhoneCall(
|
|
46
45
|
body: CallRegisterPhoneCallParams,
|
|
@@ -1095,13 +1094,15 @@ export interface CallRegisterPhoneCallParams {
|
|
|
1095
1094
|
to_number?: string;
|
|
1096
1095
|
}
|
|
1097
1096
|
|
|
1098
|
-
export namespace Call {
|
|
1099
|
-
export
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1097
|
+
export declare namespace Call {
|
|
1098
|
+
export {
|
|
1099
|
+
type CallResponse as CallResponse,
|
|
1100
|
+
type PhoneCallResponse as PhoneCallResponse,
|
|
1101
|
+
type WebCallResponse as WebCallResponse,
|
|
1102
|
+
type CallListResponse as CallListResponse,
|
|
1103
|
+
type CallListParams as CallListParams,
|
|
1104
|
+
type CallCreatePhoneCallParams as CallCreatePhoneCallParams,
|
|
1105
|
+
type CallCreateWebCallParams as CallCreateWebCallParams,
|
|
1106
|
+
type CallRegisterPhoneCallParams as CallRegisterPhoneCallParams,
|
|
1107
|
+
};
|
|
1107
1108
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../resource';
|
|
4
4
|
import * as Core from '../core';
|
|
5
|
-
import * as ConcurrencyAPI from './concurrency';
|
|
6
5
|
|
|
7
6
|
export class Concurrency extends APIResource {
|
|
8
7
|
/**
|
|
@@ -25,6 +24,6 @@ export interface ConcurrencyRetrieveResponse {
|
|
|
25
24
|
current_concurrency?: number;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
export namespace Concurrency {
|
|
29
|
-
export
|
|
27
|
+
export declare namespace Concurrency {
|
|
28
|
+
export { type ConcurrencyRetrieveResponse as ConcurrencyRetrieveResponse };
|
|
30
29
|
}
|