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
|
@@ -5,7 +5,7 @@ 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?: "assign-automatically";
|
|
8
|
+
phone_number?: "assign-automatically" | null;
|
|
9
9
|
/** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
|
|
10
10
|
timezone?: string;
|
|
11
11
|
/** The voice ID to use. */
|
|
@@ -27,7 +27,7 @@ export interface CreateAgentRequest {
|
|
|
27
27
|
/** Array of task objects with `name` and `description` fields. */
|
|
28
28
|
tasks?: Phonic.Task[];
|
|
29
29
|
/** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
|
|
30
|
-
no_input_poke_sec?: number;
|
|
30
|
+
no_input_poke_sec?: number | null;
|
|
31
31
|
/** The message to send after the specified silence. */
|
|
32
32
|
no_input_poke_text?: string;
|
|
33
33
|
/** Seconds of silence before ending the conversation. */
|
|
@@ -37,21 +37,22 @@ export interface CreateAgentRequest {
|
|
|
37
37
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
38
38
|
boosted_keywords?: string[];
|
|
39
39
|
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
|
|
40
|
-
configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint;
|
|
40
|
+
configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null;
|
|
41
41
|
}
|
|
42
42
|
export declare namespace CreateAgentRequest {
|
|
43
43
|
/**
|
|
44
44
|
* The audio format of the agent.
|
|
45
45
|
*/
|
|
46
|
-
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
46
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
|
|
47
47
|
const AudioFormat: {
|
|
48
48
|
readonly Pcm44100: "pcm_44100";
|
|
49
49
|
readonly Pcm16000: "pcm_16000";
|
|
50
|
+
readonly Pcm8000: "pcm_8000";
|
|
50
51
|
readonly Mulaw8000: "mulaw_8000";
|
|
51
52
|
};
|
|
52
53
|
namespace TemplateVariables {
|
|
53
54
|
interface Value {
|
|
54
|
-
default_value
|
|
55
|
+
default_value: string | null;
|
|
55
56
|
is_boosted_keyword?: boolean;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -10,7 +10,7 @@ export interface OutboundCallConfig {
|
|
|
10
10
|
/** The name of the project to use for the call. */
|
|
11
11
|
project?: string;
|
|
12
12
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
|
|
13
|
-
welcome_message?: string;
|
|
13
|
+
welcome_message?: string | null;
|
|
14
14
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
15
15
|
system_prompt?: string;
|
|
16
16
|
/** Variables that can be used in the welcome message and the system prompt. */
|
|
@@ -18,7 +18,7 @@ export interface OutboundCallConfig {
|
|
|
18
18
|
/** The voice ID to use for the agent. */
|
|
19
19
|
voice_id?: string;
|
|
20
20
|
/** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
|
|
21
|
-
no_input_poke_sec?: number;
|
|
21
|
+
no_input_poke_sec?: number | null;
|
|
22
22
|
/** The message to send after the specified silence. */
|
|
23
23
|
no_input_poke_text?: string;
|
|
24
24
|
/** Seconds of silence before ending the conversation. */
|
|
@@ -7,23 +7,23 @@ export interface ToolCallOutputProcessedPayload {
|
|
|
7
7
|
tool_call_id: string;
|
|
8
8
|
tool: ToolCallOutputProcessedPayload.Tool;
|
|
9
9
|
/** Webhook endpoint URL (null for WebSocket tools) */
|
|
10
|
-
endpoint_url?: string;
|
|
10
|
+
endpoint_url?: string | null;
|
|
11
11
|
/** Webhook timeout in milliseconds (null for WebSocket tools) */
|
|
12
|
-
endpoint_timeout_ms?: number;
|
|
12
|
+
endpoint_timeout_ms?: number | null;
|
|
13
13
|
/** When webhook was called (null for WebSocket tools) */
|
|
14
|
-
endpoint_called_at?: string;
|
|
14
|
+
endpoint_called_at?: string | null;
|
|
15
15
|
/** Webhook request body (null for WebSocket tools) */
|
|
16
|
-
request_body?: Record<string, unknown
|
|
16
|
+
request_body?: Record<string, unknown> | null;
|
|
17
17
|
response_body?: unknown;
|
|
18
18
|
/** WebSocket tool parameters (null for webhook tools) */
|
|
19
|
-
parameters?: Record<string, unknown
|
|
19
|
+
parameters?: Record<string, unknown> | null;
|
|
20
20
|
output?: unknown;
|
|
21
21
|
/** Webhook HTTP status code (null for WebSocket tools) */
|
|
22
|
-
response_status_code?: number;
|
|
22
|
+
response_status_code?: number | null;
|
|
23
23
|
/** Whether the tool call timed out */
|
|
24
|
-
timed_out?: boolean;
|
|
24
|
+
timed_out?: boolean | null;
|
|
25
25
|
/** Error message if tool call failed */
|
|
26
|
-
error_message?: string;
|
|
26
|
+
error_message?: string | null;
|
|
27
27
|
}
|
|
28
28
|
export declare namespace ToolCallOutputProcessedPayload {
|
|
29
29
|
interface Tool {
|
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.9";
|
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.9",
|
|
18
|
+
"User-Agent": "phonic/0.30.9",
|
|
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) });
|
|
@@ -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
|
}
|
|
@@ -121,7 +121,9 @@ export class Agents {
|
|
|
121
121
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
122
122
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
123
123
|
* template_variables: {
|
|
124
|
-
* "customer_name": {
|
|
124
|
+
* "customer_name": {
|
|
125
|
+
* default_value: null
|
|
126
|
+
* },
|
|
125
127
|
* "subject": {
|
|
126
128
|
* default_value: "Chess"
|
|
127
129
|
* }
|
|
@@ -224,7 +226,9 @@ export class Agents {
|
|
|
224
226
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
225
227
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
226
228
|
* template_variables: {
|
|
227
|
-
* "customer_name": {
|
|
229
|
+
* "customer_name": {
|
|
230
|
+
* default_value: null
|
|
231
|
+
* },
|
|
228
232
|
* "subject": {
|
|
229
233
|
* default_value: "Chess"
|
|
230
234
|
* }
|
|
@@ -467,7 +471,9 @@ export class Agents {
|
|
|
467
471
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
468
472
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
469
473
|
* template_variables: {
|
|
470
|
-
* "customer_name": {
|
|
474
|
+
* "customer_name": {
|
|
475
|
+
* default_value: null
|
|
476
|
+
* },
|
|
471
477
|
* "subject": {
|
|
472
478
|
* default_value: "Chess"
|
|
473
479
|
* }
|
|
@@ -551,12 +557,10 @@ export class Agents {
|
|
|
551
557
|
return __awaiter(this, void 0, void 0, function* () {
|
|
552
558
|
var _a;
|
|
553
559
|
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"];
|
|
554
|
-
if (bearer
|
|
555
|
-
|
|
556
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
557
|
-
});
|
|
560
|
+
if (bearer != null) {
|
|
561
|
+
return `Bearer ${bearer}`;
|
|
558
562
|
}
|
|
559
|
-
return
|
|
563
|
+
return undefined;
|
|
560
564
|
});
|
|
561
565
|
}
|
|
562
566
|
}
|
|
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
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.mjs";
|
|
|
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.mjs";
|
|
|
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
|
}
|
|
@@ -857,12 +857,10 @@ export class Conversations {
|
|
|
857
857
|
return __awaiter(this, void 0, void 0, function* () {
|
|
858
858
|
var _a;
|
|
859
859
|
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"];
|
|
860
|
-
if (bearer
|
|
861
|
-
|
|
862
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
863
|
-
});
|
|
860
|
+
if (bearer != null) {
|
|
861
|
+
return `Bearer ${bearer}`;
|
|
864
862
|
}
|
|
865
|
-
return
|
|
863
|
+
return undefined;
|
|
866
864
|
});
|
|
867
865
|
}
|
|
868
866
|
}
|
|
@@ -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
|
}
|
|
@@ -425,12 +425,10 @@ export class ExtractionSchemas {
|
|
|
425
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
426
426
|
var _a;
|
|
427
427
|
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"];
|
|
428
|
-
if (bearer
|
|
429
|
-
|
|
430
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
431
|
-
});
|
|
428
|
+
if (bearer != null) {
|
|
429
|
+
return `Bearer ${bearer}`;
|
|
432
430
|
}
|
|
433
|
-
return
|
|
431
|
+
return undefined;
|
|
434
432
|
});
|
|
435
433
|
}
|
|
436
434
|
}
|
|
@@ -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
|
}
|
|
@@ -536,12 +536,10 @@ export class Projects {
|
|
|
536
536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
537
537
|
var _a;
|
|
538
538
|
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"];
|
|
539
|
-
if (bearer
|
|
540
|
-
|
|
541
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
542
|
-
});
|
|
539
|
+
if (bearer != null) {
|
|
540
|
+
return `Bearer ${bearer}`;
|
|
543
541
|
}
|
|
544
|
-
return
|
|
542
|
+
return undefined;
|
|
545
543
|
});
|
|
546
544
|
}
|
|
547
545
|
}
|
|
@@ -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
|
}
|
|
@@ -446,12 +446,10 @@ export class Tools {
|
|
|
446
446
|
return __awaiter(this, void 0, void 0, function* () {
|
|
447
447
|
var _a;
|
|
448
448
|
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"];
|
|
449
|
-
if (bearer
|
|
450
|
-
|
|
451
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
452
|
-
});
|
|
449
|
+
if (bearer != null) {
|
|
450
|
+
return `Bearer ${bearer}`;
|
|
453
451
|
}
|
|
454
|
-
return
|
|
452
|
+
return undefined;
|
|
455
453
|
});
|
|
456
454
|
}
|
|
457
455
|
}
|
|
@@ -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
|
}
|
|
@@ -157,12 +157,10 @@ export class Voices {
|
|
|
157
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
158
158
|
var _a;
|
|
159
159
|
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"];
|
|
160
|
-
if (bearer
|
|
161
|
-
|
|
162
|
-
message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
|
|
163
|
-
});
|
|
160
|
+
if (bearer != null) {
|
|
161
|
+
return `Bearer ${bearer}`;
|
|
164
162
|
}
|
|
165
|
-
return
|
|
163
|
+
return undefined;
|
|
166
164
|
});
|
|
167
165
|
}
|
|
168
166
|
}
|
|
@@ -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
|
}
|
|
@@ -6,11 +6,13 @@ export var ConfigPayload;
|
|
|
6
6
|
ConfigPayload.InputFormat = {
|
|
7
7
|
Pcm44100: "pcm_44100",
|
|
8
8
|
Pcm16000: "pcm_16000",
|
|
9
|
+
Pcm8000: "pcm_8000",
|
|
9
10
|
Mulaw8000: "mulaw_8000",
|
|
10
11
|
};
|
|
11
12
|
ConfigPayload.OutputFormat = {
|
|
12
13
|
Pcm44100: "pcm_44100",
|
|
13
14
|
Pcm16000: "pcm_16000",
|
|
15
|
+
Pcm8000: "pcm_8000",
|
|
14
16
|
Mulaw8000: "mulaw_8000",
|
|
15
17
|
};
|
|
16
18
|
})(ConfigPayload || (ConfigPayload = {}));
|