phonic 0.32.4 → 0.32.5
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +6 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +17 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +61 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsDeleteResponse.d.ts +4 -0
- package/dist/cjs/api/resources/conversations/types/ConversationsDeleteResponse.js +3 -0
- package/dist/cjs/api/resources/conversations/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/types/index.js +1 -0
- package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -3
- package/dist/cjs/api/resources/projects/client/Client.js +3 -9
- package/dist/cjs/api/types/Agent.d.ts +4 -0
- package/dist/cjs/api/types/ConfigOptions.d.ts +8 -0
- package/dist/cjs/api/types/ConfigOptions.js +2 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +6 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +6 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +17 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +61 -0
- package/dist/esm/api/resources/conversations/types/ConversationsDeleteResponse.d.mts +4 -0
- package/dist/esm/api/resources/conversations/types/ConversationsDeleteResponse.mjs +2 -0
- package/dist/esm/api/resources/conversations/types/index.d.mts +1 -0
- package/dist/esm/api/resources/conversations/types/index.mjs +1 -0
- package/dist/esm/api/resources/projects/client/Client.d.mts +1 -3
- package/dist/esm/api/resources/projects/client/Client.mjs +3 -9
- package/dist/esm/api/types/Agent.d.mts +4 -0
- package/dist/esm/api/types/ConfigOptions.d.mts +8 -0
- package/dist/esm/api/types/ConfigOptions.mjs +2 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +6 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +63 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "phonic",
|
|
46
|
-
"X-Fern-SDK-Version": "0.32.
|
|
47
|
-
"User-Agent": "phonic/0.32.
|
|
46
|
+
"X-Fern-SDK-Version": "0.32.5",
|
|
47
|
+
"User-Agent": "phonic/0.32.5",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -73,6 +73,8 @@ export interface AgentsCreateRequest {
|
|
|
73
73
|
generate_welcome_message?: boolean;
|
|
74
74
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
75
75
|
is_welcome_message_interruptible?: boolean;
|
|
76
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
77
|
+
websocket_timeout_sec?: number;
|
|
76
78
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
77
79
|
welcome_message?: string;
|
|
78
80
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -129,4 +131,8 @@ export interface AgentsCreateRequest {
|
|
|
129
131
|
vad_threshold?: number;
|
|
130
132
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
131
133
|
enable_redaction?: boolean;
|
|
134
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
135
|
+
mcp_server_ids?: string[];
|
|
136
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
137
|
+
observability_integrations?: "braintrust"[];
|
|
132
138
|
}
|
|
@@ -73,6 +73,8 @@ export interface UpdateAgentRequest {
|
|
|
73
73
|
generate_welcome_message?: boolean;
|
|
74
74
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
75
75
|
is_welcome_message_interruptible?: boolean;
|
|
76
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
77
|
+
websocket_timeout_sec?: number;
|
|
76
78
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
77
79
|
welcome_message?: string;
|
|
78
80
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -135,6 +137,10 @@ export interface UpdateAgentRequest {
|
|
|
135
137
|
vad_threshold?: number;
|
|
136
138
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
137
139
|
enable_redaction?: boolean;
|
|
140
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
141
|
+
mcp_server_ids?: string[];
|
|
142
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
143
|
+
observability_integrations?: "braintrust"[];
|
|
138
144
|
}
|
|
139
145
|
export declare namespace UpdateAgentRequest {
|
|
140
146
|
const PhoneNumber: {
|
|
@@ -87,6 +87,23 @@ export declare class ConversationsClient {
|
|
|
87
87
|
*/
|
|
88
88
|
cancel(id: string, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsCancelResponse>;
|
|
89
89
|
private __cancel;
|
|
90
|
+
/**
|
|
91
|
+
* Deletes a conversation, scheduling its transcripts and audio recordings for deletion. The conversation must have ended.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} id - The ID of the conversation to delete.
|
|
94
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
97
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
98
|
+
* @throws {@link Phonic.NotFoundError}
|
|
99
|
+
* @throws {@link Phonic.ConflictError}
|
|
100
|
+
* @throws {@link Phonic.InternalServerError}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* await client.conversations.delete("id")
|
|
104
|
+
*/
|
|
105
|
+
delete(id: string, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsDeleteResponse>;
|
|
106
|
+
private __delete;
|
|
90
107
|
/**
|
|
91
108
|
* Returns an analysis of the specified conversation.
|
|
92
109
|
*
|
|
@@ -269,6 +269,67 @@ class ConversationsClient {
|
|
|
269
269
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/conversations/{id}/cancel");
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Deletes a conversation, scheduling its transcripts and audio recordings for deletion. The conversation must have ended.
|
|
274
|
+
*
|
|
275
|
+
* @param {string} id - The ID of the conversation to delete.
|
|
276
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
277
|
+
*
|
|
278
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
279
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
280
|
+
* @throws {@link Phonic.NotFoundError}
|
|
281
|
+
* @throws {@link Phonic.ConflictError}
|
|
282
|
+
* @throws {@link Phonic.InternalServerError}
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* await client.conversations.delete("id")
|
|
286
|
+
*/
|
|
287
|
+
delete(id, requestOptions) {
|
|
288
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
289
|
+
}
|
|
290
|
+
__delete(id, requestOptions) {
|
|
291
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
292
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
293
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
294
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
295
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
296
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
297
|
+
.base, `conversations/${core.url.encodePathParam(id)}`),
|
|
298
|
+
method: "DELETE",
|
|
299
|
+
headers: _headers,
|
|
300
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
301
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
302
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
303
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
304
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
305
|
+
logging: this._options.logging,
|
|
306
|
+
});
|
|
307
|
+
if (_response.ok) {
|
|
308
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
309
|
+
}
|
|
310
|
+
if (_response.error.reason === "status-code") {
|
|
311
|
+
switch (_response.error.statusCode) {
|
|
312
|
+
case 401:
|
|
313
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
314
|
+
case 403:
|
|
315
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
316
|
+
case 404:
|
|
317
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
318
|
+
case 409:
|
|
319
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
320
|
+
case 500:
|
|
321
|
+
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
322
|
+
default:
|
|
323
|
+
throw new errors.PhonicError({
|
|
324
|
+
statusCode: _response.error.statusCode,
|
|
325
|
+
body: _response.error.body,
|
|
326
|
+
rawResponse: _response.rawResponse,
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/conversations/{id}");
|
|
331
|
+
});
|
|
332
|
+
}
|
|
272
333
|
/**
|
|
273
334
|
* Returns an analysis of the specified conversation.
|
|
274
335
|
*
|
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./ConversationsCancelResponse.js"), exports);
|
|
18
|
+
__exportStar(require("./ConversationsDeleteResponse.js"), exports);
|
|
18
19
|
__exportStar(require("./ConversationsEvaluateResponse.js"), exports);
|
|
19
20
|
__exportStar(require("./ConversationsExtractDataResponse.js"), exports);
|
|
20
21
|
__exportStar(require("./ConversationsGetAnalysisResponse.js"), exports);
|
|
@@ -31,7 +31,6 @@ export declare class ProjectsClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @throws {@link Phonic.BadRequestError}
|
|
33
33
|
* @throws {@link Phonic.UnauthorizedError}
|
|
34
|
-
* @throws {@link Phonic.ConflictError}
|
|
35
34
|
* @throws {@link Phonic.InternalServerError}
|
|
36
35
|
*
|
|
37
36
|
* @example
|
|
@@ -66,6 +65,7 @@ export declare class ProjectsClient {
|
|
|
66
65
|
* @throws {@link Phonic.UnauthorizedError}
|
|
67
66
|
* @throws {@link Phonic.ForbiddenError}
|
|
68
67
|
* @throws {@link Phonic.NotFoundError}
|
|
68
|
+
* @throws {@link Phonic.ConflictError}
|
|
69
69
|
* @throws {@link Phonic.InternalServerError}
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
@@ -84,7 +84,6 @@ export declare class ProjectsClient {
|
|
|
84
84
|
* @throws {@link Phonic.UnauthorizedError}
|
|
85
85
|
* @throws {@link Phonic.ForbiddenError}
|
|
86
86
|
* @throws {@link Phonic.NotFoundError}
|
|
87
|
-
* @throws {@link Phonic.ConflictError}
|
|
88
87
|
* @throws {@link Phonic.InternalServerError}
|
|
89
88
|
*
|
|
90
89
|
* @example
|
|
@@ -122,7 +121,6 @@ export declare class ProjectsClient {
|
|
|
122
121
|
* @throws {@link Phonic.UnauthorizedError}
|
|
123
122
|
* @throws {@link Phonic.ForbiddenError}
|
|
124
123
|
* @throws {@link Phonic.NotFoundError}
|
|
125
|
-
* @throws {@link Phonic.ConflictError}
|
|
126
124
|
* @throws {@link Phonic.InternalServerError}
|
|
127
125
|
*
|
|
128
126
|
* @example
|
|
@@ -114,7 +114,6 @@ class ProjectsClient {
|
|
|
114
114
|
*
|
|
115
115
|
* @throws {@link Phonic.BadRequestError}
|
|
116
116
|
* @throws {@link Phonic.UnauthorizedError}
|
|
117
|
-
* @throws {@link Phonic.ConflictError}
|
|
118
117
|
* @throws {@link Phonic.InternalServerError}
|
|
119
118
|
*
|
|
120
119
|
* @example
|
|
@@ -154,8 +153,6 @@ class ProjectsClient {
|
|
|
154
153
|
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
155
154
|
case 401:
|
|
156
155
|
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
157
|
-
case 409:
|
|
158
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
159
156
|
case 500:
|
|
160
157
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
161
158
|
default:
|
|
@@ -236,6 +233,7 @@ class ProjectsClient {
|
|
|
236
233
|
* @throws {@link Phonic.UnauthorizedError}
|
|
237
234
|
* @throws {@link Phonic.ForbiddenError}
|
|
238
235
|
* @throws {@link Phonic.NotFoundError}
|
|
236
|
+
* @throws {@link Phonic.ConflictError}
|
|
239
237
|
* @throws {@link Phonic.InternalServerError}
|
|
240
238
|
*
|
|
241
239
|
* @example
|
|
@@ -272,6 +270,8 @@ class ProjectsClient {
|
|
|
272
270
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
273
271
|
case 404:
|
|
274
272
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
273
|
+
case 409:
|
|
274
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
275
275
|
case 500:
|
|
276
276
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
277
277
|
default:
|
|
@@ -296,7 +296,6 @@ class ProjectsClient {
|
|
|
296
296
|
* @throws {@link Phonic.UnauthorizedError}
|
|
297
297
|
* @throws {@link Phonic.ForbiddenError}
|
|
298
298
|
* @throws {@link Phonic.NotFoundError}
|
|
299
|
-
* @throws {@link Phonic.ConflictError}
|
|
300
299
|
* @throws {@link Phonic.InternalServerError}
|
|
301
300
|
*
|
|
302
301
|
* @example
|
|
@@ -341,8 +340,6 @@ class ProjectsClient {
|
|
|
341
340
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
342
341
|
case 404:
|
|
343
342
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
344
|
-
case 409:
|
|
345
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
346
343
|
case 500:
|
|
347
344
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
348
345
|
default:
|
|
@@ -428,7 +425,6 @@ class ProjectsClient {
|
|
|
428
425
|
* @throws {@link Phonic.UnauthorizedError}
|
|
429
426
|
* @throws {@link Phonic.ForbiddenError}
|
|
430
427
|
* @throws {@link Phonic.NotFoundError}
|
|
431
|
-
* @throws {@link Phonic.ConflictError}
|
|
432
428
|
* @throws {@link Phonic.InternalServerError}
|
|
433
429
|
*
|
|
434
430
|
* @example
|
|
@@ -476,8 +472,6 @@ class ProjectsClient {
|
|
|
476
472
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
477
473
|
case 404:
|
|
478
474
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
479
|
-
case 409:
|
|
480
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
481
475
|
case 500:
|
|
482
476
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
483
477
|
default:
|
|
@@ -26,6 +26,8 @@ export interface Agent {
|
|
|
26
26
|
generate_welcome_message: boolean;
|
|
27
27
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
28
28
|
is_welcome_message_interruptible: boolean;
|
|
29
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
30
|
+
websocket_timeout_sec?: number | undefined;
|
|
29
31
|
/** Message to play when the conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
30
32
|
welcome_message: string | null;
|
|
31
33
|
/** Instructions for the conversation. */
|
|
@@ -56,6 +58,8 @@ export interface Agent {
|
|
|
56
58
|
push_to_talk: boolean;
|
|
57
59
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
58
60
|
boosted_keywords: string[];
|
|
61
|
+
/** Names of observability integrations enabled for the agent. Each must be one of the supported providers. */
|
|
62
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
59
63
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
60
64
|
pronunciation_dictionary: Agent.PronunciationDictionary.Item[];
|
|
61
65
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -21,6 +21,8 @@ export interface ConfigOptions {
|
|
|
21
21
|
generate_welcome_message?: boolean | undefined;
|
|
22
22
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
23
23
|
is_welcome_message_interruptible?: boolean | undefined;
|
|
24
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
25
|
+
websocket_timeout_sec?: number | undefined;
|
|
24
26
|
/** Message to play when conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
25
27
|
welcome_message?: (string | null) | undefined;
|
|
26
28
|
/** Voice ID to use for speech synthesis */
|
|
@@ -55,6 +57,8 @@ export interface ConfigOptions {
|
|
|
55
57
|
multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
|
|
56
58
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
57
59
|
push_to_talk?: boolean | undefined;
|
|
60
|
+
/** When `true`, assistant audio is streamed to the client as fast as it is generated, rather than paced to real time. Defaults to false. */
|
|
61
|
+
stream_ahead_of_real_time?: boolean | undefined;
|
|
58
62
|
/** Keywords to boost in speech recognition */
|
|
59
63
|
boosted_keywords?: string[] | undefined;
|
|
60
64
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
@@ -67,6 +71,8 @@ export interface ConfigOptions {
|
|
|
67
71
|
enable_redaction?: boolean | undefined;
|
|
68
72
|
/** Names of pre-configured MCP servers to make available to the assistant. Names must be unique. */
|
|
69
73
|
mcp_servers?: string[] | undefined;
|
|
74
|
+
/** Names of observability integrations to enable for the conversation. Each must be one of the supported providers. */
|
|
75
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
70
76
|
/** Tasks the assistant should accomplish during the conversation. */
|
|
71
77
|
tasks?: ConfigOptions.Tasks.Item[] | undefined;
|
|
72
78
|
/** Pool of phone numbers to use as the caller ID for outbound calls. */
|
|
@@ -94,6 +100,7 @@ export declare namespace ConfigOptions {
|
|
|
94
100
|
/** Audio input format */
|
|
95
101
|
const InputFormat: {
|
|
96
102
|
readonly Pcm44100: "pcm_44100";
|
|
103
|
+
readonly Pcm24000: "pcm_24000";
|
|
97
104
|
readonly Pcm16000: "pcm_16000";
|
|
98
105
|
readonly Pcm8000: "pcm_8000";
|
|
99
106
|
readonly Mulaw8000: "mulaw_8000";
|
|
@@ -102,6 +109,7 @@ export declare namespace ConfigOptions {
|
|
|
102
109
|
/** Audio output format */
|
|
103
110
|
const OutputFormat: {
|
|
104
111
|
readonly Pcm44100: "pcm_44100";
|
|
112
|
+
readonly Pcm24000: "pcm_24000";
|
|
105
113
|
readonly Pcm16000: "pcm_16000";
|
|
106
114
|
readonly Pcm8000: "pcm_8000";
|
|
107
115
|
readonly Mulaw8000: "mulaw_8000";
|
|
@@ -13,6 +13,7 @@ var ConfigOptions;
|
|
|
13
13
|
/** Audio input format */
|
|
14
14
|
ConfigOptions.InputFormat = {
|
|
15
15
|
Pcm44100: "pcm_44100",
|
|
16
|
+
Pcm24000: "pcm_24000",
|
|
16
17
|
Pcm16000: "pcm_16000",
|
|
17
18
|
Pcm8000: "pcm_8000",
|
|
18
19
|
Mulaw8000: "mulaw_8000",
|
|
@@ -20,6 +21,7 @@ var ConfigOptions;
|
|
|
20
21
|
/** Audio output format */
|
|
21
22
|
ConfigOptions.OutputFormat = {
|
|
22
23
|
Pcm44100: "pcm_44100",
|
|
24
|
+
Pcm24000: "pcm_24000",
|
|
23
25
|
Pcm16000: "pcm_16000",
|
|
24
26
|
Pcm8000: "pcm_8000",
|
|
25
27
|
Mulaw8000: "mulaw_8000",
|
|
@@ -26,6 +26,8 @@ export interface CreateAgentRequest {
|
|
|
26
26
|
generate_welcome_message?: boolean | undefined;
|
|
27
27
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
28
28
|
is_welcome_message_interruptible?: boolean | undefined;
|
|
29
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
30
|
+
websocket_timeout_sec?: number | undefined;
|
|
29
31
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
30
32
|
welcome_message?: string | undefined;
|
|
31
33
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -82,6 +84,10 @@ export interface CreateAgentRequest {
|
|
|
82
84
|
vad_threshold?: number | undefined;
|
|
83
85
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
84
86
|
enable_redaction?: boolean | undefined;
|
|
87
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
88
|
+
mcp_server_ids?: string[] | undefined;
|
|
89
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
90
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
85
91
|
}
|
|
86
92
|
export declare namespace CreateAgentRequest {
|
|
87
93
|
const PhoneNumber: {
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.32.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.5";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "phonic",
|
|
9
|
-
"X-Fern-SDK-Version": "0.32.
|
|
10
|
-
"User-Agent": "phonic/0.32.
|
|
9
|
+
"X-Fern-SDK-Version": "0.32.5",
|
|
10
|
+
"User-Agent": "phonic/0.32.5",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -73,6 +73,8 @@ export interface AgentsCreateRequest {
|
|
|
73
73
|
generate_welcome_message?: boolean;
|
|
74
74
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
75
75
|
is_welcome_message_interruptible?: boolean;
|
|
76
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
77
|
+
websocket_timeout_sec?: number;
|
|
76
78
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
77
79
|
welcome_message?: string;
|
|
78
80
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -129,4 +131,8 @@ export interface AgentsCreateRequest {
|
|
|
129
131
|
vad_threshold?: number;
|
|
130
132
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
131
133
|
enable_redaction?: boolean;
|
|
134
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
135
|
+
mcp_server_ids?: string[];
|
|
136
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
137
|
+
observability_integrations?: "braintrust"[];
|
|
132
138
|
}
|
|
@@ -73,6 +73,8 @@ export interface UpdateAgentRequest {
|
|
|
73
73
|
generate_welcome_message?: boolean;
|
|
74
74
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
75
75
|
is_welcome_message_interruptible?: boolean;
|
|
76
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
77
|
+
websocket_timeout_sec?: number;
|
|
76
78
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
77
79
|
welcome_message?: string;
|
|
78
80
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -135,6 +137,10 @@ export interface UpdateAgentRequest {
|
|
|
135
137
|
vad_threshold?: number;
|
|
136
138
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
137
139
|
enable_redaction?: boolean;
|
|
140
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
141
|
+
mcp_server_ids?: string[];
|
|
142
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
143
|
+
observability_integrations?: "braintrust"[];
|
|
138
144
|
}
|
|
139
145
|
export declare namespace UpdateAgentRequest {
|
|
140
146
|
const PhoneNumber: {
|
|
@@ -87,6 +87,23 @@ export declare class ConversationsClient {
|
|
|
87
87
|
*/
|
|
88
88
|
cancel(id: string, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsCancelResponse>;
|
|
89
89
|
private __cancel;
|
|
90
|
+
/**
|
|
91
|
+
* Deletes a conversation, scheduling its transcripts and audio recordings for deletion. The conversation must have ended.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} id - The ID of the conversation to delete.
|
|
94
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
95
|
+
*
|
|
96
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
97
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
98
|
+
* @throws {@link Phonic.NotFoundError}
|
|
99
|
+
* @throws {@link Phonic.ConflictError}
|
|
100
|
+
* @throws {@link Phonic.InternalServerError}
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* await client.conversations.delete("id")
|
|
104
|
+
*/
|
|
105
|
+
delete(id: string, requestOptions?: ConversationsClient.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsDeleteResponse>;
|
|
106
|
+
private __delete;
|
|
90
107
|
/**
|
|
91
108
|
* Returns an analysis of the specified conversation.
|
|
92
109
|
*
|
|
@@ -233,6 +233,67 @@ export class ConversationsClient {
|
|
|
233
233
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/conversations/{id}/cancel");
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Deletes a conversation, scheduling its transcripts and audio recordings for deletion. The conversation must have ended.
|
|
238
|
+
*
|
|
239
|
+
* @param {string} id - The ID of the conversation to delete.
|
|
240
|
+
* @param {ConversationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
241
|
+
*
|
|
242
|
+
* @throws {@link Phonic.UnauthorizedError}
|
|
243
|
+
* @throws {@link Phonic.ForbiddenError}
|
|
244
|
+
* @throws {@link Phonic.NotFoundError}
|
|
245
|
+
* @throws {@link Phonic.ConflictError}
|
|
246
|
+
* @throws {@link Phonic.InternalServerError}
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* await client.conversations.delete("id")
|
|
250
|
+
*/
|
|
251
|
+
delete(id, requestOptions) {
|
|
252
|
+
return core.HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
253
|
+
}
|
|
254
|
+
__delete(id, requestOptions) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
257
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
258
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
259
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
260
|
+
url: core.url.join((_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : ((_d = (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.PhonicEnvironment.Default)
|
|
261
|
+
.base, `conversations/${core.url.encodePathParam(id)}`),
|
|
262
|
+
method: "DELETE",
|
|
263
|
+
headers: _headers,
|
|
264
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
265
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
266
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
267
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
268
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
269
|
+
logging: this._options.logging,
|
|
270
|
+
});
|
|
271
|
+
if (_response.ok) {
|
|
272
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
273
|
+
}
|
|
274
|
+
if (_response.error.reason === "status-code") {
|
|
275
|
+
switch (_response.error.statusCode) {
|
|
276
|
+
case 401:
|
|
277
|
+
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
278
|
+
case 403:
|
|
279
|
+
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
280
|
+
case 404:
|
|
281
|
+
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
282
|
+
case 409:
|
|
283
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
284
|
+
case 500:
|
|
285
|
+
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
286
|
+
default:
|
|
287
|
+
throw new errors.PhonicError({
|
|
288
|
+
statusCode: _response.error.statusCode,
|
|
289
|
+
body: _response.error.body,
|
|
290
|
+
rawResponse: _response.rawResponse,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/conversations/{id}");
|
|
295
|
+
});
|
|
296
|
+
}
|
|
236
297
|
/**
|
|
237
298
|
* Returns an analysis of the specified conversation.
|
|
238
299
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./ConversationsCancelResponse.mjs";
|
|
2
|
+
export * from "./ConversationsDeleteResponse.mjs";
|
|
2
3
|
export * from "./ConversationsEvaluateResponse.mjs";
|
|
3
4
|
export * from "./ConversationsExtractDataResponse.mjs";
|
|
4
5
|
export * from "./ConversationsGetAnalysisResponse.mjs";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from "./ConversationsCancelResponse.mjs";
|
|
2
|
+
export * from "./ConversationsDeleteResponse.mjs";
|
|
2
3
|
export * from "./ConversationsEvaluateResponse.mjs";
|
|
3
4
|
export * from "./ConversationsExtractDataResponse.mjs";
|
|
4
5
|
export * from "./ConversationsGetAnalysisResponse.mjs";
|
|
@@ -31,7 +31,6 @@ export declare class ProjectsClient {
|
|
|
31
31
|
*
|
|
32
32
|
* @throws {@link Phonic.BadRequestError}
|
|
33
33
|
* @throws {@link Phonic.UnauthorizedError}
|
|
34
|
-
* @throws {@link Phonic.ConflictError}
|
|
35
34
|
* @throws {@link Phonic.InternalServerError}
|
|
36
35
|
*
|
|
37
36
|
* @example
|
|
@@ -66,6 +65,7 @@ export declare class ProjectsClient {
|
|
|
66
65
|
* @throws {@link Phonic.UnauthorizedError}
|
|
67
66
|
* @throws {@link Phonic.ForbiddenError}
|
|
68
67
|
* @throws {@link Phonic.NotFoundError}
|
|
68
|
+
* @throws {@link Phonic.ConflictError}
|
|
69
69
|
* @throws {@link Phonic.InternalServerError}
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
@@ -84,7 +84,6 @@ export declare class ProjectsClient {
|
|
|
84
84
|
* @throws {@link Phonic.UnauthorizedError}
|
|
85
85
|
* @throws {@link Phonic.ForbiddenError}
|
|
86
86
|
* @throws {@link Phonic.NotFoundError}
|
|
87
|
-
* @throws {@link Phonic.ConflictError}
|
|
88
87
|
* @throws {@link Phonic.InternalServerError}
|
|
89
88
|
*
|
|
90
89
|
* @example
|
|
@@ -122,7 +121,6 @@ export declare class ProjectsClient {
|
|
|
122
121
|
* @throws {@link Phonic.UnauthorizedError}
|
|
123
122
|
* @throws {@link Phonic.ForbiddenError}
|
|
124
123
|
* @throws {@link Phonic.NotFoundError}
|
|
125
|
-
* @throws {@link Phonic.ConflictError}
|
|
126
124
|
* @throws {@link Phonic.InternalServerError}
|
|
127
125
|
*
|
|
128
126
|
* @example
|
|
@@ -78,7 +78,6 @@ export class ProjectsClient {
|
|
|
78
78
|
*
|
|
79
79
|
* @throws {@link Phonic.BadRequestError}
|
|
80
80
|
* @throws {@link Phonic.UnauthorizedError}
|
|
81
|
-
* @throws {@link Phonic.ConflictError}
|
|
82
81
|
* @throws {@link Phonic.InternalServerError}
|
|
83
82
|
*
|
|
84
83
|
* @example
|
|
@@ -118,8 +117,6 @@ export class ProjectsClient {
|
|
|
118
117
|
throw new Phonic.BadRequestError(_response.error.body, _response.rawResponse);
|
|
119
118
|
case 401:
|
|
120
119
|
throw new Phonic.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
121
|
-
case 409:
|
|
122
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
123
120
|
case 500:
|
|
124
121
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
125
122
|
default:
|
|
@@ -200,6 +197,7 @@ export class ProjectsClient {
|
|
|
200
197
|
* @throws {@link Phonic.UnauthorizedError}
|
|
201
198
|
* @throws {@link Phonic.ForbiddenError}
|
|
202
199
|
* @throws {@link Phonic.NotFoundError}
|
|
200
|
+
* @throws {@link Phonic.ConflictError}
|
|
203
201
|
* @throws {@link Phonic.InternalServerError}
|
|
204
202
|
*
|
|
205
203
|
* @example
|
|
@@ -236,6 +234,8 @@ export class ProjectsClient {
|
|
|
236
234
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
237
235
|
case 404:
|
|
238
236
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
237
|
+
case 409:
|
|
238
|
+
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
239
239
|
case 500:
|
|
240
240
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
241
241
|
default:
|
|
@@ -260,7 +260,6 @@ export class ProjectsClient {
|
|
|
260
260
|
* @throws {@link Phonic.UnauthorizedError}
|
|
261
261
|
* @throws {@link Phonic.ForbiddenError}
|
|
262
262
|
* @throws {@link Phonic.NotFoundError}
|
|
263
|
-
* @throws {@link Phonic.ConflictError}
|
|
264
263
|
* @throws {@link Phonic.InternalServerError}
|
|
265
264
|
*
|
|
266
265
|
* @example
|
|
@@ -305,8 +304,6 @@ export class ProjectsClient {
|
|
|
305
304
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
306
305
|
case 404:
|
|
307
306
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
308
|
-
case 409:
|
|
309
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
310
307
|
case 500:
|
|
311
308
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
312
309
|
default:
|
|
@@ -392,7 +389,6 @@ export class ProjectsClient {
|
|
|
392
389
|
* @throws {@link Phonic.UnauthorizedError}
|
|
393
390
|
* @throws {@link Phonic.ForbiddenError}
|
|
394
391
|
* @throws {@link Phonic.NotFoundError}
|
|
395
|
-
* @throws {@link Phonic.ConflictError}
|
|
396
392
|
* @throws {@link Phonic.InternalServerError}
|
|
397
393
|
*
|
|
398
394
|
* @example
|
|
@@ -440,8 +436,6 @@ export class ProjectsClient {
|
|
|
440
436
|
throw new Phonic.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
441
437
|
case 404:
|
|
442
438
|
throw new Phonic.NotFoundError(_response.error.body, _response.rawResponse);
|
|
443
|
-
case 409:
|
|
444
|
-
throw new Phonic.ConflictError(_response.error.body, _response.rawResponse);
|
|
445
439
|
case 500:
|
|
446
440
|
throw new Phonic.InternalServerError(_response.error.body, _response.rawResponse);
|
|
447
441
|
default:
|
|
@@ -26,6 +26,8 @@ export interface Agent {
|
|
|
26
26
|
generate_welcome_message: boolean;
|
|
27
27
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
28
28
|
is_welcome_message_interruptible: boolean;
|
|
29
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
30
|
+
websocket_timeout_sec?: number | undefined;
|
|
29
31
|
/** Message to play when the conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
30
32
|
welcome_message: string | null;
|
|
31
33
|
/** Instructions for the conversation. */
|
|
@@ -56,6 +58,8 @@ export interface Agent {
|
|
|
56
58
|
push_to_talk: boolean;
|
|
57
59
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
58
60
|
boosted_keywords: string[];
|
|
61
|
+
/** Names of observability integrations enabled for the agent. Each must be one of the supported providers. */
|
|
62
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
59
63
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
60
64
|
pronunciation_dictionary: Agent.PronunciationDictionary.Item[];
|
|
61
65
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -21,6 +21,8 @@ export interface ConfigOptions {
|
|
|
21
21
|
generate_welcome_message?: boolean | undefined;
|
|
22
22
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
23
23
|
is_welcome_message_interruptible?: boolean | undefined;
|
|
24
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
25
|
+
websocket_timeout_sec?: number | undefined;
|
|
24
26
|
/** Message to play when conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
25
27
|
welcome_message?: (string | null) | undefined;
|
|
26
28
|
/** Voice ID to use for speech synthesis */
|
|
@@ -55,6 +57,8 @@ export interface ConfigOptions {
|
|
|
55
57
|
multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
|
|
56
58
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
57
59
|
push_to_talk?: boolean | undefined;
|
|
60
|
+
/** When `true`, assistant audio is streamed to the client as fast as it is generated, rather than paced to real time. Defaults to false. */
|
|
61
|
+
stream_ahead_of_real_time?: boolean | undefined;
|
|
58
62
|
/** Keywords to boost in speech recognition */
|
|
59
63
|
boosted_keywords?: string[] | undefined;
|
|
60
64
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
@@ -67,6 +71,8 @@ export interface ConfigOptions {
|
|
|
67
71
|
enable_redaction?: boolean | undefined;
|
|
68
72
|
/** Names of pre-configured MCP servers to make available to the assistant. Names must be unique. */
|
|
69
73
|
mcp_servers?: string[] | undefined;
|
|
74
|
+
/** Names of observability integrations to enable for the conversation. Each must be one of the supported providers. */
|
|
75
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
70
76
|
/** Tasks the assistant should accomplish during the conversation. */
|
|
71
77
|
tasks?: ConfigOptions.Tasks.Item[] | undefined;
|
|
72
78
|
/** Pool of phone numbers to use as the caller ID for outbound calls. */
|
|
@@ -94,6 +100,7 @@ export declare namespace ConfigOptions {
|
|
|
94
100
|
/** Audio input format */
|
|
95
101
|
const InputFormat: {
|
|
96
102
|
readonly Pcm44100: "pcm_44100";
|
|
103
|
+
readonly Pcm24000: "pcm_24000";
|
|
97
104
|
readonly Pcm16000: "pcm_16000";
|
|
98
105
|
readonly Pcm8000: "pcm_8000";
|
|
99
106
|
readonly Mulaw8000: "mulaw_8000";
|
|
@@ -102,6 +109,7 @@ export declare namespace ConfigOptions {
|
|
|
102
109
|
/** Audio output format */
|
|
103
110
|
const OutputFormat: {
|
|
104
111
|
readonly Pcm44100: "pcm_44100";
|
|
112
|
+
readonly Pcm24000: "pcm_24000";
|
|
105
113
|
readonly Pcm16000: "pcm_16000";
|
|
106
114
|
readonly Pcm8000: "pcm_8000";
|
|
107
115
|
readonly Mulaw8000: "mulaw_8000";
|
|
@@ -10,6 +10,7 @@ export var ConfigOptions;
|
|
|
10
10
|
/** Audio input format */
|
|
11
11
|
ConfigOptions.InputFormat = {
|
|
12
12
|
Pcm44100: "pcm_44100",
|
|
13
|
+
Pcm24000: "pcm_24000",
|
|
13
14
|
Pcm16000: "pcm_16000",
|
|
14
15
|
Pcm8000: "pcm_8000",
|
|
15
16
|
Mulaw8000: "mulaw_8000",
|
|
@@ -17,6 +18,7 @@ export var ConfigOptions;
|
|
|
17
18
|
/** Audio output format */
|
|
18
19
|
ConfigOptions.OutputFormat = {
|
|
19
20
|
Pcm44100: "pcm_44100",
|
|
21
|
+
Pcm24000: "pcm_24000",
|
|
20
22
|
Pcm16000: "pcm_16000",
|
|
21
23
|
Pcm8000: "pcm_8000",
|
|
22
24
|
Mulaw8000: "mulaw_8000",
|
|
@@ -26,6 +26,8 @@ export interface CreateAgentRequest {
|
|
|
26
26
|
generate_welcome_message?: boolean | undefined;
|
|
27
27
|
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
28
28
|
is_welcome_message_interruptible?: boolean | undefined;
|
|
29
|
+
/** Number of seconds of inactivity before the conversation WebSocket is closed. */
|
|
30
|
+
websocket_timeout_sec?: number | undefined;
|
|
29
31
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
30
32
|
welcome_message?: string | undefined;
|
|
31
33
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -82,6 +84,10 @@ export interface CreateAgentRequest {
|
|
|
82
84
|
vad_threshold?: number | undefined;
|
|
83
85
|
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
84
86
|
enable_redaction?: boolean | undefined;
|
|
87
|
+
/** Array of MCP server IDs to make available to the agent. */
|
|
88
|
+
mcp_server_ids?: string[] | undefined;
|
|
89
|
+
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
90
|
+
observability_integrations?: "braintrust"[] | undefined;
|
|
85
91
|
}
|
|
86
92
|
export declare namespace CreateAgentRequest {
|
|
87
93
|
const PhoneNumber: {
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.32.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.5";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.32.
|
|
1
|
+
export const SDK_VERSION = "0.32.5";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2236,6 +2236,69 @@ await client.conversations.get("id");
|
|
|
2236
2236
|
</dl>
|
|
2237
2237
|
|
|
2238
2238
|
|
|
2239
|
+
</dd>
|
|
2240
|
+
</dl>
|
|
2241
|
+
</details>
|
|
2242
|
+
|
|
2243
|
+
<details><summary><code>client.conversations.<a href="/src/api/resources/conversations/client/Client.ts">delete</a>(id) -> Phonic.ConversationsDeleteResponse</code></summary>
|
|
2244
|
+
<dl>
|
|
2245
|
+
<dd>
|
|
2246
|
+
|
|
2247
|
+
#### 📝 Description
|
|
2248
|
+
|
|
2249
|
+
<dl>
|
|
2250
|
+
<dd>
|
|
2251
|
+
|
|
2252
|
+
<dl>
|
|
2253
|
+
<dd>
|
|
2254
|
+
|
|
2255
|
+
Deletes a conversation, scheduling its transcripts and audio recordings for deletion. The conversation must have ended.
|
|
2256
|
+
</dd>
|
|
2257
|
+
</dl>
|
|
2258
|
+
</dd>
|
|
2259
|
+
</dl>
|
|
2260
|
+
|
|
2261
|
+
#### 🔌 Usage
|
|
2262
|
+
|
|
2263
|
+
<dl>
|
|
2264
|
+
<dd>
|
|
2265
|
+
|
|
2266
|
+
<dl>
|
|
2267
|
+
<dd>
|
|
2268
|
+
|
|
2269
|
+
```typescript
|
|
2270
|
+
await client.conversations.delete("id");
|
|
2271
|
+
|
|
2272
|
+
```
|
|
2273
|
+
</dd>
|
|
2274
|
+
</dl>
|
|
2275
|
+
</dd>
|
|
2276
|
+
</dl>
|
|
2277
|
+
|
|
2278
|
+
#### ⚙️ Parameters
|
|
2279
|
+
|
|
2280
|
+
<dl>
|
|
2281
|
+
<dd>
|
|
2282
|
+
|
|
2283
|
+
<dl>
|
|
2284
|
+
<dd>
|
|
2285
|
+
|
|
2286
|
+
**id:** `string` — The ID of the conversation to delete.
|
|
2287
|
+
|
|
2288
|
+
</dd>
|
|
2289
|
+
</dl>
|
|
2290
|
+
|
|
2291
|
+
<dl>
|
|
2292
|
+
<dd>
|
|
2293
|
+
|
|
2294
|
+
**requestOptions:** `ConversationsClient.RequestOptions`
|
|
2295
|
+
|
|
2296
|
+
</dd>
|
|
2297
|
+
</dl>
|
|
2298
|
+
</dd>
|
|
2299
|
+
</dl>
|
|
2300
|
+
|
|
2301
|
+
|
|
2239
2302
|
</dd>
|
|
2240
2303
|
</dl>
|
|
2241
2304
|
</details>
|