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.
Files changed (55) hide show
  1. package/README.md +2 -0
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agents/client/Client.d.ts +6 -0
  4. package/dist/cjs/api/resources/agents/client/Client.js +6 -0
  5. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -0
  6. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -1
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +1 -0
  8. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +2 -0
  9. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -0
  10. package/dist/cjs/api/resources/conversations/client/Client.js +1 -0
  11. package/dist/cjs/api/resources/conversations/client/Socket.d.ts +1 -1
  12. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -0
  13. package/dist/cjs/api/types/Agent.d.ts +6 -1
  14. package/dist/cjs/api/types/Agent.js +1 -0
  15. package/dist/cjs/api/types/ConfigPayload.d.ts +8 -2
  16. package/dist/cjs/api/types/ConfigPayload.js +2 -0
  17. package/dist/cjs/api/types/Conversation.d.ts +4 -0
  18. package/dist/cjs/api/types/CreateAgentRequest.d.ts +7 -1
  19. package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
  20. package/dist/cjs/api/types/InputTextPayload.d.ts +2 -0
  21. package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -0
  22. package/dist/cjs/api/types/index.d.ts +0 -2
  23. package/dist/cjs/api/types/index.js +0 -2
  24. package/dist/cjs/version.d.ts +1 -1
  25. package/dist/cjs/version.js +1 -1
  26. package/dist/esm/Client.mjs +2 -2
  27. package/dist/esm/api/resources/agents/client/Client.d.mts +6 -0
  28. package/dist/esm/api/resources/agents/client/Client.mjs +6 -0
  29. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -0
  30. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -1
  31. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
  32. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +2 -0
  33. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -0
  34. package/dist/esm/api/resources/conversations/client/Client.mjs +1 -0
  35. package/dist/esm/api/resources/conversations/client/Socket.d.mts +1 -1
  36. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -0
  37. package/dist/esm/api/types/Agent.d.mts +6 -1
  38. package/dist/esm/api/types/Agent.mjs +1 -0
  39. package/dist/esm/api/types/ConfigPayload.d.mts +8 -2
  40. package/dist/esm/api/types/ConfigPayload.mjs +2 -0
  41. package/dist/esm/api/types/Conversation.d.mts +4 -0
  42. package/dist/esm/api/types/CreateAgentRequest.d.mts +7 -1
  43. package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
  44. package/dist/esm/api/types/InputTextPayload.d.mts +2 -0
  45. package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -0
  46. package/dist/esm/api/types/index.d.mts +0 -2
  47. package/dist/esm/api/types/index.mjs +0 -2
  48. package/dist/esm/version.d.mts +1 -1
  49. package/dist/esm/version.mjs +1 -1
  50. package/dist/index.d.mts +686 -0
  51. package/dist/index.d.ts +686 -0
  52. package/dist/index.js +643 -0
  53. package/dist/index.mjs +606 -0
  54. package/package.json +1 -1
  55. package/reference.md +7 -0
package/README.md CHANGED
@@ -30,6 +30,7 @@ await client.agents.create({
30
30
  timezone: "America/Los_Angeles",
31
31
  voice_id: "grant",
32
32
  audio_speed: 1,
33
+ background_noise_level: 0,
33
34
  welcome_message: "Hi {{customer_name}}. How can I help you today?",
34
35
  system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
35
36
  template_variables: {
@@ -41,6 +42,7 @@ await client.agents.create({
41
42
  tools: ["keypad_input"],
42
43
  no_input_poke_sec: 30,
43
44
  no_input_poke_text: "Are you still there?",
45
+ recognized_languages: ["en", "es"],
44
46
  boosted_keywords: ["Load ID", "dispatch"],
45
47
  configuration_endpoint: {
46
48
  url: "https://api.example.com/config",
@@ -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.6",
54
- "User-Agent": "phonic/0.30.6",
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) });
@@ -63,6 +63,7 @@ export declare class Agents {
63
63
  * timezone: "America/Los_Angeles",
64
64
  * voice_id: "grant",
65
65
  * audio_speed: 1,
66
+ * background_noise_level: 0,
66
67
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
67
68
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
68
69
  * template_variables: {
@@ -74,6 +75,7 @@ export declare class Agents {
74
75
  * tools: ["keypad_input"],
75
76
  * no_input_poke_sec: 30,
76
77
  * no_input_poke_text: "Are you still there?",
78
+ * recognized_languages: ["en", "es"],
77
79
  * boosted_keywords: ["Load ID", "dispatch"],
78
80
  * configuration_endpoint: {
79
81
  * url: "https://api.example.com/config",
@@ -103,6 +105,7 @@ export declare class Agents {
103
105
  * timezone: "America/Los_Angeles",
104
106
  * voice_id: "grant",
105
107
  * audio_speed: 1,
108
+ * background_noise_level: 0,
106
109
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
107
110
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
108
111
  * template_variables: {
@@ -114,6 +117,7 @@ export declare class Agents {
114
117
  * tools: ["keypad_input"],
115
118
  * no_input_poke_sec: 30,
116
119
  * no_input_poke_text: "Are you still there?",
120
+ * recognized_languages: ["en", "es"],
117
121
  * boosted_keywords: ["Load ID", "dispatch"],
118
122
  * configuration_endpoint: {
119
123
  * url: "https://api.example.com/config",
@@ -179,6 +183,7 @@ export declare class Agents {
179
183
  * timezone: "America/Los_Angeles",
180
184
  * voice_id: "grant",
181
185
  * audio_speed: 1,
186
+ * background_noise_level: 0,
182
187
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
183
188
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
184
189
  * template_variables: {
@@ -190,6 +195,7 @@ export declare class Agents {
190
195
  * tools: ["keypad_input"],
191
196
  * no_input_poke_sec: 30,
192
197
  * no_input_poke_text: "Are you still there?",
198
+ * recognized_languages: ["en", "es"],
193
199
  * boosted_keywords: ["Load ID", "dispatch"],
194
200
  * configuration_endpoint: {
195
201
  * url: "https://api.example.com/config",
@@ -153,6 +153,7 @@ class Agents {
153
153
  * timezone: "America/Los_Angeles",
154
154
  * voice_id: "grant",
155
155
  * audio_speed: 1,
156
+ * background_noise_level: 0,
156
157
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
157
158
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
158
159
  * template_variables: {
@@ -164,6 +165,7 @@ class Agents {
164
165
  * tools: ["keypad_input"],
165
166
  * no_input_poke_sec: 30,
166
167
  * no_input_poke_text: "Are you still there?",
168
+ * recognized_languages: ["en", "es"],
167
169
  * boosted_keywords: ["Load ID", "dispatch"],
168
170
  * configuration_endpoint: {
169
171
  * url: "https://api.example.com/config",
@@ -254,6 +256,7 @@ class Agents {
254
256
  * timezone: "America/Los_Angeles",
255
257
  * voice_id: "grant",
256
258
  * audio_speed: 1,
259
+ * background_noise_level: 0,
257
260
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
258
261
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
259
262
  * template_variables: {
@@ -265,6 +268,7 @@ class Agents {
265
268
  * tools: ["keypad_input"],
266
269
  * no_input_poke_sec: 30,
267
270
  * no_input_poke_text: "Are you still there?",
271
+ * recognized_languages: ["en", "es"],
268
272
  * boosted_keywords: ["Load ID", "dispatch"],
269
273
  * configuration_endpoint: {
270
274
  * url: "https://api.example.com/config",
@@ -495,6 +499,7 @@ class Agents {
495
499
  * timezone: "America/Los_Angeles",
496
500
  * voice_id: "grant",
497
501
  * audio_speed: 1,
502
+ * background_noise_level: 0,
498
503
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
499
504
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
500
505
  * template_variables: {
@@ -506,6 +511,7 @@ class Agents {
506
511
  * tools: ["keypad_input"],
507
512
  * no_input_poke_sec: 30,
508
513
  * no_input_poke_text: "Are you still there?",
514
+ * recognized_languages: ["en", "es"],
509
515
  * boosted_keywords: ["Load ID", "dispatch"],
510
516
  * configuration_endpoint: {
511
517
  * url: "https://api.example.com/config",
@@ -11,6 +11,7 @@ import * as Phonic from "../../../../index.js";
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.js";
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 AgentsCreateRequest {
46
48
  audio_format?: Phonic.CreateAgentRequest.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 AgentsCreateRequest {
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. */
@@ -11,6 +11,7 @@ import * as Phonic from "../../../../index.js";
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.js";
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[];
@@ -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 = {}));
@@ -11,6 +11,7 @@ import * as Phonic from "../../../../index.js";
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.js";
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
  * }
@@ -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.AudioChunkResponsePayload | Phonic.AudioFinishedPayload | Phonic.UserStartedSpeakingPayload | Phonic.UserFinishedSpeakingPayload | Phonic.InterruptedResponsePayload | 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
  * }
@@ -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 {
@@ -8,6 +8,7 @@ var Agent;
8
8
  (function (Agent) {
9
9
  Agent.AudioFormat = {
10
10
  Pcm44100: "pcm_44100",
11
+ Pcm16000: "pcm_16000",
11
12
  Mulaw8000: "mulaw_8000",
12
13
  };
13
14
  })(Agent || (exports.Agent = Agent = {}));
@@ -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
  }
@@ -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 = {}));
@@ -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[];
@@ -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 = {}));
@@ -3,6 +3,8 @@
3
3
  */
4
4
  export interface InputTextPayload {
5
5
  type: "input_text";
6
+ /** Detected ISO 639-1 language code of user speech */
7
+ language: string;
6
8
  /** Transcribed user speech */
7
9
  text: string;
8
10
  }
@@ -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.js";
31
31
  export * from "./InputTextPayload.js";
32
32
  export * from "./InputCancelledPayload.js";
33
33
  export * from "./AudioChunkResponsePayload.js";
34
- export * from "./AudioFinishedPayload.js";
35
34
  export * from "./UserStartedSpeakingPayload.js";
36
35
  export * from "./UserFinishedSpeakingPayload.js";
37
36
  export * from "./IsUserSpeakingPayload.js";
38
- export * from "./InterruptedResponsePayload.js";
39
37
  export * from "./DtmfPayload.js";
40
38
  export * from "./ToolCallPayload.js";
41
39
  export * from "./ToolCallOutputProcessedPayload.js";
@@ -47,11 +47,9 @@ __exportStar(require("./ConversationCreatedPayload.js"), exports);
47
47
  __exportStar(require("./InputTextPayload.js"), exports);
48
48
  __exportStar(require("./InputCancelledPayload.js"), exports);
49
49
  __exportStar(require("./AudioChunkResponsePayload.js"), exports);
50
- __exportStar(require("./AudioFinishedPayload.js"), exports);
51
50
  __exportStar(require("./UserStartedSpeakingPayload.js"), exports);
52
51
  __exportStar(require("./UserFinishedSpeakingPayload.js"), exports);
53
52
  __exportStar(require("./IsUserSpeakingPayload.js"), exports);
54
- __exportStar(require("./InterruptedResponsePayload.js"), exports);
55
53
  __exportStar(require("./DtmfPayload.js"), exports);
56
54
  __exportStar(require("./ToolCallPayload.js"), exports);
57
55
  __exportStar(require("./ToolCallOutputProcessedPayload.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.6";
1
+ export declare const SDK_VERSION = "0.30.8";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.30.6";
4
+ exports.SDK_VERSION = "0.30.8";
@@ -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.6",
18
- "User-Agent": "phonic/0.30.6",
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) });
@@ -63,6 +63,7 @@ export declare class Agents {
63
63
  * timezone: "America/Los_Angeles",
64
64
  * voice_id: "grant",
65
65
  * audio_speed: 1,
66
+ * background_noise_level: 0,
66
67
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
67
68
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
68
69
  * template_variables: {
@@ -74,6 +75,7 @@ export declare class Agents {
74
75
  * tools: ["keypad_input"],
75
76
  * no_input_poke_sec: 30,
76
77
  * no_input_poke_text: "Are you still there?",
78
+ * recognized_languages: ["en", "es"],
77
79
  * boosted_keywords: ["Load ID", "dispatch"],
78
80
  * configuration_endpoint: {
79
81
  * url: "https://api.example.com/config",
@@ -103,6 +105,7 @@ export declare class Agents {
103
105
  * timezone: "America/Los_Angeles",
104
106
  * voice_id: "grant",
105
107
  * audio_speed: 1,
108
+ * background_noise_level: 0,
106
109
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
107
110
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
108
111
  * template_variables: {
@@ -114,6 +117,7 @@ export declare class Agents {
114
117
  * tools: ["keypad_input"],
115
118
  * no_input_poke_sec: 30,
116
119
  * no_input_poke_text: "Are you still there?",
120
+ * recognized_languages: ["en", "es"],
117
121
  * boosted_keywords: ["Load ID", "dispatch"],
118
122
  * configuration_endpoint: {
119
123
  * url: "https://api.example.com/config",
@@ -179,6 +183,7 @@ export declare class Agents {
179
183
  * timezone: "America/Los_Angeles",
180
184
  * voice_id: "grant",
181
185
  * audio_speed: 1,
186
+ * background_noise_level: 0,
182
187
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
183
188
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
184
189
  * template_variables: {
@@ -190,6 +195,7 @@ export declare class Agents {
190
195
  * tools: ["keypad_input"],
191
196
  * no_input_poke_sec: 30,
192
197
  * no_input_poke_text: "Are you still there?",
198
+ * recognized_languages: ["en", "es"],
193
199
  * boosted_keywords: ["Load ID", "dispatch"],
194
200
  * configuration_endpoint: {
195
201
  * url: "https://api.example.com/config",
@@ -117,6 +117,7 @@ export class Agents {
117
117
  * timezone: "America/Los_Angeles",
118
118
  * voice_id: "grant",
119
119
  * audio_speed: 1,
120
+ * background_noise_level: 0,
120
121
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
121
122
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
122
123
  * template_variables: {
@@ -128,6 +129,7 @@ export class Agents {
128
129
  * tools: ["keypad_input"],
129
130
  * no_input_poke_sec: 30,
130
131
  * no_input_poke_text: "Are you still there?",
132
+ * recognized_languages: ["en", "es"],
131
133
  * boosted_keywords: ["Load ID", "dispatch"],
132
134
  * configuration_endpoint: {
133
135
  * url: "https://api.example.com/config",
@@ -218,6 +220,7 @@ export class Agents {
218
220
  * timezone: "America/Los_Angeles",
219
221
  * voice_id: "grant",
220
222
  * audio_speed: 1,
223
+ * background_noise_level: 0,
221
224
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
222
225
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
223
226
  * template_variables: {
@@ -229,6 +232,7 @@ export class Agents {
229
232
  * tools: ["keypad_input"],
230
233
  * no_input_poke_sec: 30,
231
234
  * no_input_poke_text: "Are you still there?",
235
+ * recognized_languages: ["en", "es"],
232
236
  * boosted_keywords: ["Load ID", "dispatch"],
233
237
  * configuration_endpoint: {
234
238
  * url: "https://api.example.com/config",
@@ -459,6 +463,7 @@ export class Agents {
459
463
  * timezone: "America/Los_Angeles",
460
464
  * voice_id: "grant",
461
465
  * audio_speed: 1,
466
+ * background_noise_level: 0,
462
467
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
463
468
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
464
469
  * template_variables: {
@@ -470,6 +475,7 @@ export class Agents {
470
475
  * tools: ["keypad_input"],
471
476
  * no_input_poke_sec: 30,
472
477
  * no_input_poke_text: "Are you still there?",
478
+ * recognized_languages: ["en", "es"],
473
479
  * boosted_keywords: ["Load ID", "dispatch"],
474
480
  * configuration_endpoint: {
475
481
  * url: "https://api.example.com/config",
@@ -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 AgentsCreateRequest {
46
48
  audio_format?: Phonic.CreateAgentRequest.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 AgentsCreateRequest {
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. */