phonic 0.32.0 → 0.32.2
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 +1 -0
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/agents/client/Client.js +3 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +8 -2
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +2 -1
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -0
- package/dist/cjs/api/types/Agent.d.ts +7 -2
- package/dist/cjs/api/types/Agent.js +2 -1
- package/dist/cjs/api/types/ConfigOptions.d.ts +7 -2
- package/dist/cjs/api/types/ConfigOptions.js +2 -1
- package/dist/cjs/api/types/Conversation.d.ts +11 -4
- package/dist/cjs/api/types/Conversation.js +6 -1
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +7 -2
- package/dist/cjs/api/types/CreateAgentRequest.js +2 -1
- package/dist/cjs/api/types/LanguageCode.d.ts +37 -4
- package/dist/cjs/api/types/LanguageCode.js +37 -4
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +10 -3
- package/dist/cjs/api/types/OutboundCallConfig.js +2 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +8 -2
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +2 -1
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -0
- package/dist/esm/api/types/Agent.d.mts +7 -2
- package/dist/esm/api/types/Agent.mjs +2 -1
- package/dist/esm/api/types/ConfigOptions.d.mts +7 -2
- package/dist/esm/api/types/ConfigOptions.mjs +2 -1
- package/dist/esm/api/types/Conversation.d.mts +11 -4
- package/dist/esm/api/types/Conversation.mjs +6 -1
- package/dist/esm/api/types/CreateAgentRequest.d.mts +7 -2
- package/dist/esm/api/types/CreateAgentRequest.mjs +2 -1
- package/dist/esm/api/types/LanguageCode.d.mts +37 -4
- package/dist/esm/api/types/LanguageCode.mjs +37 -4
- package/dist/esm/api/types/OutboundCallConfig.d.mts +10 -3
- package/dist/esm/api/types/OutboundCallConfig.mjs +2 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +3 -0
package/README.md
CHANGED
|
@@ -54,6 +54,7 @@ await client.agents.create({
|
|
|
54
54
|
audio_speed: 1,
|
|
55
55
|
background_noise_level: 0,
|
|
56
56
|
generate_welcome_message: false,
|
|
57
|
+
is_welcome_message_interruptible: true,
|
|
57
58
|
welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
58
59
|
system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
59
60
|
template_variables: {
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "phonic",
|
|
46
|
-
"X-Fern-SDK-Version": "0.
|
|
47
|
-
"User-Agent": "phonic/0.
|
|
46
|
+
"X-Fern-SDK-Version": "0.32.2",
|
|
47
|
+
"User-Agent": "phonic/0.32.2",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -45,6 +45,7 @@ export declare class AgentsClient {
|
|
|
45
45
|
* audio_speed: 1,
|
|
46
46
|
* background_noise_level: 0,
|
|
47
47
|
* generate_welcome_message: false,
|
|
48
|
+
* is_welcome_message_interruptible: true,
|
|
48
49
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
49
50
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
50
51
|
* template_variables: {
|
|
@@ -99,6 +100,7 @@ export declare class AgentsClient {
|
|
|
99
100
|
* audio_speed: 1,
|
|
100
101
|
* background_noise_level: 0,
|
|
101
102
|
* generate_welcome_message: false,
|
|
103
|
+
* is_welcome_message_interruptible: true,
|
|
102
104
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
103
105
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
104
106
|
* template_variables: {
|
|
@@ -189,6 +191,7 @@ export declare class AgentsClient {
|
|
|
189
191
|
* audio_speed: 1,
|
|
190
192
|
* background_noise_level: 0,
|
|
191
193
|
* generate_welcome_message: false,
|
|
194
|
+
* is_welcome_message_interruptible: true,
|
|
192
195
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
193
196
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
194
197
|
* template_variables: {
|
|
@@ -143,6 +143,7 @@ class AgentsClient {
|
|
|
143
143
|
* audio_speed: 1,
|
|
144
144
|
* background_noise_level: 0,
|
|
145
145
|
* generate_welcome_message: false,
|
|
146
|
+
* is_welcome_message_interruptible: true,
|
|
146
147
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
147
148
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
148
149
|
* template_variables: {
|
|
@@ -246,6 +247,7 @@ class AgentsClient {
|
|
|
246
247
|
* audio_speed: 1,
|
|
247
248
|
* background_noise_level: 0,
|
|
248
249
|
* generate_welcome_message: false,
|
|
250
|
+
* is_welcome_message_interruptible: true,
|
|
249
251
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
250
252
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
251
253
|
* template_variables: {
|
|
@@ -465,6 +467,7 @@ class AgentsClient {
|
|
|
465
467
|
* audio_speed: 1,
|
|
466
468
|
* background_noise_level: 0,
|
|
467
469
|
* generate_welcome_message: false,
|
|
470
|
+
* is_welcome_message_interruptible: true,
|
|
468
471
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
469
472
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
470
473
|
* template_variables: {
|
|
@@ -10,6 +10,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
10
10
|
* audio_speed: 1,
|
|
11
11
|
* background_noise_level: 0,
|
|
12
12
|
* generate_welcome_message: false,
|
|
13
|
+
* is_welcome_message_interruptible: true,
|
|
13
14
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
14
15
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
15
16
|
* template_variables: {
|
|
@@ -68,6 +69,8 @@ export interface AgentsCreateRequest {
|
|
|
68
69
|
background_noise?: Phonic.CreateAgentRequest.BackgroundNoise | null;
|
|
69
70
|
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
70
71
|
generate_welcome_message?: boolean;
|
|
72
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
73
|
+
is_welcome_message_interruptible?: boolean;
|
|
71
74
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
72
75
|
welcome_message?: string;
|
|
73
76
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -92,7 +95,7 @@ export interface AgentsCreateRequest {
|
|
|
92
95
|
additional_languages?: Phonic.LanguageCode[];
|
|
93
96
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
94
97
|
languages?: Phonic.LanguageCode[];
|
|
95
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
98
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
96
99
|
multilingual_mode?: Phonic.CreateAgentRequest.MultilingualMode;
|
|
97
100
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
98
101
|
push_to_talk?: boolean;
|
|
@@ -116,4 +119,6 @@ export interface AgentsCreateRequest {
|
|
|
116
119
|
vad_min_silence_duration_ms?: number;
|
|
117
120
|
/** Voice activity detection threshold. */
|
|
118
121
|
vad_threshold?: number;
|
|
122
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
123
|
+
enable_redaction?: boolean;
|
|
119
124
|
}
|
|
@@ -10,6 +10,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
10
10
|
* audio_speed: 1,
|
|
11
11
|
* background_noise_level: 0,
|
|
12
12
|
* generate_welcome_message: false,
|
|
13
|
+
* is_welcome_message_interruptible: true,
|
|
13
14
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
14
15
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
15
16
|
* template_variables: {
|
|
@@ -68,6 +69,8 @@ export interface UpdateAgentRequest {
|
|
|
68
69
|
background_noise?: UpdateAgentRequest.BackgroundNoise | null;
|
|
69
70
|
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
70
71
|
generate_welcome_message?: boolean;
|
|
72
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
73
|
+
is_welcome_message_interruptible?: boolean;
|
|
71
74
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
72
75
|
welcome_message?: string;
|
|
73
76
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -92,7 +95,7 @@ export interface UpdateAgentRequest {
|
|
|
92
95
|
additional_languages?: Phonic.LanguageCode[];
|
|
93
96
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
94
97
|
languages?: Phonic.LanguageCode[];
|
|
95
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
98
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
96
99
|
multilingual_mode?: UpdateAgentRequest.MultilingualMode;
|
|
97
100
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
98
101
|
push_to_talk?: boolean;
|
|
@@ -116,6 +119,8 @@ export interface UpdateAgentRequest {
|
|
|
116
119
|
vad_min_silence_duration_ms?: number;
|
|
117
120
|
/** Voice activity detection threshold. */
|
|
118
121
|
vad_threshold?: number;
|
|
122
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
123
|
+
enable_redaction?: boolean;
|
|
119
124
|
}
|
|
120
125
|
export declare namespace UpdateAgentRequest {
|
|
121
126
|
const PhoneNumber: {
|
|
@@ -151,10 +156,11 @@ export declare namespace UpdateAgentRequest {
|
|
|
151
156
|
* Custom tool */
|
|
152
157
|
| string;
|
|
153
158
|
}
|
|
154
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
159
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
155
160
|
const MultilingualMode: {
|
|
156
161
|
readonly Auto: "auto";
|
|
157
162
|
readonly Request: "request";
|
|
163
|
+
readonly Initial: "initial";
|
|
158
164
|
};
|
|
159
165
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
160
166
|
type PronunciationDictionary = PronunciationDictionary.Item[];
|
|
@@ -21,9 +21,10 @@ var UpdateAgentRequest;
|
|
|
21
21
|
CallCenter: "call-center",
|
|
22
22
|
CoffeeShop: "coffee-shop",
|
|
23
23
|
};
|
|
24
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
24
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
25
25
|
UpdateAgentRequest.MultilingualMode = {
|
|
26
26
|
Auto: "auto",
|
|
27
27
|
Request: "request",
|
|
28
|
+
Initial: "initial",
|
|
28
29
|
};
|
|
29
30
|
})(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
|
|
@@ -10,6 +10,7 @@ import type * as Phonic from "../../../../index.js";
|
|
|
10
10
|
* audio_speed: 1,
|
|
11
11
|
* background_noise_level: 0,
|
|
12
12
|
* generate_welcome_message: false,
|
|
13
|
+
* is_welcome_message_interruptible: true,
|
|
13
14
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
14
15
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
15
16
|
* template_variables: {
|
|
@@ -24,6 +24,8 @@ export interface Agent {
|
|
|
24
24
|
background_noise: Agent.BackgroundNoise | null;
|
|
25
25
|
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
26
26
|
generate_welcome_message: boolean;
|
|
27
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
28
|
+
is_welcome_message_interruptible: boolean;
|
|
27
29
|
/** Message to play when the conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
28
30
|
welcome_message: string | null;
|
|
29
31
|
/** Instructions for the conversation. */
|
|
@@ -48,7 +50,7 @@ export interface Agent {
|
|
|
48
50
|
additional_languages: Phonic.LanguageCode[];
|
|
49
51
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
50
52
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
51
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
53
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
52
54
|
multilingual_mode: Agent.MultilingualMode;
|
|
53
55
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
54
56
|
push_to_talk: boolean;
|
|
@@ -72,6 +74,8 @@ export interface Agent {
|
|
|
72
74
|
vad_min_silence_duration_ms?: number | undefined;
|
|
73
75
|
/** Voice activity detection threshold. */
|
|
74
76
|
vad_threshold?: number | undefined;
|
|
77
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
78
|
+
enable_redaction?: boolean | undefined;
|
|
75
79
|
}
|
|
76
80
|
export declare namespace Agent {
|
|
77
81
|
/**
|
|
@@ -108,10 +112,11 @@ export declare namespace Agent {
|
|
|
108
112
|
* Custom tool */
|
|
109
113
|
| string;
|
|
110
114
|
}
|
|
111
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
115
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
112
116
|
const MultilingualMode: {
|
|
113
117
|
readonly Auto: "auto";
|
|
114
118
|
readonly Request: "request";
|
|
119
|
+
readonly Initial: "initial";
|
|
115
120
|
};
|
|
116
121
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
117
122
|
type PronunciationDictionary = PronunciationDictionary.Item[];
|
|
@@ -17,9 +17,10 @@ var Agent;
|
|
|
17
17
|
CallCenter: "call-center",
|
|
18
18
|
CoffeeShop: "coffee-shop",
|
|
19
19
|
};
|
|
20
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
20
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
21
21
|
Agent.MultilingualMode = {
|
|
22
22
|
Auto: "auto",
|
|
23
23
|
Request: "request",
|
|
24
|
+
Initial: "initial",
|
|
24
25
|
};
|
|
25
26
|
})(Agent || (exports.Agent = Agent = {}));
|
|
@@ -19,6 +19,8 @@ export interface ConfigOptions {
|
|
|
19
19
|
background_noise?: (ConfigOptions.BackgroundNoise | null) | undefined;
|
|
20
20
|
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
21
21
|
generate_welcome_message?: boolean | undefined;
|
|
22
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
23
|
+
is_welcome_message_interruptible?: boolean | undefined;
|
|
22
24
|
/** Message to play when conversation starts. Ignored when `generate_welcome_message` is `true`. */
|
|
23
25
|
welcome_message?: (string | null) | undefined;
|
|
24
26
|
/** Voice ID to use for speech synthesis */
|
|
@@ -49,7 +51,7 @@ export interface ConfigOptions {
|
|
|
49
51
|
default_language?: string | undefined;
|
|
50
52
|
/** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
|
|
51
53
|
additional_languages?: string[] | undefined;
|
|
52
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
54
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
53
55
|
multilingual_mode?: ConfigOptions.MultilingualMode | undefined;
|
|
54
56
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
55
57
|
push_to_talk?: boolean | undefined;
|
|
@@ -61,6 +63,8 @@ export interface ConfigOptions {
|
|
|
61
63
|
tools?: Phonic.ToolDefinition[] | undefined;
|
|
62
64
|
/** Template variables for system prompt and welcome message */
|
|
63
65
|
template_variables?: Record<string, string> | undefined;
|
|
66
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
67
|
+
enable_redaction?: boolean | undefined;
|
|
64
68
|
}
|
|
65
69
|
export declare namespace ConfigOptions {
|
|
66
70
|
/** Background noise type for the conversation */
|
|
@@ -86,10 +90,11 @@ export declare namespace ConfigOptions {
|
|
|
86
90
|
readonly Mulaw8000: "mulaw_8000";
|
|
87
91
|
};
|
|
88
92
|
type OutputFormat = (typeof OutputFormat)[keyof typeof OutputFormat];
|
|
89
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
93
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
90
94
|
const MultilingualMode: {
|
|
91
95
|
readonly Auto: "auto";
|
|
92
96
|
readonly Request: "request";
|
|
97
|
+
readonly Initial: "initial";
|
|
93
98
|
};
|
|
94
99
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
95
100
|
type PronunciationDictionary = PronunciationDictionary.Item[];
|
|
@@ -24,9 +24,10 @@ var ConfigOptions;
|
|
|
24
24
|
Pcm8000: "pcm_8000",
|
|
25
25
|
Mulaw8000: "mulaw_8000",
|
|
26
26
|
};
|
|
27
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
27
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
28
28
|
ConfigOptions.MultilingualMode = {
|
|
29
29
|
Auto: "auto",
|
|
30
30
|
Request: "request",
|
|
31
|
+
Initial: "initial",
|
|
31
32
|
};
|
|
32
33
|
})(ConfigOptions || (exports.ConfigOptions = ConfigOptions = {}));
|
|
@@ -16,6 +16,8 @@ export interface Conversation {
|
|
|
16
16
|
model: string;
|
|
17
17
|
/** Will be `true` if welcome message was automatically generated. */
|
|
18
18
|
generate_welcome_message: boolean;
|
|
19
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
20
|
+
is_welcome_message_interruptible: boolean;
|
|
19
21
|
/** Welcome message played at start. Will be `null` when `generate_welcome_message` is `true`. */
|
|
20
22
|
welcome_message: string | null;
|
|
21
23
|
/** Template variables used in the conversation. */
|
|
@@ -51,10 +53,10 @@ export interface Conversation {
|
|
|
51
53
|
/** Minimum number of words required to interrupt the assistant. */
|
|
52
54
|
min_words_to_interrupt: number;
|
|
53
55
|
/** ISO 639-1 language code that sets the agent's default language to recognize and speak. Welcome message and no input poke text should be in this language. */
|
|
54
|
-
default_language:
|
|
56
|
+
default_language: Phonic.LanguageCode;
|
|
55
57
|
/** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
|
|
56
|
-
additional_languages:
|
|
57
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
58
|
+
additional_languages: Phonic.LanguageCode[] | null;
|
|
59
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
58
60
|
multilingual_mode: Conversation.MultilingualMode;
|
|
59
61
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
60
62
|
push_to_talk: boolean;
|
|
@@ -128,6 +130,10 @@ export declare namespace Conversation {
|
|
|
128
130
|
readonly UserCanceled: "user_canceled";
|
|
129
131
|
readonly UserValidationFailed: "user_validation_failed";
|
|
130
132
|
readonly Assistant: "assistant";
|
|
133
|
+
readonly AssistantSilenceLimitReached: "assistant_silence_limit_reached";
|
|
134
|
+
readonly ConfigurationEndpointTimedOut: "configuration_endpoint_timed_out";
|
|
135
|
+
readonly ConfigurationEndpointError: "configuration_endpoint_error";
|
|
136
|
+
readonly ConfigurationEndpointInvalidResponse: "configuration_endpoint_invalid_response";
|
|
131
137
|
readonly Error: "error";
|
|
132
138
|
};
|
|
133
139
|
type EndedBy = (typeof EndedBy)[keyof typeof EndedBy];
|
|
@@ -138,10 +144,11 @@ export declare namespace Conversation {
|
|
|
138
144
|
pronunciation: string;
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
147
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
142
148
|
const MultilingualMode: {
|
|
143
149
|
readonly Auto: "auto";
|
|
144
150
|
readonly Request: "request";
|
|
151
|
+
readonly Initial: "initial";
|
|
145
152
|
};
|
|
146
153
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
147
154
|
/**
|
|
@@ -24,11 +24,16 @@ var Conversation;
|
|
|
24
24
|
UserCanceled: "user_canceled",
|
|
25
25
|
UserValidationFailed: "user_validation_failed",
|
|
26
26
|
Assistant: "assistant",
|
|
27
|
+
AssistantSilenceLimitReached: "assistant_silence_limit_reached",
|
|
28
|
+
ConfigurationEndpointTimedOut: "configuration_endpoint_timed_out",
|
|
29
|
+
ConfigurationEndpointError: "configuration_endpoint_error",
|
|
30
|
+
ConfigurationEndpointInvalidResponse: "configuration_endpoint_invalid_response",
|
|
27
31
|
Error: "error",
|
|
28
32
|
};
|
|
29
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
33
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
30
34
|
Conversation.MultilingualMode = {
|
|
31
35
|
Auto: "auto",
|
|
32
36
|
Request: "request",
|
|
37
|
+
Initial: "initial",
|
|
33
38
|
};
|
|
34
39
|
})(Conversation || (exports.Conversation = Conversation = {}));
|
|
@@ -22,6 +22,8 @@ export interface CreateAgentRequest {
|
|
|
22
22
|
background_noise?: (CreateAgentRequest.BackgroundNoise | null) | undefined;
|
|
23
23
|
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
24
24
|
generate_welcome_message?: boolean | undefined;
|
|
25
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
26
|
+
is_welcome_message_interruptible?: boolean | undefined;
|
|
25
27
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
26
28
|
welcome_message?: string | undefined;
|
|
27
29
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -46,7 +48,7 @@ export interface CreateAgentRequest {
|
|
|
46
48
|
additional_languages?: Phonic.LanguageCode[] | undefined;
|
|
47
49
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
48
50
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
49
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
51
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
50
52
|
multilingual_mode?: CreateAgentRequest.MultilingualMode | undefined;
|
|
51
53
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
52
54
|
push_to_talk?: boolean | undefined;
|
|
@@ -70,6 +72,8 @@ export interface CreateAgentRequest {
|
|
|
70
72
|
vad_min_silence_duration_ms?: number | undefined;
|
|
71
73
|
/** Voice activity detection threshold. */
|
|
72
74
|
vad_threshold?: number | undefined;
|
|
75
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
76
|
+
enable_redaction?: boolean | undefined;
|
|
73
77
|
}
|
|
74
78
|
export declare namespace CreateAgentRequest {
|
|
75
79
|
const PhoneNumber: {
|
|
@@ -105,10 +109,11 @@ export declare namespace CreateAgentRequest {
|
|
|
105
109
|
* Custom tool */
|
|
106
110
|
| string;
|
|
107
111
|
}
|
|
108
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
112
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
109
113
|
const MultilingualMode: {
|
|
110
114
|
readonly Auto: "auto";
|
|
111
115
|
readonly Request: "request";
|
|
116
|
+
readonly Initial: "initial";
|
|
112
117
|
};
|
|
113
118
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
114
119
|
type PronunciationDictionary = PronunciationDictionary.Item[];
|
|
@@ -21,9 +21,10 @@ var CreateAgentRequest;
|
|
|
21
21
|
CallCenter: "call-center",
|
|
22
22
|
CoffeeShop: "coffee-shop",
|
|
23
23
|
};
|
|
24
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
24
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
25
25
|
CreateAgentRequest.MultilingualMode = {
|
|
26
26
|
Auto: "auto",
|
|
27
27
|
Request: "request",
|
|
28
|
+
Initial: "initial",
|
|
28
29
|
};
|
|
29
30
|
})(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
|
|
@@ -1,23 +1,56 @@
|
|
|
1
1
|
/** ISO 639-1 language codes supported by the agent */
|
|
2
2
|
export declare const LanguageCode: {
|
|
3
3
|
readonly Ar: "ar";
|
|
4
|
-
readonly
|
|
4
|
+
readonly Az: "az";
|
|
5
|
+
readonly Bg: "bg";
|
|
6
|
+
readonly Bn: "bn";
|
|
5
7
|
readonly Cs: "cs";
|
|
6
8
|
readonly Da: "da";
|
|
7
|
-
readonly
|
|
9
|
+
readonly De: "de";
|
|
10
|
+
readonly El: "el";
|
|
8
11
|
readonly En: "en";
|
|
12
|
+
readonly Es: "es";
|
|
13
|
+
readonly Fa: "fa";
|
|
14
|
+
readonly Fi: "fi";
|
|
15
|
+
readonly Fil: "fil";
|
|
9
16
|
readonly Fr: "fr";
|
|
10
|
-
readonly
|
|
17
|
+
readonly Gu: "gu";
|
|
18
|
+
readonly He: "he";
|
|
19
|
+
readonly Hi: "hi";
|
|
20
|
+
readonly Hu: "hu";
|
|
11
21
|
readonly Id: "id";
|
|
12
22
|
readonly It: "it";
|
|
13
23
|
readonly Ja: "ja";
|
|
24
|
+
readonly Ka: "ka";
|
|
25
|
+
readonly Km: "km";
|
|
26
|
+
readonly Kn: "kn";
|
|
14
27
|
readonly Ko: "ko";
|
|
28
|
+
readonly Lt: "lt";
|
|
29
|
+
readonly Lv: "lv";
|
|
30
|
+
readonly Ml: "ml";
|
|
31
|
+
readonly Mr: "mr";
|
|
32
|
+
readonly Ms: "ms";
|
|
33
|
+
readonly Ne: "ne";
|
|
34
|
+
readonly Nl: "nl";
|
|
35
|
+
readonly No: "no";
|
|
36
|
+
readonly Pa: "pa";
|
|
15
37
|
readonly Pl: "pl";
|
|
16
38
|
readonly Pt: "pt";
|
|
39
|
+
readonly Ro: "ro";
|
|
17
40
|
readonly Ru: "ru";
|
|
18
|
-
readonly
|
|
41
|
+
readonly Si: "si";
|
|
42
|
+
readonly Sk: "sk";
|
|
43
|
+
readonly Sq: "sq";
|
|
19
44
|
readonly Sv: "sv";
|
|
45
|
+
readonly Sw: "sw";
|
|
46
|
+
readonly Ta: "ta";
|
|
47
|
+
readonly Te: "te";
|
|
48
|
+
readonly Th: "th";
|
|
20
49
|
readonly Tr: "tr";
|
|
50
|
+
readonly Uk: "uk";
|
|
51
|
+
readonly Ur: "ur";
|
|
21
52
|
readonly Vi: "vi";
|
|
53
|
+
readonly Yue: "yue";
|
|
54
|
+
readonly Zh: "zh";
|
|
22
55
|
};
|
|
23
56
|
export type LanguageCode = (typeof LanguageCode)[keyof typeof LanguageCode];
|
|
@@ -5,22 +5,55 @@ exports.LanguageCode = void 0;
|
|
|
5
5
|
/** ISO 639-1 language codes supported by the agent */
|
|
6
6
|
exports.LanguageCode = {
|
|
7
7
|
Ar: "ar",
|
|
8
|
-
|
|
8
|
+
Az: "az",
|
|
9
|
+
Bg: "bg",
|
|
10
|
+
Bn: "bn",
|
|
9
11
|
Cs: "cs",
|
|
10
12
|
Da: "da",
|
|
11
|
-
|
|
13
|
+
De: "de",
|
|
14
|
+
El: "el",
|
|
12
15
|
En: "en",
|
|
16
|
+
Es: "es",
|
|
17
|
+
Fa: "fa",
|
|
18
|
+
Fi: "fi",
|
|
19
|
+
Fil: "fil",
|
|
13
20
|
Fr: "fr",
|
|
14
|
-
|
|
21
|
+
Gu: "gu",
|
|
22
|
+
He: "he",
|
|
23
|
+
Hi: "hi",
|
|
24
|
+
Hu: "hu",
|
|
15
25
|
Id: "id",
|
|
16
26
|
It: "it",
|
|
17
27
|
Ja: "ja",
|
|
28
|
+
Ka: "ka",
|
|
29
|
+
Km: "km",
|
|
30
|
+
Kn: "kn",
|
|
18
31
|
Ko: "ko",
|
|
32
|
+
Lt: "lt",
|
|
33
|
+
Lv: "lv",
|
|
34
|
+
Ml: "ml",
|
|
35
|
+
Mr: "mr",
|
|
36
|
+
Ms: "ms",
|
|
37
|
+
Ne: "ne",
|
|
38
|
+
Nl: "nl",
|
|
39
|
+
No: "no",
|
|
40
|
+
Pa: "pa",
|
|
19
41
|
Pl: "pl",
|
|
20
42
|
Pt: "pt",
|
|
43
|
+
Ro: "ro",
|
|
21
44
|
Ru: "ru",
|
|
22
|
-
|
|
45
|
+
Si: "si",
|
|
46
|
+
Sk: "sk",
|
|
47
|
+
Sq: "sq",
|
|
23
48
|
Sv: "sv",
|
|
49
|
+
Sw: "sw",
|
|
50
|
+
Ta: "ta",
|
|
51
|
+
Te: "te",
|
|
52
|
+
Th: "th",
|
|
24
53
|
Tr: "tr",
|
|
54
|
+
Uk: "uk",
|
|
55
|
+
Ur: "ur",
|
|
25
56
|
Vi: "vi",
|
|
57
|
+
Yue: "yue",
|
|
58
|
+
Zh: "zh",
|
|
26
59
|
};
|
|
@@ -7,7 +7,11 @@ export interface OutboundCallConfig {
|
|
|
7
7
|
agent?: string | undefined;
|
|
8
8
|
/** The name of the project to use for the call. */
|
|
9
9
|
project?: string | undefined;
|
|
10
|
-
/**
|
|
10
|
+
/** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
|
|
11
|
+
generate_welcome_message?: boolean | undefined;
|
|
12
|
+
/** When `false`, the welcome message will not be interruptible by the user. */
|
|
13
|
+
is_welcome_message_interruptible?: boolean | undefined;
|
|
14
|
+
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
|
|
11
15
|
welcome_message?: (string | null) | undefined;
|
|
12
16
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
13
17
|
system_prompt?: string | undefined;
|
|
@@ -29,7 +33,7 @@ export interface OutboundCallConfig {
|
|
|
29
33
|
additional_languages?: Phonic.LanguageCode[] | undefined;
|
|
30
34
|
/** Array of ISO 639-1 language codes that the agent should be able to recognize. This field is deprecated. Use `default_language` and `additional_languages` instead. */
|
|
31
35
|
languages?: Phonic.LanguageCode[] | undefined;
|
|
32
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
36
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
33
37
|
multilingual_mode?: OutboundCallConfig.MultilingualMode | undefined;
|
|
34
38
|
/** Push to talk mode. User must send mute/unmute messages to turn on/off listening to audio. Defaults to false. */
|
|
35
39
|
push_to_talk?: boolean | undefined;
|
|
@@ -41,12 +45,15 @@ export interface OutboundCallConfig {
|
|
|
41
45
|
min_words_to_interrupt?: number | undefined;
|
|
42
46
|
/** Array of built-in or custom tool names to use. */
|
|
43
47
|
tools?: OutboundCallConfig.Tools.Item[] | undefined;
|
|
48
|
+
/** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
|
|
49
|
+
enable_redaction?: boolean | undefined;
|
|
44
50
|
}
|
|
45
51
|
export declare namespace OutboundCallConfig {
|
|
46
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
52
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
47
53
|
const MultilingualMode: {
|
|
48
54
|
readonly Auto: "auto";
|
|
49
55
|
readonly Request: "request";
|
|
56
|
+
readonly Initial: "initial";
|
|
50
57
|
};
|
|
51
58
|
type MultilingualMode = (typeof MultilingualMode)[keyof typeof MultilingualMode];
|
|
52
59
|
type PronunciationDictionary = PronunciationDictionary.Item[];
|
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.OutboundCallConfig = void 0;
|
|
5
5
|
var OutboundCallConfig;
|
|
6
6
|
(function (OutboundCallConfig) {
|
|
7
|
-
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). */
|
|
7
|
+
/** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
|
|
8
8
|
OutboundCallConfig.MultilingualMode = {
|
|
9
9
|
Auto: "auto",
|
|
10
10
|
Request: "request",
|
|
11
|
+
Initial: "initial",
|
|
11
12
|
};
|
|
12
13
|
})(OutboundCallConfig || (exports.OutboundCallConfig = OutboundCallConfig = {}));
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.2";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "phonic",
|
|
9
|
-
"X-Fern-SDK-Version": "0.
|
|
10
|
-
"User-Agent": "phonic/0.
|
|
9
|
+
"X-Fern-SDK-Version": "0.32.2",
|
|
10
|
+
"User-Agent": "phonic/0.32.2",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -45,6 +45,7 @@ export declare class AgentsClient {
|
|
|
45
45
|
* audio_speed: 1,
|
|
46
46
|
* background_noise_level: 0,
|
|
47
47
|
* generate_welcome_message: false,
|
|
48
|
+
* is_welcome_message_interruptible: true,
|
|
48
49
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
49
50
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
50
51
|
* template_variables: {
|
|
@@ -99,6 +100,7 @@ export declare class AgentsClient {
|
|
|
99
100
|
* audio_speed: 1,
|
|
100
101
|
* background_noise_level: 0,
|
|
101
102
|
* generate_welcome_message: false,
|
|
103
|
+
* is_welcome_message_interruptible: true,
|
|
102
104
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
103
105
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
104
106
|
* template_variables: {
|
|
@@ -189,6 +191,7 @@ export declare class AgentsClient {
|
|
|
189
191
|
* audio_speed: 1,
|
|
190
192
|
* background_noise_level: 0,
|
|
191
193
|
* generate_welcome_message: false,
|
|
194
|
+
* is_welcome_message_interruptible: true,
|
|
192
195
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
193
196
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
194
197
|
* template_variables: {
|