phonic 0.30.8 → 0.30.9
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 +3 -1
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +10 -4
- package/dist/cjs/api/resources/agents/client/Client.js +12 -8
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -4
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -6
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +3 -1
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/Client.js +3 -5
- 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 +7 -6
- 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 +18 -7
- 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 +6 -5
- package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
- package/dist/cjs/api/types/ExtractionField.d.ts +1 -1
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -2
- 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/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 +10 -4
- package/dist/esm/api/resources/agents/client/Client.mjs +12 -8
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -4
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -6
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +3 -1
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/Client.mjs +3 -5
- 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 +7 -6
- 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 +18 -7
- 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 +6 -5
- package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
- package/dist/esm/api/types/ExtractionField.d.mts +1 -1
- package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -2
- 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/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +2 -2
- package/reference.md +9 -3
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
|
},
|
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.9",
|
|
54
|
+
"User-Agent": "phonic/0.30.9",
|
|
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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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
|
* }
|
|
@@ -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,7 +63,7 @@ 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. */
|
|
@@ -71,5 +73,5 @@ export interface AgentsCreateRequest {
|
|
|
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
|
* }
|
|
@@ -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,7 +63,7 @@ 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. */
|
|
@@ -71,21 +73,22 @@ export interface UpdateAgentRequest {
|
|
|
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
|
* }
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -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,7 +32,7 @@ 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. */
|
|
@@ -42,7 +42,7 @@ export interface Agent {
|
|
|
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 = {}));
|
|
@@ -6,17 +6,17 @@ export interface Conversation {
|
|
|
6
6
|
/** The conversation ID. */
|
|
7
7
|
id: string;
|
|
8
8
|
/** The agent associated with the conversation. */
|
|
9
|
-
agent
|
|
9
|
+
agent: Conversation.Agent | null;
|
|
10
10
|
/** The organization/workspace name. */
|
|
11
11
|
workspace: string;
|
|
12
12
|
/** The project associated with the conversation. */
|
|
13
13
|
project: Conversation.Project;
|
|
14
14
|
/** External ID for conversation tracking. */
|
|
15
|
-
external_id
|
|
15
|
+
external_id: string | null;
|
|
16
16
|
/** The STS model used. */
|
|
17
17
|
model: string;
|
|
18
18
|
/** Welcome message played at start. */
|
|
19
|
-
welcome_message
|
|
19
|
+
welcome_message: string | null;
|
|
20
20
|
/** Template variables used in the conversation. */
|
|
21
21
|
template_variables: Record<string, string>;
|
|
22
22
|
/** Audio input format. */
|
|
@@ -28,17 +28,17 @@ export interface Conversation {
|
|
|
28
28
|
/** Live transcript of the conversation. */
|
|
29
29
|
live_transcript: string;
|
|
30
30
|
/** Post-call processed transcript. */
|
|
31
|
-
post_call_transcript
|
|
31
|
+
post_call_transcript: string | null;
|
|
32
32
|
/** Duration of the conversation in milliseconds. */
|
|
33
33
|
duration_ms: number;
|
|
34
34
|
/** Presigned URL to the conversation audio file. */
|
|
35
|
-
audio_url
|
|
35
|
+
audio_url: string | null;
|
|
36
36
|
/** When the conversation started. */
|
|
37
37
|
started_at: string;
|
|
38
38
|
/** When the conversation ended. */
|
|
39
|
-
ended_at
|
|
39
|
+
ended_at: string | null;
|
|
40
40
|
/** Who or what ended the conversation. */
|
|
41
|
-
ended_by
|
|
41
|
+
ended_by: Conversation.EndedBy | null;
|
|
42
42
|
/** Array of conversation items (turns). */
|
|
43
43
|
items: Phonic.ConversationItem[];
|
|
44
44
|
/** Results from conversation evaluations and extractions. */
|
|
@@ -65,4 +65,15 @@ export declare namespace Conversation {
|
|
|
65
65
|
/** The name of the project. */
|
|
66
66
|
name: string;
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Who or what ended the conversation.
|
|
70
|
+
*/
|
|
71
|
+
type EndedBy = "user" | "user_canceled" | "user_validation_failed" | "assistant" | "error";
|
|
72
|
+
const EndedBy: {
|
|
73
|
+
readonly User: "user";
|
|
74
|
+
readonly UserCanceled: "user_canceled";
|
|
75
|
+
readonly UserValidationFailed: "user_validation_failed";
|
|
76
|
+
readonly Assistant: "assistant";
|
|
77
|
+
readonly Error: "error";
|
|
78
|
+
};
|
|
68
79
|
}
|
|
@@ -3,3 +3,14 @@
|
|
|
3
3
|
* This file was auto-generated by Fern from our API Definition.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Conversation = void 0;
|
|
7
|
+
var Conversation;
|
|
8
|
+
(function (Conversation) {
|
|
9
|
+
Conversation.EndedBy = {
|
|
10
|
+
User: "user",
|
|
11
|
+
UserCanceled: "user_canceled",
|
|
12
|
+
UserValidationFailed: "user_validation_failed",
|
|
13
|
+
Assistant: "assistant",
|
|
14
|
+
Error: "error",
|
|
15
|
+
};
|
|
16
|
+
})(Conversation || (exports.Conversation = Conversation = {}));
|
|
@@ -10,7 +10,7 @@ export interface ConversationExtraction {
|
|
|
10
10
|
/** The extracted data. */
|
|
11
11
|
result: Record<string, unknown>;
|
|
12
12
|
/** Error message if extraction failed. */
|
|
13
|
-
error
|
|
13
|
+
error: string | null;
|
|
14
14
|
/** When the extraction was created. */
|
|
15
15
|
created_at: string;
|
|
16
16
|
}
|
|
@@ -9,7 +9,7 @@ export interface ConversationItem {
|
|
|
9
9
|
/** Live transcript of this turn. */
|
|
10
10
|
live_transcript: string;
|
|
11
11
|
/** Post-call processed transcript. */
|
|
12
|
-
post_call_transcript
|
|
12
|
+
post_call_transcript: string | null;
|
|
13
13
|
/** Duration of this turn in milliseconds. */
|
|
14
14
|
duration_ms: number;
|
|
15
15
|
/** When this turn started. */
|
|
@@ -39,29 +39,29 @@ export declare namespace ConversationItem {
|
|
|
39
39
|
id: string;
|
|
40
40
|
tool: Item.Tool;
|
|
41
41
|
/** HTTP method for webhook tool calls. */
|
|
42
|
-
endpoint_method?: string;
|
|
42
|
+
endpoint_method?: string | null;
|
|
43
43
|
/** URL for webhook tool calls. */
|
|
44
|
-
endpoint_url?: string;
|
|
44
|
+
endpoint_url?: string | null;
|
|
45
45
|
/** Headers for webhook tool calls. */
|
|
46
|
-
endpoint_headers?: Record<string, string |
|
|
46
|
+
endpoint_headers?: Record<string, string | null> | null;
|
|
47
47
|
/** Timeout in milliseconds for webhook tool calls. */
|
|
48
|
-
endpoint_timeout_ms?: number;
|
|
48
|
+
endpoint_timeout_ms?: number | null;
|
|
49
49
|
/** When the webhook endpoint was called (null on error). */
|
|
50
|
-
endpoint_called_at?: string;
|
|
50
|
+
endpoint_called_at?: string | null;
|
|
51
51
|
/** Query parameters for webhook tool calls (null on error or when no params). */
|
|
52
|
-
query_params?: Record<string, unknown
|
|
52
|
+
query_params?: Record<string, unknown> | null;
|
|
53
53
|
/** HTTP response status code for webhook tool calls (null on error). */
|
|
54
|
-
response_status_code?: number;
|
|
54
|
+
response_status_code?: number | null;
|
|
55
55
|
/** Timeout in milliseconds for websocket tool calls. */
|
|
56
|
-
tool_call_output_timeout_ms?: number;
|
|
56
|
+
tool_call_output_timeout_ms?: number | null;
|
|
57
57
|
/** The request body sent to the tool. */
|
|
58
|
-
request_body
|
|
58
|
+
request_body: Record<string, unknown> | null;
|
|
59
59
|
/** The response body received from the tool. */
|
|
60
|
-
response_body
|
|
60
|
+
response_body: Record<string, unknown> | null;
|
|
61
61
|
/** Whether the tool call timed out. */
|
|
62
|
-
timed_out
|
|
62
|
+
timed_out: boolean | null;
|
|
63
63
|
/** Error message if the tool call failed. */
|
|
64
|
-
error_message
|
|
64
|
+
error_message: string | null;
|
|
65
65
|
}
|
|
66
66
|
namespace Item {
|
|
67
67
|
interface Tool {
|