phonic 0.30.7 → 0.30.8
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/Client.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 +3 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +6 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
- package/dist/cjs/api/resources/conversations/client/Client.js +1 -0
- package/dist/cjs/api/resources/conversations/client/Socket.d.ts +1 -1
- package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -0
- package/dist/cjs/api/types/Agent.d.ts +4 -1
- package/dist/cjs/api/types/Agent.js +1 -0
- package/dist/cjs/api/types/ConfigPayload.d.ts +6 -2
- package/dist/cjs/api/types/ConfigPayload.js +2 -0
- package/dist/cjs/api/types/Conversation.d.ts +2 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +5 -1
- package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
- package/dist/cjs/api/types/InputTextPayload.d.ts +2 -0
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +6 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -0
- package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
- package/dist/esm/api/resources/conversations/client/Client.mjs +1 -0
- package/dist/esm/api/resources/conversations/client/Socket.d.mts +1 -1
- package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -0
- package/dist/esm/api/types/Agent.d.mts +4 -1
- package/dist/esm/api/types/Agent.mjs +1 -0
- package/dist/esm/api/types/ConfigPayload.d.mts +6 -2
- package/dist/esm/api/types/ConfigPayload.mjs +2 -0
- package/dist/esm/api/types/Conversation.d.mts +2 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +5 -1
- package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
- package/dist/esm/api/types/InputTextPayload.d.mts +2 -0
- package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +4 -0
package/README.md
CHANGED
|
@@ -42,6 +42,7 @@ await client.agents.create({
|
|
|
42
42
|
tools: ["keypad_input"],
|
|
43
43
|
no_input_poke_sec: 30,
|
|
44
44
|
no_input_poke_text: "Are you still there?",
|
|
45
|
+
recognized_languages: ["en", "es"],
|
|
45
46
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
46
47
|
configuration_endpoint: {
|
|
47
48
|
url: "https://api.example.com/config",
|
package/dist/cjs/Client.js
CHANGED
|
@@ -50,8 +50,8 @@ class PhonicClient {
|
|
|
50
50
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
51
51
|
"X-Fern-Language": "JavaScript",
|
|
52
52
|
"X-Fern-SDK-Name": "phonic",
|
|
53
|
-
"X-Fern-SDK-Version": "0.30.
|
|
54
|
-
"User-Agent": "phonic/0.30.
|
|
53
|
+
"X-Fern-SDK-Version": "0.30.8",
|
|
54
|
+
"User-Agent": "phonic/0.30.8",
|
|
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) });
|
|
@@ -75,6 +75,7 @@ export declare class Agents {
|
|
|
75
75
|
* tools: ["keypad_input"],
|
|
76
76
|
* no_input_poke_sec: 30,
|
|
77
77
|
* no_input_poke_text: "Are you still there?",
|
|
78
|
+
* recognized_languages: ["en", "es"],
|
|
78
79
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
79
80
|
* configuration_endpoint: {
|
|
80
81
|
* url: "https://api.example.com/config",
|
|
@@ -116,6 +117,7 @@ export declare class Agents {
|
|
|
116
117
|
* tools: ["keypad_input"],
|
|
117
118
|
* no_input_poke_sec: 30,
|
|
118
119
|
* no_input_poke_text: "Are you still there?",
|
|
120
|
+
* recognized_languages: ["en", "es"],
|
|
119
121
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
120
122
|
* configuration_endpoint: {
|
|
121
123
|
* url: "https://api.example.com/config",
|
|
@@ -193,6 +195,7 @@ export declare class Agents {
|
|
|
193
195
|
* tools: ["keypad_input"],
|
|
194
196
|
* no_input_poke_sec: 30,
|
|
195
197
|
* no_input_poke_text: "Are you still there?",
|
|
198
|
+
* recognized_languages: ["en", "es"],
|
|
196
199
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
197
200
|
* configuration_endpoint: {
|
|
198
201
|
* url: "https://api.example.com/config",
|
|
@@ -165,6 +165,7 @@ class Agents {
|
|
|
165
165
|
* tools: ["keypad_input"],
|
|
166
166
|
* no_input_poke_sec: 30,
|
|
167
167
|
* no_input_poke_text: "Are you still there?",
|
|
168
|
+
* recognized_languages: ["en", "es"],
|
|
168
169
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
169
170
|
* configuration_endpoint: {
|
|
170
171
|
* url: "https://api.example.com/config",
|
|
@@ -267,6 +268,7 @@ class Agents {
|
|
|
267
268
|
* tools: ["keypad_input"],
|
|
268
269
|
* no_input_poke_sec: 30,
|
|
269
270
|
* no_input_poke_text: "Are you still there?",
|
|
271
|
+
* recognized_languages: ["en", "es"],
|
|
270
272
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
271
273
|
* configuration_endpoint: {
|
|
272
274
|
* url: "https://api.example.com/config",
|
|
@@ -509,6 +511,7 @@ class Agents {
|
|
|
509
511
|
* tools: ["keypad_input"],
|
|
510
512
|
* no_input_poke_sec: 30,
|
|
511
513
|
* no_input_poke_text: "Are you still there?",
|
|
514
|
+
* recognized_languages: ["en", "es"],
|
|
512
515
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
513
516
|
* configuration_endpoint: {
|
|
514
517
|
* url: "https://api.example.com/config",
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -65,6 +66,8 @@ export interface AgentsCreateRequest {
|
|
|
65
66
|
no_input_poke_text?: string;
|
|
66
67
|
/** Seconds of silence before ending the conversation. */
|
|
67
68
|
no_input_end_conversation_sec?: number;
|
|
69
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
+
recognized_languages?: string[];
|
|
68
71
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
69
72
|
boosted_keywords?: string[];
|
|
70
73
|
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -65,6 +66,8 @@ export interface UpdateAgentRequest {
|
|
|
65
66
|
no_input_poke_text?: string;
|
|
66
67
|
/** Seconds of silence before ending the conversation. */
|
|
67
68
|
no_input_end_conversation_sec?: number;
|
|
69
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
+
recognized_languages?: string[];
|
|
68
71
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
69
72
|
boosted_keywords?: string[];
|
|
70
73
|
/** 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,14 +77,16 @@ export declare namespace UpdateAgentRequest {
|
|
|
74
77
|
/**
|
|
75
78
|
* The audio format of the agent.
|
|
76
79
|
*/
|
|
77
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
80
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
78
81
|
const AudioFormat: {
|
|
79
82
|
readonly Pcm44100: "pcm_44100";
|
|
83
|
+
readonly Pcm16000: "pcm_16000";
|
|
80
84
|
readonly Mulaw8000: "mulaw_8000";
|
|
81
85
|
};
|
|
82
86
|
namespace TemplateVariables {
|
|
83
87
|
interface Value {
|
|
84
88
|
default_value?: string;
|
|
89
|
+
is_boosted_keyword?: boolean;
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
type Tools = Tools.Item[];
|
|
@@ -8,6 +8,7 @@ var UpdateAgentRequest;
|
|
|
8
8
|
(function (UpdateAgentRequest) {
|
|
9
9
|
UpdateAgentRequest.AudioFormat = {
|
|
10
10
|
Pcm44100: "pcm_44100",
|
|
11
|
+
Pcm16000: "pcm_16000",
|
|
11
12
|
Mulaw8000: "mulaw_8000",
|
|
12
13
|
};
|
|
13
14
|
})(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -205,6 +205,7 @@ export declare class Conversations {
|
|
|
205
205
|
* no_input_poke_sec: 30,
|
|
206
206
|
* no_input_poke_text: "Are you still there?",
|
|
207
207
|
* no_input_end_conversation_sec: 180,
|
|
208
|
+
* recognized_languages: ["en", "es"],
|
|
208
209
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
209
210
|
* tools: ["keypad_input"]
|
|
210
211
|
* }
|
|
@@ -713,6 +713,7 @@ class Conversations {
|
|
|
713
713
|
* no_input_poke_sec: 30,
|
|
714
714
|
* no_input_poke_text: "Are you still there?",
|
|
715
715
|
* no_input_end_conversation_sec: 180,
|
|
716
|
+
* recognized_languages: ["en", "es"],
|
|
716
717
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
717
718
|
* tools: ["keypad_input"]
|
|
718
719
|
* }
|
|
@@ -7,7 +7,7 @@ export declare namespace ConversationsSocket {
|
|
|
7
7
|
interface Args {
|
|
8
8
|
socket: core.ReconnectingWebSocket;
|
|
9
9
|
}
|
|
10
|
-
type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
|
|
10
|
+
type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
|
|
11
11
|
type EventHandlers = {
|
|
12
12
|
open?: () => void;
|
|
13
13
|
message?: (message: Response) => void;
|
|
@@ -18,6 +18,7 @@ import * as Phonic from "../../../../index.js";
|
|
|
18
18
|
* no_input_poke_sec: 30,
|
|
19
19
|
* no_input_poke_text: "Are you still there?",
|
|
20
20
|
* no_input_end_conversation_sec: 180,
|
|
21
|
+
* recognized_languages: ["en", "es"],
|
|
21
22
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
22
23
|
* tools: ["keypad_input"]
|
|
23
24
|
* }
|
|
@@ -37,6 +37,8 @@ export interface Agent {
|
|
|
37
37
|
no_input_poke_text: string;
|
|
38
38
|
/** Seconds of silence before ending the conversation. */
|
|
39
39
|
no_input_end_conversation_sec: number;
|
|
40
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
41
|
+
recognized_languages: string[];
|
|
40
42
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
41
43
|
boosted_keywords: string[];
|
|
42
44
|
/** When not `null`, the agent will call this endpoint to get configuration options. */
|
|
@@ -53,9 +55,10 @@ export declare namespace Agent {
|
|
|
53
55
|
/**
|
|
54
56
|
* The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`.
|
|
55
57
|
*/
|
|
56
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
58
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
57
59
|
const AudioFormat: {
|
|
58
60
|
readonly Pcm44100: "pcm_44100";
|
|
61
|
+
readonly Pcm16000: "pcm_16000";
|
|
59
62
|
readonly Mulaw8000: "mulaw_8000";
|
|
60
63
|
};
|
|
61
64
|
namespace TemplateVariables {
|
|
@@ -41,6 +41,8 @@ export interface ConfigPayload {
|
|
|
41
41
|
no_input_poke_text?: string;
|
|
42
42
|
/** Seconds of silence before ending conversation */
|
|
43
43
|
no_input_end_conversation_sec?: number;
|
|
44
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
45
|
+
recognized_languages?: string[];
|
|
44
46
|
/** Keywords to boost in speech recognition */
|
|
45
47
|
boosted_keywords?: string[];
|
|
46
48
|
/** Tools available to the assistant */
|
|
@@ -52,17 +54,19 @@ export declare namespace ConfigPayload {
|
|
|
52
54
|
/**
|
|
53
55
|
* Audio input format
|
|
54
56
|
*/
|
|
55
|
-
type InputFormat = "pcm_44100" | "mulaw_8000";
|
|
57
|
+
type InputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
56
58
|
const InputFormat: {
|
|
57
59
|
readonly Pcm44100: "pcm_44100";
|
|
60
|
+
readonly Pcm16000: "pcm_16000";
|
|
58
61
|
readonly Mulaw8000: "mulaw_8000";
|
|
59
62
|
};
|
|
60
63
|
/**
|
|
61
64
|
* Audio output format
|
|
62
65
|
*/
|
|
63
|
-
type OutputFormat = "pcm_44100" | "mulaw_8000";
|
|
66
|
+
type OutputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
64
67
|
const OutputFormat: {
|
|
65
68
|
readonly Pcm44100: "pcm_44100";
|
|
69
|
+
readonly Pcm16000: "pcm_16000";
|
|
66
70
|
readonly Mulaw8000: "mulaw_8000";
|
|
67
71
|
};
|
|
68
72
|
}
|
|
@@ -8,10 +8,12 @@ var ConfigPayload;
|
|
|
8
8
|
(function (ConfigPayload) {
|
|
9
9
|
ConfigPayload.InputFormat = {
|
|
10
10
|
Pcm44100: "pcm_44100",
|
|
11
|
+
Pcm16000: "pcm_16000",
|
|
11
12
|
Mulaw8000: "mulaw_8000",
|
|
12
13
|
};
|
|
13
14
|
ConfigPayload.OutputFormat = {
|
|
14
15
|
Pcm44100: "pcm_44100",
|
|
16
|
+
Pcm16000: "pcm_16000",
|
|
15
17
|
Mulaw8000: "mulaw_8000",
|
|
16
18
|
};
|
|
17
19
|
})(ConfigPayload || (exports.ConfigPayload = ConfigPayload = {}));
|
|
@@ -37,6 +37,8 @@ export interface Conversation {
|
|
|
37
37
|
started_at: string;
|
|
38
38
|
/** When the conversation ended. */
|
|
39
39
|
ended_at?: string;
|
|
40
|
+
/** Who or what ended the conversation. */
|
|
41
|
+
ended_by?: string;
|
|
40
42
|
/** Array of conversation items (turns). */
|
|
41
43
|
items: Phonic.ConversationItem[];
|
|
42
44
|
/** Results from conversation evaluations and extractions. */
|
|
@@ -32,6 +32,8 @@ export interface CreateAgentRequest {
|
|
|
32
32
|
no_input_poke_text?: string;
|
|
33
33
|
/** Seconds of silence before ending the conversation. */
|
|
34
34
|
no_input_end_conversation_sec?: number;
|
|
35
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
36
|
+
recognized_languages?: string[];
|
|
35
37
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
36
38
|
boosted_keywords?: string[];
|
|
37
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. */
|
|
@@ -41,14 +43,16 @@ export declare namespace CreateAgentRequest {
|
|
|
41
43
|
/**
|
|
42
44
|
* The audio format of the agent.
|
|
43
45
|
*/
|
|
44
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
46
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
45
47
|
const AudioFormat: {
|
|
46
48
|
readonly Pcm44100: "pcm_44100";
|
|
49
|
+
readonly Pcm16000: "pcm_16000";
|
|
47
50
|
readonly Mulaw8000: "mulaw_8000";
|
|
48
51
|
};
|
|
49
52
|
namespace TemplateVariables {
|
|
50
53
|
interface Value {
|
|
51
54
|
default_value?: string;
|
|
55
|
+
is_boosted_keyword?: boolean;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
type Tools = Tools.Item[];
|
|
@@ -8,6 +8,7 @@ var CreateAgentRequest;
|
|
|
8
8
|
(function (CreateAgentRequest) {
|
|
9
9
|
CreateAgentRequest.AudioFormat = {
|
|
10
10
|
Pcm44100: "pcm_44100",
|
|
11
|
+
Pcm16000: "pcm_16000",
|
|
11
12
|
Mulaw8000: "mulaw_8000",
|
|
12
13
|
};
|
|
13
14
|
})(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
|
|
@@ -23,6 +23,8 @@ export interface OutboundCallConfig {
|
|
|
23
23
|
no_input_poke_text?: string;
|
|
24
24
|
/** Seconds of silence before ending the conversation. */
|
|
25
25
|
no_input_end_conversation_sec?: number;
|
|
26
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
27
|
+
recognized_languages?: string[];
|
|
26
28
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
27
29
|
boosted_keywords?: string[];
|
|
28
30
|
/** Array of built-in or custom tool names to use. */
|
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.8";
|
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.8",
|
|
18
|
+
"User-Agent": "phonic/0.30.8",
|
|
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) });
|
|
@@ -75,6 +75,7 @@ export declare class Agents {
|
|
|
75
75
|
* tools: ["keypad_input"],
|
|
76
76
|
* no_input_poke_sec: 30,
|
|
77
77
|
* no_input_poke_text: "Are you still there?",
|
|
78
|
+
* recognized_languages: ["en", "es"],
|
|
78
79
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
79
80
|
* configuration_endpoint: {
|
|
80
81
|
* url: "https://api.example.com/config",
|
|
@@ -116,6 +117,7 @@ export declare class Agents {
|
|
|
116
117
|
* tools: ["keypad_input"],
|
|
117
118
|
* no_input_poke_sec: 30,
|
|
118
119
|
* no_input_poke_text: "Are you still there?",
|
|
120
|
+
* recognized_languages: ["en", "es"],
|
|
119
121
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
120
122
|
* configuration_endpoint: {
|
|
121
123
|
* url: "https://api.example.com/config",
|
|
@@ -193,6 +195,7 @@ export declare class Agents {
|
|
|
193
195
|
* tools: ["keypad_input"],
|
|
194
196
|
* no_input_poke_sec: 30,
|
|
195
197
|
* no_input_poke_text: "Are you still there?",
|
|
198
|
+
* recognized_languages: ["en", "es"],
|
|
196
199
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
197
200
|
* configuration_endpoint: {
|
|
198
201
|
* url: "https://api.example.com/config",
|
|
@@ -129,6 +129,7 @@ export class Agents {
|
|
|
129
129
|
* tools: ["keypad_input"],
|
|
130
130
|
* no_input_poke_sec: 30,
|
|
131
131
|
* no_input_poke_text: "Are you still there?",
|
|
132
|
+
* recognized_languages: ["en", "es"],
|
|
132
133
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
133
134
|
* configuration_endpoint: {
|
|
134
135
|
* url: "https://api.example.com/config",
|
|
@@ -231,6 +232,7 @@ export class Agents {
|
|
|
231
232
|
* tools: ["keypad_input"],
|
|
232
233
|
* no_input_poke_sec: 30,
|
|
233
234
|
* no_input_poke_text: "Are you still there?",
|
|
235
|
+
* recognized_languages: ["en", "es"],
|
|
234
236
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
235
237
|
* configuration_endpoint: {
|
|
236
238
|
* url: "https://api.example.com/config",
|
|
@@ -473,6 +475,7 @@ export class Agents {
|
|
|
473
475
|
* tools: ["keypad_input"],
|
|
474
476
|
* no_input_poke_sec: 30,
|
|
475
477
|
* no_input_poke_text: "Are you still there?",
|
|
478
|
+
* recognized_languages: ["en", "es"],
|
|
476
479
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
477
480
|
* configuration_endpoint: {
|
|
478
481
|
* url: "https://api.example.com/config",
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -65,6 +66,8 @@ export interface AgentsCreateRequest {
|
|
|
65
66
|
no_input_poke_text?: string;
|
|
66
67
|
/** Seconds of silence before ending the conversation. */
|
|
67
68
|
no_input_end_conversation_sec?: number;
|
|
69
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
+
recognized_languages?: string[];
|
|
68
71
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
69
72
|
boosted_keywords?: string[];
|
|
70
73
|
/** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -65,6 +66,8 @@ export interface UpdateAgentRequest {
|
|
|
65
66
|
no_input_poke_text?: string;
|
|
66
67
|
/** Seconds of silence before ending the conversation. */
|
|
67
68
|
no_input_end_conversation_sec?: number;
|
|
69
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
70
|
+
recognized_languages?: string[];
|
|
68
71
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
69
72
|
boosted_keywords?: string[];
|
|
70
73
|
/** 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,14 +77,16 @@ export declare namespace UpdateAgentRequest {
|
|
|
74
77
|
/**
|
|
75
78
|
* The audio format of the agent.
|
|
76
79
|
*/
|
|
77
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
80
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
78
81
|
const AudioFormat: {
|
|
79
82
|
readonly Pcm44100: "pcm_44100";
|
|
83
|
+
readonly Pcm16000: "pcm_16000";
|
|
80
84
|
readonly Mulaw8000: "mulaw_8000";
|
|
81
85
|
};
|
|
82
86
|
namespace TemplateVariables {
|
|
83
87
|
interface Value {
|
|
84
88
|
default_value?: string;
|
|
89
|
+
is_boosted_keyword?: boolean;
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
92
|
type Tools = Tools.Item[];
|
|
@@ -23,6 +23,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
23
23
|
* tools: ["keypad_input"],
|
|
24
24
|
* no_input_poke_sec: 30,
|
|
25
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
26
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
27
28
|
* configuration_endpoint: {
|
|
28
29
|
* url: "https://api.example.com/config",
|
|
@@ -205,6 +205,7 @@ export declare class Conversations {
|
|
|
205
205
|
* no_input_poke_sec: 30,
|
|
206
206
|
* no_input_poke_text: "Are you still there?",
|
|
207
207
|
* no_input_end_conversation_sec: 180,
|
|
208
|
+
* recognized_languages: ["en", "es"],
|
|
208
209
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
209
210
|
* tools: ["keypad_input"]
|
|
210
211
|
* }
|
|
@@ -677,6 +677,7 @@ export class Conversations {
|
|
|
677
677
|
* no_input_poke_sec: 30,
|
|
678
678
|
* no_input_poke_text: "Are you still there?",
|
|
679
679
|
* no_input_end_conversation_sec: 180,
|
|
680
|
+
* recognized_languages: ["en", "es"],
|
|
680
681
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
681
682
|
* tools: ["keypad_input"]
|
|
682
683
|
* }
|
|
@@ -7,7 +7,7 @@ export declare namespace ConversationsSocket {
|
|
|
7
7
|
interface Args {
|
|
8
8
|
socket: core.ReconnectingWebSocket;
|
|
9
9
|
}
|
|
10
|
-
type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
|
|
10
|
+
type Response = Phonic.ReadyToStartConversationPayload | Phonic.ConversationCreatedPayload | Phonic.InputTextPayload | Phonic.InputCancelledPayload | Phonic.AudioChunkResponsePayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.DtmfPayload | Phonic.ToolCallPayload | Phonic.ToolCallOutputProcessedPayload | Phonic.ToolCallInterruptedPayload | Phonic.AssistantChoseNotToRespondPayload | Phonic.AssistantEndedConversationPayload | Phonic.ErrorPayload;
|
|
11
11
|
type EventHandlers = {
|
|
12
12
|
open?: () => void;
|
|
13
13
|
message?: (message: Response) => void;
|
|
@@ -18,6 +18,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
18
18
|
* no_input_poke_sec: 30,
|
|
19
19
|
* no_input_poke_text: "Are you still there?",
|
|
20
20
|
* no_input_end_conversation_sec: 180,
|
|
21
|
+
* recognized_languages: ["en", "es"],
|
|
21
22
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
22
23
|
* tools: ["keypad_input"]
|
|
23
24
|
* }
|
|
@@ -37,6 +37,8 @@ export interface Agent {
|
|
|
37
37
|
no_input_poke_text: string;
|
|
38
38
|
/** Seconds of silence before ending the conversation. */
|
|
39
39
|
no_input_end_conversation_sec: number;
|
|
40
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
41
|
+
recognized_languages: string[];
|
|
40
42
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
41
43
|
boosted_keywords: string[];
|
|
42
44
|
/** When not `null`, the agent will call this endpoint to get configuration options. */
|
|
@@ -53,9 +55,10 @@ export declare namespace Agent {
|
|
|
53
55
|
/**
|
|
54
56
|
* The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`.
|
|
55
57
|
*/
|
|
56
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
58
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
57
59
|
const AudioFormat: {
|
|
58
60
|
readonly Pcm44100: "pcm_44100";
|
|
61
|
+
readonly Pcm16000: "pcm_16000";
|
|
59
62
|
readonly Mulaw8000: "mulaw_8000";
|
|
60
63
|
};
|
|
61
64
|
namespace TemplateVariables {
|
|
@@ -41,6 +41,8 @@ export interface ConfigPayload {
|
|
|
41
41
|
no_input_poke_text?: string;
|
|
42
42
|
/** Seconds of silence before ending conversation */
|
|
43
43
|
no_input_end_conversation_sec?: number;
|
|
44
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
45
|
+
recognized_languages?: string[];
|
|
44
46
|
/** Keywords to boost in speech recognition */
|
|
45
47
|
boosted_keywords?: string[];
|
|
46
48
|
/** Tools available to the assistant */
|
|
@@ -52,17 +54,19 @@ export declare namespace ConfigPayload {
|
|
|
52
54
|
/**
|
|
53
55
|
* Audio input format
|
|
54
56
|
*/
|
|
55
|
-
type InputFormat = "pcm_44100" | "mulaw_8000";
|
|
57
|
+
type InputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
56
58
|
const InputFormat: {
|
|
57
59
|
readonly Pcm44100: "pcm_44100";
|
|
60
|
+
readonly Pcm16000: "pcm_16000";
|
|
58
61
|
readonly Mulaw8000: "mulaw_8000";
|
|
59
62
|
};
|
|
60
63
|
/**
|
|
61
64
|
* Audio output format
|
|
62
65
|
*/
|
|
63
|
-
type OutputFormat = "pcm_44100" | "mulaw_8000";
|
|
66
|
+
type OutputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
64
67
|
const OutputFormat: {
|
|
65
68
|
readonly Pcm44100: "pcm_44100";
|
|
69
|
+
readonly Pcm16000: "pcm_16000";
|
|
66
70
|
readonly Mulaw8000: "mulaw_8000";
|
|
67
71
|
};
|
|
68
72
|
}
|
|
@@ -5,10 +5,12 @@ export var ConfigPayload;
|
|
|
5
5
|
(function (ConfigPayload) {
|
|
6
6
|
ConfigPayload.InputFormat = {
|
|
7
7
|
Pcm44100: "pcm_44100",
|
|
8
|
+
Pcm16000: "pcm_16000",
|
|
8
9
|
Mulaw8000: "mulaw_8000",
|
|
9
10
|
};
|
|
10
11
|
ConfigPayload.OutputFormat = {
|
|
11
12
|
Pcm44100: "pcm_44100",
|
|
13
|
+
Pcm16000: "pcm_16000",
|
|
12
14
|
Mulaw8000: "mulaw_8000",
|
|
13
15
|
};
|
|
14
16
|
})(ConfigPayload || (ConfigPayload = {}));
|
|
@@ -37,6 +37,8 @@ export interface Conversation {
|
|
|
37
37
|
started_at: string;
|
|
38
38
|
/** When the conversation ended. */
|
|
39
39
|
ended_at?: string;
|
|
40
|
+
/** Who or what ended the conversation. */
|
|
41
|
+
ended_by?: string;
|
|
40
42
|
/** Array of conversation items (turns). */
|
|
41
43
|
items: Phonic.ConversationItem[];
|
|
42
44
|
/** Results from conversation evaluations and extractions. */
|
|
@@ -32,6 +32,8 @@ export interface CreateAgentRequest {
|
|
|
32
32
|
no_input_poke_text?: string;
|
|
33
33
|
/** Seconds of silence before ending the conversation. */
|
|
34
34
|
no_input_end_conversation_sec?: number;
|
|
35
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
36
|
+
recognized_languages?: string[];
|
|
35
37
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
36
38
|
boosted_keywords?: string[];
|
|
37
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. */
|
|
@@ -41,14 +43,16 @@ export declare namespace CreateAgentRequest {
|
|
|
41
43
|
/**
|
|
42
44
|
* The audio format of the agent.
|
|
43
45
|
*/
|
|
44
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
46
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
45
47
|
const AudioFormat: {
|
|
46
48
|
readonly Pcm44100: "pcm_44100";
|
|
49
|
+
readonly Pcm16000: "pcm_16000";
|
|
47
50
|
readonly Mulaw8000: "mulaw_8000";
|
|
48
51
|
};
|
|
49
52
|
namespace TemplateVariables {
|
|
50
53
|
interface Value {
|
|
51
54
|
default_value?: string;
|
|
55
|
+
is_boosted_keyword?: boolean;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
type Tools = Tools.Item[];
|
|
@@ -23,6 +23,8 @@ export interface OutboundCallConfig {
|
|
|
23
23
|
no_input_poke_text?: string;
|
|
24
24
|
/** Seconds of silence before ending the conversation. */
|
|
25
25
|
no_input_end_conversation_sec?: number;
|
|
26
|
+
/** Array of ISO 639-1 language codes that the agent should be able to recognize */
|
|
27
|
+
recognized_languages?: string[];
|
|
26
28
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
27
29
|
boosted_keywords?: string[];
|
|
28
30
|
/** Array of built-in or custom tool names to use. */
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.30.
|
|
1
|
+
export declare const SDK_VERSION = "0.30.8";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.30.
|
|
1
|
+
export const SDK_VERSION = "0.30.8";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -112,6 +112,7 @@ await client.agents.create({
|
|
|
112
112
|
tools: ["keypad_input"],
|
|
113
113
|
no_input_poke_sec: 30,
|
|
114
114
|
no_input_poke_text: "Are you still there?",
|
|
115
|
+
recognized_languages: ["en", "es"],
|
|
115
116
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
116
117
|
configuration_endpoint: {
|
|
117
118
|
url: "https://api.example.com/config",
|
|
@@ -202,6 +203,7 @@ await client.agents.upsert({
|
|
|
202
203
|
tools: ["keypad_input"],
|
|
203
204
|
no_input_poke_sec: 30,
|
|
204
205
|
no_input_poke_text: "Are you still there?",
|
|
206
|
+
recognized_languages: ["en", "es"],
|
|
205
207
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
206
208
|
configuration_endpoint: {
|
|
207
209
|
url: "https://api.example.com/config",
|
|
@@ -438,6 +440,7 @@ await client.agents.update("nameOrId", {
|
|
|
438
440
|
tools: ["keypad_input"],
|
|
439
441
|
no_input_poke_sec: 30,
|
|
440
442
|
no_input_poke_text: "Are you still there?",
|
|
443
|
+
recognized_languages: ["en", "es"],
|
|
441
444
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
442
445
|
configuration_endpoint: {
|
|
443
446
|
url: "https://api.example.com/config",
|
|
@@ -1952,6 +1955,7 @@ await client.conversations.outboundCall({
|
|
|
1952
1955
|
no_input_poke_sec: 30,
|
|
1953
1956
|
no_input_poke_text: "Are you still there?",
|
|
1954
1957
|
no_input_end_conversation_sec: 180,
|
|
1958
|
+
recognized_languages: ["en", "es"],
|
|
1955
1959
|
boosted_keywords: ["Load ID", "dispatch"],
|
|
1956
1960
|
tools: ["keypad_input"],
|
|
1957
1961
|
},
|