phonic 0.30.8 → 0.30.10
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/README.md +4 -2
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +13 -7
- package/dist/cjs/api/resources/agents/client/Client.js +15 -11
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +8 -6
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +11 -8
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +4 -2
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/conversations/client/Client.js +4 -6
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -1
- package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/extractionSchemas/client/Client.js +3 -5
- package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/projects/client/Client.js +3 -5
- package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +1 -1
- package/dist/cjs/api/resources/tools/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/tools/client/Client.js +3 -5
- package/dist/cjs/api/resources/voices/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/voices/client/Client.js +3 -5
- package/dist/cjs/api/types/Agent.d.ts +8 -7
- package/dist/cjs/api/types/Agent.js +1 -0
- package/dist/cjs/api/types/ConfigPayload.d.ts +6 -4
- package/dist/cjs/api/types/ConfigPayload.js +2 -0
- package/dist/cjs/api/types/Conversation.d.ts +30 -9
- package/dist/cjs/api/types/Conversation.js +11 -0
- package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -1
- package/dist/cjs/api/types/ConversationItem.d.ts +13 -13
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +7 -6
- package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
- package/dist/cjs/api/types/ExtractionField.d.ts +1 -1
- package/dist/cjs/api/types/LanguageCode.d.ts +28 -0
- package/dist/cjs/api/types/LanguageCode.js +27 -0
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +4 -3
- package/dist/cjs/api/types/Project.d.ts +1 -1
- package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +8 -8
- package/dist/cjs/api/types/Voice.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.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/Client.d.mts +13 -7
- package/dist/esm/api/resources/agents/client/Client.mjs +15 -11
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +8 -6
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +11 -8
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +4 -2
- package/dist/esm/api/resources/conversations/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/conversations/client/Client.mjs +4 -6
- package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -1
- package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +3 -5
- package/dist/esm/api/resources/projects/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/projects/client/Client.mjs +3 -5
- package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +1 -1
- package/dist/esm/api/resources/tools/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/tools/client/Client.mjs +3 -5
- package/dist/esm/api/resources/voices/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/voices/client/Client.mjs +3 -5
- package/dist/esm/api/types/Agent.d.mts +8 -7
- package/dist/esm/api/types/Agent.mjs +1 -0
- package/dist/esm/api/types/ConfigPayload.d.mts +6 -4
- package/dist/esm/api/types/ConfigPayload.mjs +2 -0
- package/dist/esm/api/types/Conversation.d.mts +30 -9
- package/dist/esm/api/types/Conversation.mjs +10 -1
- package/dist/esm/api/types/ConversationExtraction.d.mts +1 -1
- package/dist/esm/api/types/ConversationItem.d.mts +13 -13
- package/dist/esm/api/types/CreateAgentRequest.d.mts +7 -6
- package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
- package/dist/esm/api/types/ExtractionField.d.mts +1 -1
- package/dist/esm/api/types/LanguageCode.d.mts +28 -0
- package/dist/esm/api/types/LanguageCode.mjs +24 -0
- package/dist/esm/api/types/OutboundCallConfig.d.mts +4 -3
- package/dist/esm/api/types/Project.d.mts +1 -1
- package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +8 -8
- package/dist/esm/api/types/Voice.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +13 -7
package/README.md
CHANGED
|
@@ -34,7 +34,9 @@ await client.agents.create({
|
|
|
34
34
|
welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
35
35
|
system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
36
36
|
template_variables: {
|
|
37
|
-
customer_name: {
|
|
37
|
+
customer_name: {
|
|
38
|
+
default_value: null,
|
|
39
|
+
},
|
|
38
40
|
subject: {
|
|
39
41
|
default_value: "Chess",
|
|
40
42
|
},
|
|
@@ -42,7 +44,7 @@ await client.agents.create({
|
|
|
42
44
|
tools: ["keypad_input"],
|
|
43
45
|
no_input_poke_sec: 30,
|
|
44
46
|
no_input_poke_text: "Are you still there?",
|
|
45
|
-
|
|
47
|
+
languages: ["en", "es"],
|
|
46
48
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
47
49
|
configuration_endpoint: {
|
|
48
50
|
url: "https://api.example.com/config",
|
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.10",
|
|
54
|
+
"User-Agent": "phonic/0.30.10",
|
|
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) });
|
|
@@ -67,7 +67,9 @@ export declare class Agents {
|
|
|
67
67
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
68
68
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
69
69
|
* template_variables: {
|
|
70
|
-
* "customer_name": {
|
|
70
|
+
* "customer_name": {
|
|
71
|
+
* default_value: null
|
|
72
|
+
* },
|
|
71
73
|
* "subject": {
|
|
72
74
|
* default_value: "Chess"
|
|
73
75
|
* }
|
|
@@ -75,7 +77,7 @@ export declare class Agents {
|
|
|
75
77
|
* tools: ["keypad_input"],
|
|
76
78
|
* no_input_poke_sec: 30,
|
|
77
79
|
* no_input_poke_text: "Are you still there?",
|
|
78
|
-
*
|
|
80
|
+
* languages: ["en", "es"],
|
|
79
81
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
80
82
|
* configuration_endpoint: {
|
|
81
83
|
* url: "https://api.example.com/config",
|
|
@@ -109,7 +111,9 @@ export declare class Agents {
|
|
|
109
111
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
110
112
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
111
113
|
* template_variables: {
|
|
112
|
-
* "customer_name": {
|
|
114
|
+
* "customer_name": {
|
|
115
|
+
* default_value: null
|
|
116
|
+
* },
|
|
113
117
|
* "subject": {
|
|
114
118
|
* default_value: "Chess"
|
|
115
119
|
* }
|
|
@@ -117,7 +121,7 @@ export declare class Agents {
|
|
|
117
121
|
* tools: ["keypad_input"],
|
|
118
122
|
* no_input_poke_sec: 30,
|
|
119
123
|
* no_input_poke_text: "Are you still there?",
|
|
120
|
-
*
|
|
124
|
+
* languages: ["en", "es"],
|
|
121
125
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
122
126
|
* configuration_endpoint: {
|
|
123
127
|
* url: "https://api.example.com/config",
|
|
@@ -187,7 +191,9 @@ export declare class Agents {
|
|
|
187
191
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
188
192
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
189
193
|
* template_variables: {
|
|
190
|
-
* "customer_name": {
|
|
194
|
+
* "customer_name": {
|
|
195
|
+
* default_value: null
|
|
196
|
+
* },
|
|
191
197
|
* "subject": {
|
|
192
198
|
* default_value: "Chess"
|
|
193
199
|
* }
|
|
@@ -195,7 +201,7 @@ export declare class Agents {
|
|
|
195
201
|
* tools: ["keypad_input"],
|
|
196
202
|
* no_input_poke_sec: 30,
|
|
197
203
|
* no_input_poke_text: "Are you still there?",
|
|
198
|
-
*
|
|
204
|
+
* languages: ["en", "es"],
|
|
199
205
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
200
206
|
* configuration_endpoint: {
|
|
201
207
|
* url: "https://api.example.com/config",
|
|
@@ -208,5 +214,5 @@ export declare class Agents {
|
|
|
208
214
|
*/
|
|
209
215
|
update(nameOrId: string, request?: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
|
|
210
216
|
private __update;
|
|
211
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
217
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
212
218
|
}
|
|
@@ -157,7 +157,9 @@ class Agents {
|
|
|
157
157
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
158
158
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
159
159
|
* template_variables: {
|
|
160
|
-
* "customer_name": {
|
|
160
|
+
* "customer_name": {
|
|
161
|
+
* default_value: null
|
|
162
|
+
* },
|
|
161
163
|
* "subject": {
|
|
162
164
|
* default_value: "Chess"
|
|
163
165
|
* }
|
|
@@ -165,7 +167,7 @@ class Agents {
|
|
|
165
167
|
* tools: ["keypad_input"],
|
|
166
168
|
* no_input_poke_sec: 30,
|
|
167
169
|
* no_input_poke_text: "Are you still there?",
|
|
168
|
-
*
|
|
170
|
+
* languages: ["en", "es"],
|
|
169
171
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
170
172
|
* configuration_endpoint: {
|
|
171
173
|
* url: "https://api.example.com/config",
|
|
@@ -260,7 +262,9 @@ class Agents {
|
|
|
260
262
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
261
263
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
262
264
|
* template_variables: {
|
|
263
|
-
* "customer_name": {
|
|
265
|
+
* "customer_name": {
|
|
266
|
+
* default_value: null
|
|
267
|
+
* },
|
|
264
268
|
* "subject": {
|
|
265
269
|
* default_value: "Chess"
|
|
266
270
|
* }
|
|
@@ -268,7 +272,7 @@ class Agents {
|
|
|
268
272
|
* tools: ["keypad_input"],
|
|
269
273
|
* no_input_poke_sec: 30,
|
|
270
274
|
* no_input_poke_text: "Are you still there?",
|
|
271
|
-
*
|
|
275
|
+
* languages: ["en", "es"],
|
|
272
276
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
273
277
|
* configuration_endpoint: {
|
|
274
278
|
* url: "https://api.example.com/config",
|
|
@@ -503,7 +507,9 @@ class Agents {
|
|
|
503
507
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
504
508
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
505
509
|
* template_variables: {
|
|
506
|
-
* "customer_name": {
|
|
510
|
+
* "customer_name": {
|
|
511
|
+
* default_value: null
|
|
512
|
+
* },
|
|
507
513
|
* "subject": {
|
|
508
514
|
* default_value: "Chess"
|
|
509
515
|
* }
|
|
@@ -511,7 +517,7 @@ class Agents {
|
|
|
511
517
|
* tools: ["keypad_input"],
|
|
512
518
|
* no_input_poke_sec: 30,
|
|
513
519
|
* no_input_poke_text: "Are you still there?",
|
|
514
|
-
*
|
|
520
|
+
* languages: ["en", "es"],
|
|
515
521
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
516
522
|
* configuration_endpoint: {
|
|
517
523
|
* url: "https://api.example.com/config",
|
|
@@ -587,12 +593,10 @@ class Agents {
|
|
|
587
593
|
return __awaiter(this, void 0, void 0, function* () {
|
|
588
594
|
var _a;
|
|
589
595
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
590
|
-
if (bearer
|
|
591
|
-
|
|
592
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
593
|
-
});
|
|
596
|
+
if (bearer != null) {
|
|
597
|
+
return `Bearer ${bearer}`;
|
|
594
598
|
}
|
|
595
|
-
return
|
|
599
|
+
return undefined;
|
|
596
600
|
});
|
|
597
601
|
}
|
|
598
602
|
}
|
|
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
|
|
|
15
15
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
16
16
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
17
17
|
* template_variables: {
|
|
18
|
-
* "customer_name": {
|
|
18
|
+
* "customer_name": {
|
|
19
|
+
* default_value: null
|
|
20
|
+
* },
|
|
19
21
|
* "subject": {
|
|
20
22
|
* default_value: "Chess"
|
|
21
23
|
* }
|
|
@@ -23,7 +25,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
25
|
* tools: ["keypad_input"],
|
|
24
26
|
* no_input_poke_sec: 30,
|
|
25
27
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
-
*
|
|
28
|
+
* languages: ["en", "es"],
|
|
27
29
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
28
30
|
* configuration_endpoint: {
|
|
29
31
|
* url: "https://api.example.com/config",
|
|
@@ -39,7 +41,7 @@ export interface AgentsCreateRequest {
|
|
|
39
41
|
project?: string;
|
|
40
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
41
43
|
name: string;
|
|
42
|
-
phone_number?: "assign-automatically";
|
|
44
|
+
phone_number?: "assign-automatically" | null;
|
|
43
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
44
46
|
timezone?: string;
|
|
45
47
|
/** The voice ID to use. */
|
|
@@ -61,15 +63,15 @@ export interface AgentsCreateRequest {
|
|
|
61
63
|
/** Array of task objects with `name` and `description` fields. */
|
|
62
64
|
tasks?: Phonic.Task[];
|
|
63
65
|
/** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
|
|
64
|
-
no_input_poke_sec?: number;
|
|
66
|
+
no_input_poke_sec?: number | null;
|
|
65
67
|
/** The message to send after the specified silence. */
|
|
66
68
|
no_input_poke_text?: string;
|
|
67
69
|
/** Seconds of silence before ending the conversation. */
|
|
68
70
|
no_input_end_conversation_sec?: number;
|
|
69
71
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
-
|
|
72
|
+
languages?: Phonic.LanguageCode[];
|
|
71
73
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
72
74
|
boosted_keywords?: string[];
|
|
73
75
|
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
|
|
74
|
-
configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint;
|
|
76
|
+
configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint | null;
|
|
75
77
|
}
|
|
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
|
|
|
15
15
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
16
16
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
17
17
|
* template_variables: {
|
|
18
|
-
* "customer_name": {
|
|
18
|
+
* "customer_name": {
|
|
19
|
+
* default_value: null
|
|
20
|
+
* },
|
|
19
21
|
* "subject": {
|
|
20
22
|
* default_value: "Chess"
|
|
21
23
|
* }
|
|
@@ -23,7 +25,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
25
|
* tools: ["keypad_input"],
|
|
24
26
|
* no_input_poke_sec: 30,
|
|
25
27
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
-
*
|
|
28
|
+
* languages: ["en", "es"],
|
|
27
29
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
28
30
|
* configuration_endpoint: {
|
|
29
31
|
* url: "https://api.example.com/config",
|
|
@@ -39,7 +41,7 @@ export interface UpdateAgentRequest {
|
|
|
39
41
|
project?: string;
|
|
40
42
|
/** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
|
|
41
43
|
name?: string;
|
|
42
|
-
phone_number?: "assign-automatically";
|
|
44
|
+
phone_number?: "assign-automatically" | null;
|
|
43
45
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
44
46
|
timezone?: string;
|
|
45
47
|
/** The voice ID to use. */
|
|
@@ -61,31 +63,32 @@ export interface UpdateAgentRequest {
|
|
|
61
63
|
/** Array of task objects with `name` and `description` fields. */
|
|
62
64
|
tasks?: Phonic.Task[];
|
|
63
65
|
/** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
|
|
64
|
-
no_input_poke_sec?: number;
|
|
66
|
+
no_input_poke_sec?: number | null;
|
|
65
67
|
/** The message to send after the specified silence. */
|
|
66
68
|
no_input_poke_text?: string;
|
|
67
69
|
/** Seconds of silence before ending the conversation. */
|
|
68
70
|
no_input_end_conversation_sec?: number;
|
|
69
71
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
-
|
|
72
|
+
languages?: Phonic.LanguageCode[];
|
|
71
73
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
72
74
|
boosted_keywords?: string[];
|
|
73
75
|
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
|
|
74
|
-
configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint;
|
|
76
|
+
configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint | null;
|
|
75
77
|
}
|
|
76
78
|
export declare namespace UpdateAgentRequest {
|
|
77
79
|
/**
|
|
78
80
|
* The audio format of the agent.
|
|
79
81
|
*/
|
|
80
|
-
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
82
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
|
|
81
83
|
const AudioFormat: {
|
|
82
84
|
readonly Pcm44100: "pcm_44100";
|
|
83
85
|
readonly Pcm16000: "pcm_16000";
|
|
86
|
+
readonly Pcm8000: "pcm_8000";
|
|
84
87
|
readonly Mulaw8000: "mulaw_8000";
|
|
85
88
|
};
|
|
86
89
|
namespace TemplateVariables {
|
|
87
90
|
interface Value {
|
|
88
|
-
default_value
|
|
91
|
+
default_value: string | null;
|
|
89
92
|
is_boosted_keyword?: boolean;
|
|
90
93
|
}
|
|
91
94
|
}
|
|
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
|
|
|
15
15
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
16
16
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
17
17
|
* template_variables: {
|
|
18
|
-
* "customer_name": {
|
|
18
|
+
* "customer_name": {
|
|
19
|
+
* default_value: null
|
|
20
|
+
* },
|
|
19
21
|
* "subject": {
|
|
20
22
|
* default_value: "Chess"
|
|
21
23
|
* }
|
|
@@ -23,7 +25,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
25
|
* tools: ["keypad_input"],
|
|
24
26
|
* no_input_poke_sec: 30,
|
|
25
27
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
-
*
|
|
28
|
+
* languages: ["en", "es"],
|
|
27
29
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
28
30
|
* configuration_endpoint: {
|
|
29
31
|
* url: "https://api.example.com/config",
|
|
@@ -205,7 +205,7 @@ export declare class Conversations {
|
|
|
205
205
|
* no_input_poke_sec: 30,
|
|
206
206
|
* no_input_poke_text: "Are you still there?",
|
|
207
207
|
* no_input_end_conversation_sec: 180,
|
|
208
|
-
*
|
|
208
|
+
* languages: ["en", "es"],
|
|
209
209
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
210
210
|
* tools: ["keypad_input"]
|
|
211
211
|
* }
|
|
@@ -233,5 +233,5 @@ export declare class Conversations {
|
|
|
233
233
|
sipOutboundCall(request: Phonic.ConversationsSipOutboundCallRequest, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsSipOutboundCallResponse>;
|
|
234
234
|
private __sipOutboundCall;
|
|
235
235
|
connect(args?: Conversations.ConnectArgs): Promise<ConversationsSocket>;
|
|
236
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
236
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
237
237
|
}
|
|
@@ -713,7 +713,7 @@ class Conversations {
|
|
|
713
713
|
* no_input_poke_sec: 30,
|
|
714
714
|
* no_input_poke_text: "Are you still there?",
|
|
715
715
|
* no_input_end_conversation_sec: 180,
|
|
716
|
-
*
|
|
716
|
+
* languages: ["en", "es"],
|
|
717
717
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
718
718
|
* tools: ["keypad_input"]
|
|
719
719
|
* }
|
|
@@ -893,12 +893,10 @@ class Conversations {
|
|
|
893
893
|
return __awaiter(this, void 0, void 0, function* () {
|
|
894
894
|
var _a;
|
|
895
895
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
896
|
-
if (bearer
|
|
897
|
-
|
|
898
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
899
|
-
});
|
|
896
|
+
if (bearer != null) {
|
|
897
|
+
return `Bearer ${bearer}`;
|
|
900
898
|
}
|
|
901
|
-
return
|
|
899
|
+
return undefined;
|
|
902
900
|
});
|
|
903
901
|
}
|
|
904
902
|
}
|
|
@@ -18,7 +18,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
18
18
|
* no_input_poke_sec: 30,
|
|
19
19
|
* no_input_poke_text: "Are you still there?",
|
|
20
20
|
* no_input_end_conversation_sec: 180,
|
|
21
|
-
*
|
|
21
|
+
* languages: ["en", "es"],
|
|
22
22
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
23
23
|
* tools: ["keypad_input"]
|
|
24
24
|
* }
|
|
@@ -138,5 +138,5 @@ export declare class ExtractionSchemas {
|
|
|
138
138
|
*/
|
|
139
139
|
update(nameOrId: string, request?: Phonic.UpdateExtractionSchemaRequest, requestOptions?: ExtractionSchemas.RequestOptions): core.HttpResponsePromise<Phonic.ExtractionSchemasUpdateResponse>;
|
|
140
140
|
private __update;
|
|
141
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
141
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
142
142
|
}
|
|
@@ -461,12 +461,10 @@ class ExtractionSchemas {
|
|
|
461
461
|
return __awaiter(this, void 0, void 0, function* () {
|
|
462
462
|
var _a;
|
|
463
463
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
464
|
-
if (bearer
|
|
465
|
-
|
|
466
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
467
|
-
});
|
|
464
|
+
if (bearer != null) {
|
|
465
|
+
return `Bearer ${bearer}`;
|
|
468
466
|
}
|
|
469
|
-
return
|
|
467
|
+
return undefined;
|
|
470
468
|
});
|
|
471
469
|
}
|
|
472
470
|
}
|
|
@@ -153,5 +153,5 @@ export declare class Projects {
|
|
|
153
153
|
*/
|
|
154
154
|
createEvalPrompt(id: string, request: Phonic.CreateConversationEvalPromptRequest, requestOptions?: Projects.RequestOptions): core.HttpResponsePromise<Phonic.ProjectsCreateEvalPromptResponse>;
|
|
155
155
|
private __createEvalPrompt;
|
|
156
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
156
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
157
157
|
}
|
|
@@ -572,12 +572,10 @@ class Projects {
|
|
|
572
572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
573
573
|
var _a;
|
|
574
574
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
575
|
-
if (bearer
|
|
576
|
-
|
|
577
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
578
|
-
});
|
|
575
|
+
if (bearer != null) {
|
|
576
|
+
return `Bearer ${bearer}`;
|
|
579
577
|
}
|
|
580
|
-
return
|
|
578
|
+
return undefined;
|
|
581
579
|
});
|
|
582
580
|
}
|
|
583
581
|
}
|
|
@@ -166,5 +166,5 @@ export declare class Tools {
|
|
|
166
166
|
*/
|
|
167
167
|
update(nameOrId: string, request?: Phonic.UpdateToolRequest, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<Phonic.ToolsUpdateResponse>;
|
|
168
168
|
private __update;
|
|
169
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
169
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
170
170
|
}
|
|
@@ -482,12 +482,10 @@ class Tools {
|
|
|
482
482
|
return __awaiter(this, void 0, void 0, function* () {
|
|
483
483
|
var _a;
|
|
484
484
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
485
|
-
if (bearer
|
|
486
|
-
|
|
487
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
488
|
-
});
|
|
485
|
+
if (bearer != null) {
|
|
486
|
+
return `Bearer ${bearer}`;
|
|
489
487
|
}
|
|
490
|
-
return
|
|
488
|
+
return undefined;
|
|
491
489
|
});
|
|
492
490
|
}
|
|
493
491
|
}
|
|
@@ -61,5 +61,5 @@ export declare class Voices {
|
|
|
61
61
|
*/
|
|
62
62
|
get(id: string, requestOptions?: Voices.RequestOptions): core.HttpResponsePromise<Phonic.VoicesGetResponse>;
|
|
63
63
|
private __get;
|
|
64
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
64
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
65
65
|
}
|
|
@@ -193,12 +193,10 @@ class Voices {
|
|
|
193
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
194
|
var _a;
|
|
195
195
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
|
|
196
|
-
if (bearer
|
|
197
|
-
|
|
198
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
199
|
-
});
|
|
196
|
+
if (bearer != null) {
|
|
197
|
+
return `Bearer ${bearer}`;
|
|
200
198
|
}
|
|
201
|
-
return
|
|
199
|
+
return undefined;
|
|
202
200
|
});
|
|
203
201
|
}
|
|
204
202
|
}
|
|
@@ -8,7 +8,7 @@ export interface Agent {
|
|
|
8
8
|
/** The name of the agent. */
|
|
9
9
|
name: string;
|
|
10
10
|
/** The phone number that the agent uses to accept and initiate phone calls. `null` if the agent is not associated with a phone number, in which can the agent can be used via WebSockets. */
|
|
11
|
-
phone_number
|
|
11
|
+
phone_number: string | null;
|
|
12
12
|
/** The project the agent belongs to. */
|
|
13
13
|
project: Agent.Project;
|
|
14
14
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
@@ -22,7 +22,7 @@ export interface Agent {
|
|
|
22
22
|
/** The background noise level of the agent. Must be between 0 and 1. */
|
|
23
23
|
background_noise_level: number;
|
|
24
24
|
/** Message to play when the conversation starts. */
|
|
25
|
-
welcome_message
|
|
25
|
+
welcome_message: string | null;
|
|
26
26
|
/** Instructions for the conversation. */
|
|
27
27
|
system_prompt: string;
|
|
28
28
|
/** Template variables that the agent can use in the welcome message and the system prompt. */
|
|
@@ -32,17 +32,17 @@ export interface Agent {
|
|
|
32
32
|
/** Tasks for the agent to complete during the conversation. */
|
|
33
33
|
tasks: Phonic.Task[];
|
|
34
34
|
/** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
|
|
35
|
-
no_input_poke_sec
|
|
35
|
+
no_input_poke_sec: number | null;
|
|
36
36
|
/** The message to send after the specified silence. */
|
|
37
37
|
no_input_poke_text: string;
|
|
38
38
|
/** Seconds of silence before ending the conversation. */
|
|
39
39
|
no_input_end_conversation_sec: number;
|
|
40
40
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
41
|
-
|
|
41
|
+
languages: Phonic.LanguageCode[];
|
|
42
42
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
43
43
|
boosted_keywords: string[];
|
|
44
44
|
/** When not `null`, the agent will call this endpoint to get configuration options. */
|
|
45
|
-
configuration_endpoint
|
|
45
|
+
configuration_endpoint: Agent.ConfigurationEndpoint | null;
|
|
46
46
|
}
|
|
47
47
|
export declare namespace Agent {
|
|
48
48
|
/**
|
|
@@ -55,15 +55,16 @@ export declare namespace Agent {
|
|
|
55
55
|
/**
|
|
56
56
|
* The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`.
|
|
57
57
|
*/
|
|
58
|
-
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
58
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
|
|
59
59
|
const AudioFormat: {
|
|
60
60
|
readonly Pcm44100: "pcm_44100";
|
|
61
61
|
readonly Pcm16000: "pcm_16000";
|
|
62
|
+
readonly Pcm8000: "pcm_8000";
|
|
62
63
|
readonly Mulaw8000: "mulaw_8000";
|
|
63
64
|
};
|
|
64
65
|
namespace TemplateVariables {
|
|
65
66
|
interface Value {
|
|
66
|
-
default_value
|
|
67
|
+
default_value: string | null;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
70
|
type Tools = Tools.Item[];
|
|
@@ -16,7 +16,7 @@ export interface ConfigPayload {
|
|
|
16
16
|
/** Background noise level for the conversation */
|
|
17
17
|
background_noise_level?: number;
|
|
18
18
|
/** Message to play when conversation starts */
|
|
19
|
-
welcome_message?: string;
|
|
19
|
+
welcome_message?: string | null;
|
|
20
20
|
/** Voice ID to use for speech synthesis */
|
|
21
21
|
voice_id?: string;
|
|
22
22
|
/** Audio input format */
|
|
@@ -36,7 +36,7 @@ export interface ConfigPayload {
|
|
|
36
36
|
/** Enable transcript RAG */
|
|
37
37
|
enable_transcripts_rag?: boolean;
|
|
38
38
|
/** Seconds of silence before poke message */
|
|
39
|
-
no_input_poke_sec?: number;
|
|
39
|
+
no_input_poke_sec?: number | null;
|
|
40
40
|
/** Poke message text */
|
|
41
41
|
no_input_poke_text?: string;
|
|
42
42
|
/** Seconds of silence before ending conversation */
|
|
@@ -54,19 +54,21 @@ export declare namespace ConfigPayload {
|
|
|
54
54
|
/**
|
|
55
55
|
* Audio input format
|
|
56
56
|
*/
|
|
57
|
-
type InputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
57
|
+
type InputFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
|
|
58
58
|
const InputFormat: {
|
|
59
59
|
readonly Pcm44100: "pcm_44100";
|
|
60
60
|
readonly Pcm16000: "pcm_16000";
|
|
61
|
+
readonly Pcm8000: "pcm_8000";
|
|
61
62
|
readonly Mulaw8000: "mulaw_8000";
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
65
|
* Audio output format
|
|
65
66
|
*/
|
|
66
|
-
type OutputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
67
|
+
type OutputFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
|
|
67
68
|
const OutputFormat: {
|
|
68
69
|
readonly Pcm44100: "pcm_44100";
|
|
69
70
|
readonly Pcm16000: "pcm_16000";
|
|
71
|
+
readonly Pcm8000: "pcm_8000";
|
|
70
72
|
readonly Mulaw8000: "mulaw_8000";
|
|
71
73
|
};
|
|
72
74
|
}
|
|
@@ -9,11 +9,13 @@ var ConfigPayload;
|
|
|
9
9
|
ConfigPayload.InputFormat = {
|
|
10
10
|
Pcm44100: "pcm_44100",
|
|
11
11
|
Pcm16000: "pcm_16000",
|
|
12
|
+
Pcm8000: "pcm_8000",
|
|
12
13
|
Mulaw8000: "mulaw_8000",
|
|
13
14
|
};
|
|
14
15
|
ConfigPayload.OutputFormat = {
|
|
15
16
|
Pcm44100: "pcm_44100",
|
|
16
17
|
Pcm16000: "pcm_16000",
|
|
18
|
+
Pcm8000: "pcm_8000",
|
|
17
19
|
Mulaw8000: "mulaw_8000",
|
|
18
20
|
};
|
|
19
21
|
})(ConfigPayload || (exports.ConfigPayload = ConfigPayload = {}));
|