phonic 0.30.18 → 0.30.20
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/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +5 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +10 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +4 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +2 -9
- package/dist/cjs/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.ts +0 -4
- package/dist/cjs/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.ts +2 -0
- package/dist/cjs/api/resources/tools/client/Client.d.ts +21 -2
- package/dist/cjs/api/resources/tools/client/Client.js +21 -2
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +25 -3
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +1 -0
- package/dist/cjs/api/resources/tools/client/requests/ToolsGetRequest.d.ts +5 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +4 -1
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +1 -0
- package/dist/cjs/api/types/Agent.d.ts +3 -1
- package/dist/cjs/api/types/Conversation.d.ts +13 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +10 -1
- package/dist/cjs/api/types/CreateAgentRequest.js +4 -0
- package/dist/cjs/api/types/Tool.d.ts +4 -1
- package/dist/cjs/api/types/Tool.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +5 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +10 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +4 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +2 -9
- package/dist/esm/api/resources/conversations/client/requests/ConversationsSipOutboundCallRequest.d.mts +0 -4
- package/dist/esm/api/resources/conversations/types/ConversationsSipOutboundCallResponse.d.mts +2 -0
- package/dist/esm/api/resources/tools/client/Client.d.mts +21 -2
- package/dist/esm/api/resources/tools/client/Client.mjs +21 -2
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +25 -3
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +1 -0
- package/dist/esm/api/resources/tools/client/requests/ToolsGetRequest.d.mts +5 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +4 -1
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +1 -0
- package/dist/esm/api/types/Agent.d.mts +3 -1
- package/dist/esm/api/types/Conversation.d.mts +13 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +10 -1
- package/dist/esm/api/types/CreateAgentRequest.mjs +4 -0
- package/dist/esm/api/types/Tool.d.mts +4 -1
- package/dist/esm/api/types/Tool.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +6 -20
package/dist/cjs/Client.js
CHANGED
|
@@ -50,8 +50,8 @@ class PhonicClient {
|
|
|
50
50
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
51
51
|
"X-Fern-Language": "JavaScript",
|
|
52
52
|
"X-Fern-SDK-Name": "phonic",
|
|
53
|
-
"X-Fern-SDK-Version": "0.30.
|
|
54
|
-
"User-Agent": "phonic/0.30.
|
|
53
|
+
"X-Fern-SDK-Version": "0.30.20",
|
|
54
|
+
"User-Agent": "phonic/0.30.20",
|
|
55
55
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
56
56
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
57
57
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -41,7 +41,11 @@ export interface AgentsCreateRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name: string;
|
|
44
|
-
phone_number:
|
|
44
|
+
phone_number: Phonic.CreateAgentRequest.PhoneNumber | null;
|
|
45
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
46
|
+
custom_phone_number?: string | null;
|
|
47
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
48
|
+
custom_phone_numbers?: string[];
|
|
45
49
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
50
|
timezone?: string;
|
|
47
51
|
/** The voice ID to use. */
|
|
@@ -41,7 +41,11 @@ export interface UpdateAgentRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name?: string;
|
|
44
|
-
phone_number:
|
|
44
|
+
phone_number: UpdateAgentRequest.PhoneNumber | null;
|
|
45
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
46
|
+
custom_phone_number?: string | null;
|
|
47
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
48
|
+
custom_phone_numbers?: string[];
|
|
45
49
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
50
|
timezone?: string;
|
|
47
51
|
/** The voice ID to use. */
|
|
@@ -78,6 +82,11 @@ export interface UpdateAgentRequest {
|
|
|
78
82
|
configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint | null;
|
|
79
83
|
}
|
|
80
84
|
export declare namespace UpdateAgentRequest {
|
|
85
|
+
type PhoneNumber = "assign-automatically" | "custom";
|
|
86
|
+
const PhoneNumber: {
|
|
87
|
+
readonly AssignAutomatically: "assign-automatically";
|
|
88
|
+
readonly Custom: "custom";
|
|
89
|
+
};
|
|
81
90
|
/**
|
|
82
91
|
* The audio format of the agent.
|
|
83
92
|
*/
|
|
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.UpdateAgentRequest = void 0;
|
|
7
7
|
var UpdateAgentRequest;
|
|
8
8
|
(function (UpdateAgentRequest) {
|
|
9
|
+
UpdateAgentRequest.PhoneNumber = {
|
|
10
|
+
AssignAutomatically: "assign-automatically",
|
|
11
|
+
Custom: "custom",
|
|
12
|
+
};
|
|
9
13
|
UpdateAgentRequest.AudioFormat = {
|
|
10
14
|
Pcm44100: "pcm_44100",
|
|
11
15
|
Pcm16000: "pcm_16000",
|
|
@@ -803,14 +803,7 @@ class Conversations {
|
|
|
803
803
|
__sipOutboundCall(request, requestOptions) {
|
|
804
804
|
return __awaiter(this, void 0, void 0, function* () {
|
|
805
805
|
var _a, _b, _c, _d;
|
|
806
|
-
const {
|
|
807
|
-
const _queryParams = {};
|
|
808
|
-
if (token != null) {
|
|
809
|
-
_queryParams["token"] = token;
|
|
810
|
-
}
|
|
811
|
-
if (downstreamWebsocketUrl != null) {
|
|
812
|
-
_queryParams["downstream_websocket_url"] = downstreamWebsocketUrl;
|
|
813
|
-
}
|
|
806
|
+
const { "X-Sip-Address": sipAddress, "X-Sip-Auth-Username": sipAuthUsername, "X-Sip-Auth-Password": sipAuthPassword } = request, _body = __rest(request, ["X-Sip-Address", "X-Sip-Auth-Username", "X-Sip-Auth-Password"]);
|
|
814
807
|
let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
815
808
|
Authorization: yield this._getAuthorizationHeader(),
|
|
816
809
|
"X-Sip-Address": sipAddress,
|
|
@@ -823,7 +816,7 @@ class Conversations {
|
|
|
823
816
|
method: "POST",
|
|
824
817
|
headers: _headers,
|
|
825
818
|
contentType: "application/json",
|
|
826
|
-
queryParameters:
|
|
819
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
827
820
|
requestType: "json",
|
|
828
821
|
body: _body,
|
|
829
822
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -11,10 +11,6 @@ import * as Phonic from "../../../../index.js";
|
|
|
11
11
|
* }
|
|
12
12
|
*/
|
|
13
13
|
export interface ConversationsSipOutboundCallRequest {
|
|
14
|
-
/** Optional session token used for STS authorization. */
|
|
15
|
-
token?: string;
|
|
16
|
-
/** Optional downstream STS WebSocket URL to override the default. */
|
|
17
|
-
downstream_websocket_url?: string;
|
|
18
14
|
/** SIP address of the user's SIP trunk. Required. */
|
|
19
15
|
"X-Sip-Address": string;
|
|
20
16
|
/** SIP auth username, if your provider requires it. */
|
|
@@ -58,6 +58,23 @@ export declare class Tools {
|
|
|
58
58
|
* @example
|
|
59
59
|
* await client.tools.create({
|
|
60
60
|
* project: "main",
|
|
61
|
+
* name: "context_printer",
|
|
62
|
+
* description: "Gets the specific context for fixing our printer",
|
|
63
|
+
* type: "custom_context",
|
|
64
|
+
* execution_mode: "sync",
|
|
65
|
+
* parameters: [{
|
|
66
|
+
* type: "string",
|
|
67
|
+
* name: "name",
|
|
68
|
+
* description: "description",
|
|
69
|
+
* is_required: true
|
|
70
|
+
* }],
|
|
71
|
+
* require_speech_before_tool_call: false,
|
|
72
|
+
* forbid_speech_after_tool_call: false
|
|
73
|
+
* })
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.tools.create({
|
|
77
|
+
* project: "main",
|
|
61
78
|
* name: "book_appointment",
|
|
62
79
|
* description: "Books an appointment in the calendar system",
|
|
63
80
|
* type: "custom_webhook",
|
|
@@ -82,7 +99,8 @@ export declare class Tools {
|
|
|
82
99
|
* "Content-Type": "application/json"
|
|
83
100
|
* },
|
|
84
101
|
* endpoint_timeout_ms: 5000,
|
|
85
|
-
* require_speech_before_tool_call: false
|
|
102
|
+
* require_speech_before_tool_call: false,
|
|
103
|
+
* forbid_speech_after_tool_call: false
|
|
86
104
|
* })
|
|
87
105
|
*
|
|
88
106
|
* @example
|
|
@@ -99,7 +117,8 @@ export declare class Tools {
|
|
|
99
117
|
* is_required: true
|
|
100
118
|
* }],
|
|
101
119
|
* tool_call_output_timeout_ms: 5000,
|
|
102
|
-
* require_speech_before_tool_call: false
|
|
120
|
+
* require_speech_before_tool_call: false,
|
|
121
|
+
* forbid_speech_after_tool_call: false
|
|
103
122
|
* })
|
|
104
123
|
*
|
|
105
124
|
* @example
|
|
@@ -146,6 +146,23 @@ class Tools {
|
|
|
146
146
|
* @example
|
|
147
147
|
* await client.tools.create({
|
|
148
148
|
* project: "main",
|
|
149
|
+
* name: "context_printer",
|
|
150
|
+
* description: "Gets the specific context for fixing our printer",
|
|
151
|
+
* type: "custom_context",
|
|
152
|
+
* execution_mode: "sync",
|
|
153
|
+
* parameters: [{
|
|
154
|
+
* type: "string",
|
|
155
|
+
* name: "name",
|
|
156
|
+
* description: "description",
|
|
157
|
+
* is_required: true
|
|
158
|
+
* }],
|
|
159
|
+
* require_speech_before_tool_call: false,
|
|
160
|
+
* forbid_speech_after_tool_call: false
|
|
161
|
+
* })
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* await client.tools.create({
|
|
165
|
+
* project: "main",
|
|
149
166
|
* name: "book_appointment",
|
|
150
167
|
* description: "Books an appointment in the calendar system",
|
|
151
168
|
* type: "custom_webhook",
|
|
@@ -170,7 +187,8 @@ class Tools {
|
|
|
170
187
|
* "Content-Type": "application/json"
|
|
171
188
|
* },
|
|
172
189
|
* endpoint_timeout_ms: 5000,
|
|
173
|
-
* require_speech_before_tool_call: false
|
|
190
|
+
* require_speech_before_tool_call: false,
|
|
191
|
+
* forbid_speech_after_tool_call: false
|
|
174
192
|
* })
|
|
175
193
|
*
|
|
176
194
|
* @example
|
|
@@ -187,7 +205,8 @@ class Tools {
|
|
|
187
205
|
* is_required: true
|
|
188
206
|
* }],
|
|
189
207
|
* tool_call_output_timeout_ms: 5000,
|
|
190
|
-
* require_speech_before_tool_call: false
|
|
208
|
+
* require_speech_before_tool_call: false,
|
|
209
|
+
* forbid_speech_after_tool_call: false
|
|
191
210
|
* })
|
|
192
211
|
*
|
|
193
212
|
* @example
|
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Phonic from "../../../../index.js";
|
|
5
5
|
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* project: "main",
|
|
9
|
+
* name: "context_printer",
|
|
10
|
+
* description: "Gets the specific context for fixing our printer",
|
|
11
|
+
* type: "custom_context",
|
|
12
|
+
* execution_mode: "sync",
|
|
13
|
+
* parameters: [{
|
|
14
|
+
* type: "string",
|
|
15
|
+
* name: "name",
|
|
16
|
+
* description: "description",
|
|
17
|
+
* is_required: true
|
|
18
|
+
* }],
|
|
19
|
+
* require_speech_before_tool_call: false,
|
|
20
|
+
* forbid_speech_after_tool_call: false
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
6
23
|
* @example
|
|
7
24
|
* {
|
|
8
25
|
* project: "main",
|
|
@@ -30,7 +47,8 @@ import * as Phonic from "../../../../index.js";
|
|
|
30
47
|
* "Content-Type": "application/json"
|
|
31
48
|
* },
|
|
32
49
|
* endpoint_timeout_ms: 5000,
|
|
33
|
-
* require_speech_before_tool_call: false
|
|
50
|
+
* require_speech_before_tool_call: false,
|
|
51
|
+
* forbid_speech_after_tool_call: false
|
|
34
52
|
* }
|
|
35
53
|
*
|
|
36
54
|
* @example
|
|
@@ -47,7 +65,8 @@ import * as Phonic from "../../../../index.js";
|
|
|
47
65
|
* is_required: true
|
|
48
66
|
* }],
|
|
49
67
|
* tool_call_output_timeout_ms: 5000,
|
|
50
|
-
* require_speech_before_tool_call: false
|
|
68
|
+
* require_speech_before_tool_call: false,
|
|
69
|
+
* forbid_speech_after_tool_call: false
|
|
51
70
|
* }
|
|
52
71
|
*
|
|
53
72
|
* @example
|
|
@@ -109,13 +128,16 @@ export interface CreateToolRequest {
|
|
|
109
128
|
agents_to_transfer_to?: string[];
|
|
110
129
|
/** When true, forces the agent to speak before executing the tool. */
|
|
111
130
|
require_speech_before_tool_call?: boolean;
|
|
131
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
132
|
+
forbid_speech_after_tool_call?: boolean;
|
|
112
133
|
}
|
|
113
134
|
export declare namespace CreateToolRequest {
|
|
114
135
|
/**
|
|
115
136
|
* The type of tool.
|
|
116
137
|
*/
|
|
117
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
138
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
118
139
|
const Type: {
|
|
140
|
+
readonly CustomContext: "custom_context";
|
|
119
141
|
readonly CustomWebhook: "custom_webhook";
|
|
120
142
|
readonly CustomWebsocket: "custom_websocket";
|
|
121
143
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
@@ -7,6 +7,7 @@ exports.CreateToolRequest = void 0;
|
|
|
7
7
|
var CreateToolRequest;
|
|
8
8
|
(function (CreateToolRequest) {
|
|
9
9
|
CreateToolRequest.Type = {
|
|
10
|
+
CustomContext: "custom_context",
|
|
10
11
|
CustomWebhook: "custom_webhook",
|
|
11
12
|
CustomWebsocket: "custom_websocket",
|
|
12
13
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
@@ -45,13 +45,16 @@ export interface UpdateToolRequest {
|
|
|
45
45
|
agents_to_transfer_to?: string[];
|
|
46
46
|
/** When true, forces the agent to speak before executing the tool. */
|
|
47
47
|
require_speech_before_tool_call?: boolean;
|
|
48
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
49
|
+
forbid_speech_after_tool_call?: boolean;
|
|
48
50
|
}
|
|
49
51
|
export declare namespace UpdateToolRequest {
|
|
50
52
|
/**
|
|
51
53
|
* The type of tool.
|
|
52
54
|
*/
|
|
53
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
55
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
54
56
|
const Type: {
|
|
57
|
+
readonly CustomContext: "custom_context";
|
|
55
58
|
readonly CustomWebhook: "custom_webhook";
|
|
56
59
|
readonly CustomWebsocket: "custom_websocket";
|
|
57
60
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
@@ -7,6 +7,7 @@ exports.UpdateToolRequest = void 0;
|
|
|
7
7
|
var UpdateToolRequest;
|
|
8
8
|
(function (UpdateToolRequest) {
|
|
9
9
|
UpdateToolRequest.Type = {
|
|
10
|
+
CustomContext: "custom_context",
|
|
10
11
|
CustomWebhook: "custom_webhook",
|
|
11
12
|
CustomWebsocket: "custom_websocket",
|
|
12
13
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
@@ -7,8 +7,10 @@ export interface Agent {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** The name of the agent. */
|
|
9
9
|
name: string;
|
|
10
|
-
/** The phone number that the agent uses to accept
|
|
10
|
+
/** The phone number that the agent uses to accept calls. `null` if the agent is not associated with a phone number, in which can the agent can be used via WebSockets. This field is deprecated. Use `phone_numbers` instead. */
|
|
11
11
|
phone_number: string | null;
|
|
12
|
+
/** Array of phone numbers that the agent uses to accept phone calls. */
|
|
13
|
+
phone_numbers: string[];
|
|
12
14
|
/** The project the agent belongs to. */
|
|
13
15
|
project: Agent.Project;
|
|
14
16
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
@@ -55,6 +55,8 @@ export interface Conversation {
|
|
|
55
55
|
task_results: Record<string, unknown>;
|
|
56
56
|
/** Array of conversation items (turns). */
|
|
57
57
|
items: Phonic.ConversationItem[];
|
|
58
|
+
/** Phone call metadata. `null` for non-phone call conversations. */
|
|
59
|
+
call_info: Conversation.CallInfo | null;
|
|
58
60
|
}
|
|
59
61
|
export declare namespace Conversation {
|
|
60
62
|
/**
|
|
@@ -97,4 +99,15 @@ export declare namespace Conversation {
|
|
|
97
99
|
readonly Assistant: "assistant";
|
|
98
100
|
readonly Error: "error";
|
|
99
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Phone call metadata. `null` for non-phone call conversations.
|
|
104
|
+
*/
|
|
105
|
+
interface CallInfo {
|
|
106
|
+
/** Caller phone number in E.164 format. */
|
|
107
|
+
from_phone_number: string;
|
|
108
|
+
/** Callee phone number in E.164 format. */
|
|
109
|
+
to_phone_number: string;
|
|
110
|
+
/** Twilio Call SID. Only present for user SIP trunking calls. */
|
|
111
|
+
twilio_call_sid?: string;
|
|
112
|
+
}
|
|
100
113
|
}
|
|
@@ -5,7 +5,11 @@ import * as Phonic from "../index.js";
|
|
|
5
5
|
export interface CreateAgentRequest {
|
|
6
6
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
7
7
|
name: string;
|
|
8
|
-
phone_number:
|
|
8
|
+
phone_number: CreateAgentRequest.PhoneNumber | null;
|
|
9
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
10
|
+
custom_phone_number?: string | null;
|
|
11
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
12
|
+
custom_phone_numbers?: string[];
|
|
9
13
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
10
14
|
timezone?: string;
|
|
11
15
|
/** The voice ID to use. */
|
|
@@ -42,6 +46,11 @@ export interface CreateAgentRequest {
|
|
|
42
46
|
configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null;
|
|
43
47
|
}
|
|
44
48
|
export declare namespace CreateAgentRequest {
|
|
49
|
+
type PhoneNumber = "assign-automatically" | "custom";
|
|
50
|
+
const PhoneNumber: {
|
|
51
|
+
readonly AssignAutomatically: "assign-automatically";
|
|
52
|
+
readonly Custom: "custom";
|
|
53
|
+
};
|
|
45
54
|
/**
|
|
46
55
|
* The audio format of the agent.
|
|
47
56
|
*/
|
|
@@ -6,6 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CreateAgentRequest = void 0;
|
|
7
7
|
var CreateAgentRequest;
|
|
8
8
|
(function (CreateAgentRequest) {
|
|
9
|
+
CreateAgentRequest.PhoneNumber = {
|
|
10
|
+
AssignAutomatically: "assign-automatically",
|
|
11
|
+
Custom: "custom",
|
|
12
|
+
};
|
|
9
13
|
CreateAgentRequest.AudioFormat = {
|
|
10
14
|
Pcm44100: "pcm_44100",
|
|
11
15
|
Pcm16000: "pcm_16000",
|
|
@@ -34,6 +34,8 @@ export interface Tool {
|
|
|
34
34
|
agents_to_transfer_to?: string[];
|
|
35
35
|
/** When true, forces the agent to speak before executing the tool. */
|
|
36
36
|
require_speech_before_tool_call?: boolean;
|
|
37
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
38
|
+
forbid_speech_after_tool_call?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export declare namespace Tool {
|
|
39
41
|
interface Project {
|
|
@@ -43,8 +45,9 @@ export declare namespace Tool {
|
|
|
43
45
|
/**
|
|
44
46
|
* The type of tool.
|
|
45
47
|
*/
|
|
46
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
48
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
47
49
|
const Type: {
|
|
50
|
+
readonly CustomContext: "custom_context";
|
|
48
51
|
readonly CustomWebhook: "custom_webhook";
|
|
49
52
|
readonly CustomWebsocket: "custom_websocket";
|
|
50
53
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.30.
|
|
1
|
+
export declare const SDK_VERSION = "0.30.20";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -14,8 +14,8 @@ export class PhonicClient {
|
|
|
14
14
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
15
15
|
"X-Fern-Language": "JavaScript",
|
|
16
16
|
"X-Fern-SDK-Name": "phonic",
|
|
17
|
-
"X-Fern-SDK-Version": "0.30.
|
|
18
|
-
"User-Agent": "phonic/0.30.
|
|
17
|
+
"X-Fern-SDK-Version": "0.30.20",
|
|
18
|
+
"User-Agent": "phonic/0.30.20",
|
|
19
19
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
20
20
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
21
21
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -41,7 +41,11 @@ export interface AgentsCreateRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name: string;
|
|
44
|
-
phone_number:
|
|
44
|
+
phone_number: Phonic.CreateAgentRequest.PhoneNumber | null;
|
|
45
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
46
|
+
custom_phone_number?: string | null;
|
|
47
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
48
|
+
custom_phone_numbers?: string[];
|
|
45
49
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
50
|
timezone?: string;
|
|
47
51
|
/** The voice ID to use. */
|
|
@@ -41,7 +41,11 @@ export interface UpdateAgentRequest {
|
|
|
41
41
|
project?: string;
|
|
42
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
43
43
|
name?: string;
|
|
44
|
-
phone_number:
|
|
44
|
+
phone_number: UpdateAgentRequest.PhoneNumber | null;
|
|
45
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
46
|
+
custom_phone_number?: string | null;
|
|
47
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
48
|
+
custom_phone_numbers?: string[];
|
|
45
49
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
46
50
|
timezone?: string;
|
|
47
51
|
/** The voice ID to use. */
|
|
@@ -78,6 +82,11 @@ export interface UpdateAgentRequest {
|
|
|
78
82
|
configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint | null;
|
|
79
83
|
}
|
|
80
84
|
export declare namespace UpdateAgentRequest {
|
|
85
|
+
type PhoneNumber = "assign-automatically" | "custom";
|
|
86
|
+
const PhoneNumber: {
|
|
87
|
+
readonly AssignAutomatically: "assign-automatically";
|
|
88
|
+
readonly Custom: "custom";
|
|
89
|
+
};
|
|
81
90
|
/**
|
|
82
91
|
* The audio format of the agent.
|
|
83
92
|
*/
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export var UpdateAgentRequest;
|
|
5
5
|
(function (UpdateAgentRequest) {
|
|
6
|
+
UpdateAgentRequest.PhoneNumber = {
|
|
7
|
+
AssignAutomatically: "assign-automatically",
|
|
8
|
+
Custom: "custom",
|
|
9
|
+
};
|
|
6
10
|
UpdateAgentRequest.AudioFormat = {
|
|
7
11
|
Pcm44100: "pcm_44100",
|
|
8
12
|
Pcm16000: "pcm_16000",
|
|
@@ -767,14 +767,7 @@ export class Conversations {
|
|
|
767
767
|
__sipOutboundCall(request, requestOptions) {
|
|
768
768
|
return __awaiter(this, void 0, void 0, function* () {
|
|
769
769
|
var _a, _b, _c, _d;
|
|
770
|
-
const {
|
|
771
|
-
const _queryParams = {};
|
|
772
|
-
if (token != null) {
|
|
773
|
-
_queryParams["token"] = token;
|
|
774
|
-
}
|
|
775
|
-
if (downstreamWebsocketUrl != null) {
|
|
776
|
-
_queryParams["downstream_websocket_url"] = downstreamWebsocketUrl;
|
|
777
|
-
}
|
|
770
|
+
const { "X-Sip-Address": sipAddress, "X-Sip-Auth-Username": sipAuthUsername, "X-Sip-Auth-Password": sipAuthPassword } = request, _body = __rest(request, ["X-Sip-Address", "X-Sip-Auth-Username", "X-Sip-Auth-Password"]);
|
|
778
771
|
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
779
772
|
Authorization: yield this._getAuthorizationHeader(),
|
|
780
773
|
"X-Sip-Address": sipAddress,
|
|
@@ -787,7 +780,7 @@ export class Conversations {
|
|
|
787
780
|
method: "POST",
|
|
788
781
|
headers: _headers,
|
|
789
782
|
contentType: "application/json",
|
|
790
|
-
queryParameters:
|
|
783
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
791
784
|
requestType: "json",
|
|
792
785
|
body: _body,
|
|
793
786
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -11,10 +11,6 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
11
11
|
* }
|
|
12
12
|
*/
|
|
13
13
|
export interface ConversationsSipOutboundCallRequest {
|
|
14
|
-
/** Optional session token used for STS authorization. */
|
|
15
|
-
token?: string;
|
|
16
|
-
/** Optional downstream STS WebSocket URL to override the default. */
|
|
17
|
-
downstream_websocket_url?: string;
|
|
18
14
|
/** SIP address of the user's SIP trunk. Required. */
|
|
19
15
|
"X-Sip-Address": string;
|
|
20
16
|
/** SIP auth username, if your provider requires it. */
|
|
@@ -58,6 +58,23 @@ export declare class Tools {
|
|
|
58
58
|
* @example
|
|
59
59
|
* await client.tools.create({
|
|
60
60
|
* project: "main",
|
|
61
|
+
* name: "context_printer",
|
|
62
|
+
* description: "Gets the specific context for fixing our printer",
|
|
63
|
+
* type: "custom_context",
|
|
64
|
+
* execution_mode: "sync",
|
|
65
|
+
* parameters: [{
|
|
66
|
+
* type: "string",
|
|
67
|
+
* name: "name",
|
|
68
|
+
* description: "description",
|
|
69
|
+
* is_required: true
|
|
70
|
+
* }],
|
|
71
|
+
* require_speech_before_tool_call: false,
|
|
72
|
+
* forbid_speech_after_tool_call: false
|
|
73
|
+
* })
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* await client.tools.create({
|
|
77
|
+
* project: "main",
|
|
61
78
|
* name: "book_appointment",
|
|
62
79
|
* description: "Books an appointment in the calendar system",
|
|
63
80
|
* type: "custom_webhook",
|
|
@@ -82,7 +99,8 @@ export declare class Tools {
|
|
|
82
99
|
* "Content-Type": "application/json"
|
|
83
100
|
* },
|
|
84
101
|
* endpoint_timeout_ms: 5000,
|
|
85
|
-
* require_speech_before_tool_call: false
|
|
102
|
+
* require_speech_before_tool_call: false,
|
|
103
|
+
* forbid_speech_after_tool_call: false
|
|
86
104
|
* })
|
|
87
105
|
*
|
|
88
106
|
* @example
|
|
@@ -99,7 +117,8 @@ export declare class Tools {
|
|
|
99
117
|
* is_required: true
|
|
100
118
|
* }],
|
|
101
119
|
* tool_call_output_timeout_ms: 5000,
|
|
102
|
-
* require_speech_before_tool_call: false
|
|
120
|
+
* require_speech_before_tool_call: false,
|
|
121
|
+
* forbid_speech_after_tool_call: false
|
|
103
122
|
* })
|
|
104
123
|
*
|
|
105
124
|
* @example
|
|
@@ -110,6 +110,23 @@ export class Tools {
|
|
|
110
110
|
* @example
|
|
111
111
|
* await client.tools.create({
|
|
112
112
|
* project: "main",
|
|
113
|
+
* name: "context_printer",
|
|
114
|
+
* description: "Gets the specific context for fixing our printer",
|
|
115
|
+
* type: "custom_context",
|
|
116
|
+
* execution_mode: "sync",
|
|
117
|
+
* parameters: [{
|
|
118
|
+
* type: "string",
|
|
119
|
+
* name: "name",
|
|
120
|
+
* description: "description",
|
|
121
|
+
* is_required: true
|
|
122
|
+
* }],
|
|
123
|
+
* require_speech_before_tool_call: false,
|
|
124
|
+
* forbid_speech_after_tool_call: false
|
|
125
|
+
* })
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* await client.tools.create({
|
|
129
|
+
* project: "main",
|
|
113
130
|
* name: "book_appointment",
|
|
114
131
|
* description: "Books an appointment in the calendar system",
|
|
115
132
|
* type: "custom_webhook",
|
|
@@ -134,7 +151,8 @@ export class Tools {
|
|
|
134
151
|
* "Content-Type": "application/json"
|
|
135
152
|
* },
|
|
136
153
|
* endpoint_timeout_ms: 5000,
|
|
137
|
-
* require_speech_before_tool_call: false
|
|
154
|
+
* require_speech_before_tool_call: false,
|
|
155
|
+
* forbid_speech_after_tool_call: false
|
|
138
156
|
* })
|
|
139
157
|
*
|
|
140
158
|
* @example
|
|
@@ -151,7 +169,8 @@ export class Tools {
|
|
|
151
169
|
* is_required: true
|
|
152
170
|
* }],
|
|
153
171
|
* tool_call_output_timeout_ms: 5000,
|
|
154
|
-
* require_speech_before_tool_call: false
|
|
172
|
+
* require_speech_before_tool_call: false,
|
|
173
|
+
* forbid_speech_after_tool_call: false
|
|
155
174
|
* })
|
|
156
175
|
*
|
|
157
176
|
* @example
|
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as Phonic from "../../../../index.mjs";
|
|
5
5
|
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* project: "main",
|
|
9
|
+
* name: "context_printer",
|
|
10
|
+
* description: "Gets the specific context for fixing our printer",
|
|
11
|
+
* type: "custom_context",
|
|
12
|
+
* execution_mode: "sync",
|
|
13
|
+
* parameters: [{
|
|
14
|
+
* type: "string",
|
|
15
|
+
* name: "name",
|
|
16
|
+
* description: "description",
|
|
17
|
+
* is_required: true
|
|
18
|
+
* }],
|
|
19
|
+
* require_speech_before_tool_call: false,
|
|
20
|
+
* forbid_speech_after_tool_call: false
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
6
23
|
* @example
|
|
7
24
|
* {
|
|
8
25
|
* project: "main",
|
|
@@ -30,7 +47,8 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
30
47
|
* "Content-Type": "application/json"
|
|
31
48
|
* },
|
|
32
49
|
* endpoint_timeout_ms: 5000,
|
|
33
|
-
* require_speech_before_tool_call: false
|
|
50
|
+
* require_speech_before_tool_call: false,
|
|
51
|
+
* forbid_speech_after_tool_call: false
|
|
34
52
|
* }
|
|
35
53
|
*
|
|
36
54
|
* @example
|
|
@@ -47,7 +65,8 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
47
65
|
* is_required: true
|
|
48
66
|
* }],
|
|
49
67
|
* tool_call_output_timeout_ms: 5000,
|
|
50
|
-
* require_speech_before_tool_call: false
|
|
68
|
+
* require_speech_before_tool_call: false,
|
|
69
|
+
* forbid_speech_after_tool_call: false
|
|
51
70
|
* }
|
|
52
71
|
*
|
|
53
72
|
* @example
|
|
@@ -109,13 +128,16 @@ export interface CreateToolRequest {
|
|
|
109
128
|
agents_to_transfer_to?: string[];
|
|
110
129
|
/** When true, forces the agent to speak before executing the tool. */
|
|
111
130
|
require_speech_before_tool_call?: boolean;
|
|
131
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
132
|
+
forbid_speech_after_tool_call?: boolean;
|
|
112
133
|
}
|
|
113
134
|
export declare namespace CreateToolRequest {
|
|
114
135
|
/**
|
|
115
136
|
* The type of tool.
|
|
116
137
|
*/
|
|
117
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
138
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
118
139
|
const Type: {
|
|
140
|
+
readonly CustomContext: "custom_context";
|
|
119
141
|
readonly CustomWebhook: "custom_webhook";
|
|
120
142
|
readonly CustomWebsocket: "custom_websocket";
|
|
121
143
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export var CreateToolRequest;
|
|
5
5
|
(function (CreateToolRequest) {
|
|
6
6
|
CreateToolRequest.Type = {
|
|
7
|
+
CustomContext: "custom_context",
|
|
7
8
|
CustomWebhook: "custom_webhook",
|
|
8
9
|
CustomWebsocket: "custom_websocket",
|
|
9
10
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
@@ -45,13 +45,16 @@ export interface UpdateToolRequest {
|
|
|
45
45
|
agents_to_transfer_to?: string[];
|
|
46
46
|
/** When true, forces the agent to speak before executing the tool. */
|
|
47
47
|
require_speech_before_tool_call?: boolean;
|
|
48
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
49
|
+
forbid_speech_after_tool_call?: boolean;
|
|
48
50
|
}
|
|
49
51
|
export declare namespace UpdateToolRequest {
|
|
50
52
|
/**
|
|
51
53
|
* The type of tool.
|
|
52
54
|
*/
|
|
53
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
55
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
54
56
|
const Type: {
|
|
57
|
+
readonly CustomContext: "custom_context";
|
|
55
58
|
readonly CustomWebhook: "custom_webhook";
|
|
56
59
|
readonly CustomWebsocket: "custom_websocket";
|
|
57
60
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
export var UpdateToolRequest;
|
|
5
5
|
(function (UpdateToolRequest) {
|
|
6
6
|
UpdateToolRequest.Type = {
|
|
7
|
+
CustomContext: "custom_context",
|
|
7
8
|
CustomWebhook: "custom_webhook",
|
|
8
9
|
CustomWebsocket: "custom_websocket",
|
|
9
10
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
@@ -7,8 +7,10 @@ export interface Agent {
|
|
|
7
7
|
id: string;
|
|
8
8
|
/** The name of the agent. */
|
|
9
9
|
name: string;
|
|
10
|
-
/** The phone number that the agent uses to accept
|
|
10
|
+
/** The phone number that the agent uses to accept calls. `null` if the agent is not associated with a phone number, in which can the agent can be used via WebSockets. This field is deprecated. Use `phone_numbers` instead. */
|
|
11
11
|
phone_number: string | null;
|
|
12
|
+
/** Array of phone numbers that the agent uses to accept phone calls. */
|
|
13
|
+
phone_numbers: string[];
|
|
12
14
|
/** The project the agent belongs to. */
|
|
13
15
|
project: Agent.Project;
|
|
14
16
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
@@ -55,6 +55,8 @@ export interface Conversation {
|
|
|
55
55
|
task_results: Record<string, unknown>;
|
|
56
56
|
/** Array of conversation items (turns). */
|
|
57
57
|
items: Phonic.ConversationItem[];
|
|
58
|
+
/** Phone call metadata. `null` for non-phone call conversations. */
|
|
59
|
+
call_info: Conversation.CallInfo | null;
|
|
58
60
|
}
|
|
59
61
|
export declare namespace Conversation {
|
|
60
62
|
/**
|
|
@@ -97,4 +99,15 @@ export declare namespace Conversation {
|
|
|
97
99
|
readonly Assistant: "assistant";
|
|
98
100
|
readonly Error: "error";
|
|
99
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* Phone call metadata. `null` for non-phone call conversations.
|
|
104
|
+
*/
|
|
105
|
+
interface CallInfo {
|
|
106
|
+
/** Caller phone number in E.164 format. */
|
|
107
|
+
from_phone_number: string;
|
|
108
|
+
/** Callee phone number in E.164 format. */
|
|
109
|
+
to_phone_number: string;
|
|
110
|
+
/** Twilio Call SID. Only present for user SIP trunking calls. */
|
|
111
|
+
twilio_call_sid?: string;
|
|
112
|
+
}
|
|
100
113
|
}
|
|
@@ -5,7 +5,11 @@ import * as Phonic from "../index.mjs";
|
|
|
5
5
|
export interface CreateAgentRequest {
|
|
6
6
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
7
7
|
name: string;
|
|
8
|
-
phone_number:
|
|
8
|
+
phone_number: CreateAgentRequest.PhoneNumber | null;
|
|
9
|
+
/** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
|
|
10
|
+
custom_phone_number?: string | null;
|
|
11
|
+
/** Array of custom phone numbers in E.164 format (e.g., ["+1234567890", "+0987654321"]). The agent will be able to receive phone calls on any of these numbers. Required when `phone_number` is set to `"custom"`. All phone numbers must be unique. */
|
|
12
|
+
custom_phone_numbers?: string[];
|
|
9
13
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
10
14
|
timezone?: string;
|
|
11
15
|
/** The voice ID to use. */
|
|
@@ -42,6 +46,11 @@ export interface CreateAgentRequest {
|
|
|
42
46
|
configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null;
|
|
43
47
|
}
|
|
44
48
|
export declare namespace CreateAgentRequest {
|
|
49
|
+
type PhoneNumber = "assign-automatically" | "custom";
|
|
50
|
+
const PhoneNumber: {
|
|
51
|
+
readonly AssignAutomatically: "assign-automatically";
|
|
52
|
+
readonly Custom: "custom";
|
|
53
|
+
};
|
|
45
54
|
/**
|
|
46
55
|
* The audio format of the agent.
|
|
47
56
|
*/
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export var CreateAgentRequest;
|
|
5
5
|
(function (CreateAgentRequest) {
|
|
6
|
+
CreateAgentRequest.PhoneNumber = {
|
|
7
|
+
AssignAutomatically: "assign-automatically",
|
|
8
|
+
Custom: "custom",
|
|
9
|
+
};
|
|
6
10
|
CreateAgentRequest.AudioFormat = {
|
|
7
11
|
Pcm44100: "pcm_44100",
|
|
8
12
|
Pcm16000: "pcm_16000",
|
|
@@ -34,6 +34,8 @@ export interface Tool {
|
|
|
34
34
|
agents_to_transfer_to?: string[];
|
|
35
35
|
/** When true, forces the agent to speak before executing the tool. */
|
|
36
36
|
require_speech_before_tool_call?: boolean;
|
|
37
|
+
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
38
|
+
forbid_speech_after_tool_call?: boolean;
|
|
37
39
|
}
|
|
38
40
|
export declare namespace Tool {
|
|
39
41
|
interface Project {
|
|
@@ -43,8 +45,9 @@ export declare namespace Tool {
|
|
|
43
45
|
/**
|
|
44
46
|
* The type of tool.
|
|
45
47
|
*/
|
|
46
|
-
type Type = "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
48
|
+
type Type = "custom_context" | "custom_webhook" | "custom_websocket" | "built_in_transfer_to_phone_number" | "built_in_transfer_to_agent";
|
|
47
49
|
const Type: {
|
|
50
|
+
readonly CustomContext: "custom_context";
|
|
48
51
|
readonly CustomWebhook: "custom_webhook";
|
|
49
52
|
readonly CustomWebsocket: "custom_websocket";
|
|
50
53
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.30.
|
|
1
|
+
export declare const SDK_VERSION = "0.30.20";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.30.
|
|
1
|
+
export const SDK_VERSION = "0.30.20";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -595,34 +595,20 @@ Creates a new tool in a project.
|
|
|
595
595
|
```typescript
|
|
596
596
|
await client.tools.create({
|
|
597
597
|
project: "main",
|
|
598
|
-
name: "
|
|
599
|
-
description: "
|
|
600
|
-
type: "
|
|
598
|
+
name: "context_printer",
|
|
599
|
+
description: "Gets the specific context for fixing our printer",
|
|
600
|
+
type: "custom_context",
|
|
601
601
|
execution_mode: "sync",
|
|
602
602
|
parameters: [
|
|
603
603
|
{
|
|
604
604
|
type: "string",
|
|
605
|
-
name: "
|
|
606
|
-
description: "
|
|
605
|
+
name: "name",
|
|
606
|
+
description: "description",
|
|
607
607
|
is_required: true,
|
|
608
|
-
location: "request_body",
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
type: "string",
|
|
612
|
-
name: "time",
|
|
613
|
-
description: "The time for the appointment in HH:MM format",
|
|
614
|
-
is_required: true,
|
|
615
|
-
location: "request_body",
|
|
616
608
|
},
|
|
617
609
|
],
|
|
618
|
-
endpoint_method: "POST",
|
|
619
|
-
endpoint_url: "https://api.example.com/book-appointment",
|
|
620
|
-
endpoint_headers: {
|
|
621
|
-
Authorization: "Bearer token123",
|
|
622
|
-
"Content-Type": "application/json",
|
|
623
|
-
},
|
|
624
|
-
endpoint_timeout_ms: 5000,
|
|
625
610
|
require_speech_before_tool_call: false,
|
|
611
|
+
forbid_speech_after_tool_call: false,
|
|
626
612
|
});
|
|
627
613
|
```
|
|
628
614
|
|