phonic 0.30.6 → 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 +2 -0
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/agents/client/Client.d.ts +6 -0
- package/dist/cjs/api/resources/agents/client/Client.js +6 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
- package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +2 -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 +6 -1
- package/dist/cjs/api/types/Agent.js +1 -0
- package/dist/cjs/api/types/ConfigPayload.d.ts +8 -2
- package/dist/cjs/api/types/ConfigPayload.js +2 -0
- package/dist/cjs/api/types/Conversation.d.ts +4 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +7 -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/api/types/index.d.ts +0 -2
- package/dist/cjs/api/types/index.js +0 -2
- 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 +6 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +6 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
- package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +2 -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 +6 -1
- package/dist/esm/api/types/Agent.mjs +1 -0
- package/dist/esm/api/types/ConfigPayload.d.mts +8 -2
- package/dist/esm/api/types/ConfigPayload.mjs +2 -0
- package/dist/esm/api/types/Conversation.d.mts +4 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +7 -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/api/types/index.d.mts +0 -2
- package/dist/esm/api/types/index.mjs +0 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/index.d.mts +686 -0
- package/dist/index.d.ts +686 -0
- package/dist/index.js +643 -0
- package/dist/index.mjs +606 -0
- package/package.json +1 -1
- package/reference.md +7 -0
|
@@ -11,6 +11,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
11
11
|
* timezone: "America/Los_Angeles",
|
|
12
12
|
* voice_id: "grant",
|
|
13
13
|
* audio_speed: 1,
|
|
14
|
+
* background_noise_level: 0,
|
|
14
15
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
15
16
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
16
17
|
* template_variables: {
|
|
@@ -22,6 +23,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
22
23
|
* tools: ["keypad_input"],
|
|
23
24
|
* no_input_poke_sec: 30,
|
|
24
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
25
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
26
28
|
* configuration_endpoint: {
|
|
27
29
|
* url: "https://api.example.com/config",
|
|
@@ -46,6 +48,8 @@ export interface UpdateAgentRequest {
|
|
|
46
48
|
audio_format?: UpdateAgentRequest.AudioFormat;
|
|
47
49
|
/** The audio speed of the agent. */
|
|
48
50
|
audio_speed?: number;
|
|
51
|
+
/** The background noise level of the agent. */
|
|
52
|
+
background_noise_level?: number;
|
|
49
53
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
|
|
50
54
|
welcome_message?: string;
|
|
51
55
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -62,6 +66,8 @@ export interface UpdateAgentRequest {
|
|
|
62
66
|
no_input_poke_text?: string;
|
|
63
67
|
/** Seconds of silence before ending the conversation. */
|
|
64
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[];
|
|
65
71
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
66
72
|
boosted_keywords?: string[];
|
|
67
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. */
|
|
@@ -71,14 +77,16 @@ export declare namespace UpdateAgentRequest {
|
|
|
71
77
|
/**
|
|
72
78
|
* The audio format of the agent.
|
|
73
79
|
*/
|
|
74
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
80
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
75
81
|
const AudioFormat: {
|
|
76
82
|
readonly Pcm44100: "pcm_44100";
|
|
83
|
+
readonly Pcm16000: "pcm_16000";
|
|
77
84
|
readonly Mulaw8000: "mulaw_8000";
|
|
78
85
|
};
|
|
79
86
|
namespace TemplateVariables {
|
|
80
87
|
interface Value {
|
|
81
88
|
default_value?: string;
|
|
89
|
+
is_boosted_keyword?: boolean;
|
|
82
90
|
}
|
|
83
91
|
}
|
|
84
92
|
type Tools = Tools.Item[];
|
|
@@ -11,6 +11,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
11
11
|
* timezone: "America/Los_Angeles",
|
|
12
12
|
* voice_id: "grant",
|
|
13
13
|
* audio_speed: 1,
|
|
14
|
+
* background_noise_level: 0,
|
|
14
15
|
* welcome_message: "Hi {{customer_name}}. How can I help you today?",
|
|
15
16
|
* system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
|
|
16
17
|
* template_variables: {
|
|
@@ -22,6 +23,7 @@ import * as Phonic from "../../../../index.mjs";
|
|
|
22
23
|
* tools: ["keypad_input"],
|
|
23
24
|
* no_input_poke_sec: 30,
|
|
24
25
|
* no_input_poke_text: "Are you still there?",
|
|
26
|
+
* recognized_languages: ["en", "es"],
|
|
25
27
|
* boosted_keywords: ["Load ID", "dispatch"],
|
|
26
28
|
* configuration_endpoint: {
|
|
27
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.AudioChunkResponsePayload | Phonic.
|
|
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
|
* }
|
|
@@ -19,6 +19,8 @@ export interface Agent {
|
|
|
19
19
|
audio_format: Agent.AudioFormat;
|
|
20
20
|
/** The audio speed of the agent. Must be a multiple of 0.1. */
|
|
21
21
|
audio_speed: number;
|
|
22
|
+
/** The background noise level of the agent. Must be between 0 and 1. */
|
|
23
|
+
background_noise_level: number;
|
|
22
24
|
/** Message to play when the conversation starts. */
|
|
23
25
|
welcome_message?: string;
|
|
24
26
|
/** Instructions for the conversation. */
|
|
@@ -35,6 +37,8 @@ export interface Agent {
|
|
|
35
37
|
no_input_poke_text: string;
|
|
36
38
|
/** Seconds of silence before ending the conversation. */
|
|
37
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[];
|
|
38
42
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
39
43
|
boosted_keywords: string[];
|
|
40
44
|
/** When not `null`, the agent will call this endpoint to get configuration options. */
|
|
@@ -51,9 +55,10 @@ export declare namespace Agent {
|
|
|
51
55
|
/**
|
|
52
56
|
* The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`.
|
|
53
57
|
*/
|
|
54
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
58
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
55
59
|
const AudioFormat: {
|
|
56
60
|
readonly Pcm44100: "pcm_44100";
|
|
61
|
+
readonly Pcm16000: "pcm_16000";
|
|
57
62
|
readonly Mulaw8000: "mulaw_8000";
|
|
58
63
|
};
|
|
59
64
|
namespace TemplateVariables {
|
|
@@ -13,6 +13,8 @@ export interface ConfigPayload {
|
|
|
13
13
|
system_prompt?: string;
|
|
14
14
|
/** Audio playback speed */
|
|
15
15
|
audio_speed?: number;
|
|
16
|
+
/** Background noise level for the conversation */
|
|
17
|
+
background_noise_level?: number;
|
|
16
18
|
/** Message to play when conversation starts */
|
|
17
19
|
welcome_message?: string;
|
|
18
20
|
/** Voice ID to use for speech synthesis */
|
|
@@ -39,6 +41,8 @@ export interface ConfigPayload {
|
|
|
39
41
|
no_input_poke_text?: string;
|
|
40
42
|
/** Seconds of silence before ending conversation */
|
|
41
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[];
|
|
42
46
|
/** Keywords to boost in speech recognition */
|
|
43
47
|
boosted_keywords?: string[];
|
|
44
48
|
/** Tools available to the assistant */
|
|
@@ -50,17 +54,19 @@ export declare namespace ConfigPayload {
|
|
|
50
54
|
/**
|
|
51
55
|
* Audio input format
|
|
52
56
|
*/
|
|
53
|
-
type InputFormat = "pcm_44100" | "mulaw_8000";
|
|
57
|
+
type InputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
54
58
|
const InputFormat: {
|
|
55
59
|
readonly Pcm44100: "pcm_44100";
|
|
60
|
+
readonly Pcm16000: "pcm_16000";
|
|
56
61
|
readonly Mulaw8000: "mulaw_8000";
|
|
57
62
|
};
|
|
58
63
|
/**
|
|
59
64
|
* Audio output format
|
|
60
65
|
*/
|
|
61
|
-
type OutputFormat = "pcm_44100" | "mulaw_8000";
|
|
66
|
+
type OutputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
62
67
|
const OutputFormat: {
|
|
63
68
|
readonly Pcm44100: "pcm_44100";
|
|
69
|
+
readonly Pcm16000: "pcm_16000";
|
|
64
70
|
readonly Mulaw8000: "mulaw_8000";
|
|
65
71
|
};
|
|
66
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 = {}));
|
|
@@ -23,6 +23,8 @@ export interface Conversation {
|
|
|
23
23
|
input_format: string;
|
|
24
24
|
/** Audio output format. */
|
|
25
25
|
output_format: string;
|
|
26
|
+
/** Background noise level used in the conversation. */
|
|
27
|
+
background_noise_level: number;
|
|
26
28
|
/** Live transcript of the conversation. */
|
|
27
29
|
live_transcript: string;
|
|
28
30
|
/** Post-call processed transcript. */
|
|
@@ -35,6 +37,8 @@ export interface Conversation {
|
|
|
35
37
|
started_at: string;
|
|
36
38
|
/** When the conversation ended. */
|
|
37
39
|
ended_at?: string;
|
|
40
|
+
/** Who or what ended the conversation. */
|
|
41
|
+
ended_by?: string;
|
|
38
42
|
/** Array of conversation items (turns). */
|
|
39
43
|
items: Phonic.ConversationItem[];
|
|
40
44
|
/** Results from conversation evaluations and extractions. */
|
|
@@ -14,6 +14,8 @@ export interface CreateAgentRequest {
|
|
|
14
14
|
audio_format?: CreateAgentRequest.AudioFormat;
|
|
15
15
|
/** The audio speed of the agent. */
|
|
16
16
|
audio_speed?: number;
|
|
17
|
+
/** The background noise level of the agent. */
|
|
18
|
+
background_noise_level?: number;
|
|
17
19
|
/** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
|
|
18
20
|
welcome_message?: string;
|
|
19
21
|
/** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
|
|
@@ -30,6 +32,8 @@ export interface CreateAgentRequest {
|
|
|
30
32
|
no_input_poke_text?: string;
|
|
31
33
|
/** Seconds of silence before ending the conversation. */
|
|
32
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[];
|
|
33
37
|
/** These words, or short phrases, will be more accurately recognized by the agent. */
|
|
34
38
|
boosted_keywords?: string[];
|
|
35
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. */
|
|
@@ -39,14 +43,16 @@ export declare namespace CreateAgentRequest {
|
|
|
39
43
|
/**
|
|
40
44
|
* The audio format of the agent.
|
|
41
45
|
*/
|
|
42
|
-
type AudioFormat = "pcm_44100" | "mulaw_8000";
|
|
46
|
+
type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
|
|
43
47
|
const AudioFormat: {
|
|
44
48
|
readonly Pcm44100: "pcm_44100";
|
|
49
|
+
readonly Pcm16000: "pcm_16000";
|
|
45
50
|
readonly Mulaw8000: "mulaw_8000";
|
|
46
51
|
};
|
|
47
52
|
namespace TemplateVariables {
|
|
48
53
|
interface Value {
|
|
49
54
|
default_value?: string;
|
|
55
|
+
is_boosted_keyword?: boolean;
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
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. */
|
|
@@ -31,11 +31,9 @@ export * from "./ConversationCreatedPayload.mjs";
|
|
|
31
31
|
export * from "./InputTextPayload.mjs";
|
|
32
32
|
export * from "./InputCancelledPayload.mjs";
|
|
33
33
|
export * from "./AudioChunkResponsePayload.mjs";
|
|
34
|
-
export * from "./AudioFinishedPayload.mjs";
|
|
35
34
|
export * from "./UserStartedSpeakingPayload.mjs";
|
|
36
35
|
export * from "./UserFinishedSpeakingPayload.mjs";
|
|
37
36
|
export * from "./IsUserSpeakingPayload.mjs";
|
|
38
|
-
export * from "./InterruptedResponsePayload.mjs";
|
|
39
37
|
export * from "./DtmfPayload.mjs";
|
|
40
38
|
export * from "./ToolCallPayload.mjs";
|
|
41
39
|
export * from "./ToolCallOutputProcessedPayload.mjs";
|
|
@@ -31,11 +31,9 @@ export * from "./ConversationCreatedPayload.mjs";
|
|
|
31
31
|
export * from "./InputTextPayload.mjs";
|
|
32
32
|
export * from "./InputCancelledPayload.mjs";
|
|
33
33
|
export * from "./AudioChunkResponsePayload.mjs";
|
|
34
|
-
export * from "./AudioFinishedPayload.mjs";
|
|
35
34
|
export * from "./UserStartedSpeakingPayload.mjs";
|
|
36
35
|
export * from "./UserFinishedSpeakingPayload.mjs";
|
|
37
36
|
export * from "./IsUserSpeakingPayload.mjs";
|
|
38
|
-
export * from "./InterruptedResponsePayload.mjs";
|
|
39
37
|
export * from "./DtmfPayload.mjs";
|
|
40
38
|
export * from "./ToolCallPayload.mjs";
|
|
41
39
|
export * from "./ToolCallOutputProcessedPayload.mjs";
|
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";
|