phonic 0.30.7 → 0.30.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/README.md +4 -1
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agents/client/Client.d.ts +13 -4
  4. package/dist/cjs/api/resources/agents/client/Client.js +15 -8
  5. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +9 -4
  6. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +14 -6
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +2 -0
  8. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +4 -1
  9. package/dist/cjs/api/resources/conversations/client/Client.d.ts +2 -1
  10. package/dist/cjs/api/resources/conversations/client/Client.js +4 -5
  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/resources/extractionSchemas/client/Client.d.ts +1 -1
  14. package/dist/cjs/api/resources/extractionSchemas/client/Client.js +3 -5
  15. package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
  16. package/dist/cjs/api/resources/projects/client/Client.js +3 -5
  17. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +1 -1
  18. package/dist/cjs/api/resources/tools/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/tools/client/Client.js +3 -5
  20. package/dist/cjs/api/resources/voices/client/Client.d.ts +1 -1
  21. package/dist/cjs/api/resources/voices/client/Client.js +3 -5
  22. package/dist/cjs/api/types/Agent.d.ts +10 -6
  23. package/dist/cjs/api/types/Agent.js +2 -0
  24. package/dist/cjs/api/types/ConfigPayload.d.ts +10 -4
  25. package/dist/cjs/api/types/ConfigPayload.js +4 -0
  26. package/dist/cjs/api/types/Conversation.d.ts +19 -6
  27. package/dist/cjs/api/types/Conversation.js +11 -0
  28. package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -1
  29. package/dist/cjs/api/types/ConversationItem.d.ts +13 -13
  30. package/dist/cjs/api/types/CreateAgentRequest.d.ts +10 -5
  31. package/dist/cjs/api/types/CreateAgentRequest.js +2 -0
  32. package/dist/cjs/api/types/ExtractionField.d.ts +1 -1
  33. package/dist/cjs/api/types/InputTextPayload.d.ts +2 -0
  34. package/dist/cjs/api/types/OutboundCallConfig.d.ts +4 -2
  35. package/dist/cjs/api/types/Project.d.ts +1 -1
  36. package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +8 -8
  37. package/dist/cjs/api/types/Voice.d.ts +1 -1
  38. package/dist/cjs/version.d.ts +1 -1
  39. package/dist/cjs/version.js +1 -1
  40. package/dist/esm/Client.mjs +2 -2
  41. package/dist/esm/api/resources/agents/client/Client.d.mts +13 -4
  42. package/dist/esm/api/resources/agents/client/Client.mjs +15 -8
  43. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +9 -4
  44. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +14 -6
  45. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +2 -0
  46. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +4 -1
  47. package/dist/esm/api/resources/conversations/client/Client.d.mts +2 -1
  48. package/dist/esm/api/resources/conversations/client/Client.mjs +4 -5
  49. package/dist/esm/api/resources/conversations/client/Socket.d.mts +1 -1
  50. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -0
  51. package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +1 -1
  52. package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +3 -5
  53. package/dist/esm/api/resources/projects/client/Client.d.mts +1 -1
  54. package/dist/esm/api/resources/projects/client/Client.mjs +3 -5
  55. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +1 -1
  56. package/dist/esm/api/resources/tools/client/Client.d.mts +1 -1
  57. package/dist/esm/api/resources/tools/client/Client.mjs +3 -5
  58. package/dist/esm/api/resources/voices/client/Client.d.mts +1 -1
  59. package/dist/esm/api/resources/voices/client/Client.mjs +3 -5
  60. package/dist/esm/api/types/Agent.d.mts +10 -6
  61. package/dist/esm/api/types/Agent.mjs +2 -0
  62. package/dist/esm/api/types/ConfigPayload.d.mts +10 -4
  63. package/dist/esm/api/types/ConfigPayload.mjs +4 -0
  64. package/dist/esm/api/types/Conversation.d.mts +19 -6
  65. package/dist/esm/api/types/Conversation.mjs +10 -1
  66. package/dist/esm/api/types/ConversationExtraction.d.mts +1 -1
  67. package/dist/esm/api/types/ConversationItem.d.mts +13 -13
  68. package/dist/esm/api/types/CreateAgentRequest.d.mts +10 -5
  69. package/dist/esm/api/types/CreateAgentRequest.mjs +2 -0
  70. package/dist/esm/api/types/ExtractionField.d.mts +1 -1
  71. package/dist/esm/api/types/InputTextPayload.d.mts +2 -0
  72. package/dist/esm/api/types/OutboundCallConfig.d.mts +4 -2
  73. package/dist/esm/api/types/Project.d.mts +1 -1
  74. package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +8 -8
  75. package/dist/esm/api/types/Voice.d.mts +1 -1
  76. package/dist/esm/version.d.mts +1 -1
  77. package/dist/esm/version.mjs +1 -1
  78. package/package.json +2 -2
  79. package/reference.md +13 -3
@@ -6,17 +6,17 @@ export interface Conversation {
6
6
  /** The conversation ID. */
7
7
  id: string;
8
8
  /** The agent associated with the conversation. */
9
- agent?: Conversation.Agent;
9
+ agent: Conversation.Agent | null;
10
10
  /** The organization/workspace name. */
11
11
  workspace: string;
12
12
  /** The project associated with the conversation. */
13
13
  project: Conversation.Project;
14
14
  /** External ID for conversation tracking. */
15
- external_id?: string;
15
+ external_id: string | null;
16
16
  /** The STS model used. */
17
17
  model: string;
18
18
  /** Welcome message played at start. */
19
- welcome_message?: string;
19
+ welcome_message: string | null;
20
20
  /** Template variables used in the conversation. */
21
21
  template_variables: Record<string, string>;
22
22
  /** Audio input format. */
@@ -28,15 +28,17 @@ export interface Conversation {
28
28
  /** Live transcript of the conversation. */
29
29
  live_transcript: string;
30
30
  /** Post-call processed transcript. */
31
- post_call_transcript?: string;
31
+ post_call_transcript: string | null;
32
32
  /** Duration of the conversation in milliseconds. */
33
33
  duration_ms: number;
34
34
  /** Presigned URL to the conversation audio file. */
35
- audio_url?: string;
35
+ audio_url: string | null;
36
36
  /** When the conversation started. */
37
37
  started_at: string;
38
38
  /** When the conversation ended. */
39
- ended_at?: string;
39
+ ended_at: string | null;
40
+ /** Who or what ended the conversation. */
41
+ ended_by: Conversation.EndedBy | null;
40
42
  /** Array of conversation items (turns). */
41
43
  items: Phonic.ConversationItem[];
42
44
  /** Results from conversation evaluations and extractions. */
@@ -63,4 +65,15 @@ export declare namespace Conversation {
63
65
  /** The name of the project. */
64
66
  name: string;
65
67
  }
68
+ /**
69
+ * Who or what ended the conversation.
70
+ */
71
+ type EndedBy = "user" | "user_canceled" | "user_validation_failed" | "assistant" | "error";
72
+ const EndedBy: {
73
+ readonly User: "user";
74
+ readonly UserCanceled: "user_canceled";
75
+ readonly UserValidationFailed: "user_validation_failed";
76
+ readonly Assistant: "assistant";
77
+ readonly Error: "error";
78
+ };
66
79
  }
@@ -3,3 +3,14 @@
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Conversation = void 0;
7
+ var Conversation;
8
+ (function (Conversation) {
9
+ Conversation.EndedBy = {
10
+ User: "user",
11
+ UserCanceled: "user_canceled",
12
+ UserValidationFailed: "user_validation_failed",
13
+ Assistant: "assistant",
14
+ Error: "error",
15
+ };
16
+ })(Conversation || (exports.Conversation = Conversation = {}));
@@ -10,7 +10,7 @@ export interface ConversationExtraction {
10
10
  /** The extracted data. */
11
11
  result: Record<string, unknown>;
12
12
  /** Error message if extraction failed. */
13
- error?: string;
13
+ error: string | null;
14
14
  /** When the extraction was created. */
15
15
  created_at: string;
16
16
  }
@@ -9,7 +9,7 @@ export interface ConversationItem {
9
9
  /** Live transcript of this turn. */
10
10
  live_transcript: string;
11
11
  /** Post-call processed transcript. */
12
- post_call_transcript?: string;
12
+ post_call_transcript: string | null;
13
13
  /** Duration of this turn in milliseconds. */
14
14
  duration_ms: number;
15
15
  /** When this turn started. */
@@ -39,29 +39,29 @@ export declare namespace ConversationItem {
39
39
  id: string;
40
40
  tool: Item.Tool;
41
41
  /** HTTP method for webhook tool calls. */
42
- endpoint_method?: string;
42
+ endpoint_method?: string | null;
43
43
  /** URL for webhook tool calls. */
44
- endpoint_url?: string;
44
+ endpoint_url?: string | null;
45
45
  /** Headers for webhook tool calls. */
46
- endpoint_headers?: Record<string, string | undefined>;
46
+ endpoint_headers?: Record<string, string | null> | null;
47
47
  /** Timeout in milliseconds for webhook tool calls. */
48
- endpoint_timeout_ms?: number;
48
+ endpoint_timeout_ms?: number | null;
49
49
  /** When the webhook endpoint was called (null on error). */
50
- endpoint_called_at?: string;
50
+ endpoint_called_at?: string | null;
51
51
  /** Query parameters for webhook tool calls (null on error or when no params). */
52
- query_params?: Record<string, unknown>;
52
+ query_params?: Record<string, unknown> | null;
53
53
  /** HTTP response status code for webhook tool calls (null on error). */
54
- response_status_code?: number;
54
+ response_status_code?: number | null;
55
55
  /** Timeout in milliseconds for websocket tool calls. */
56
- tool_call_output_timeout_ms?: number;
56
+ tool_call_output_timeout_ms?: number | null;
57
57
  /** The request body sent to the tool. */
58
- request_body?: Record<string, unknown>;
58
+ request_body: Record<string, unknown> | null;
59
59
  /** The response body received from the tool. */
60
- response_body?: Record<string, unknown>;
60
+ response_body: Record<string, unknown> | null;
61
61
  /** Whether the tool call timed out. */
62
- timed_out?: boolean;
62
+ timed_out: boolean | null;
63
63
  /** Error message if the tool call failed. */
64
- error_message?: string;
64
+ error_message: string | null;
65
65
  }
66
66
  namespace Item {
67
67
  interface Tool {
@@ -5,7 +5,7 @@ import * as Phonic from "../index.js";
5
5
  export interface CreateAgentRequest {
6
6
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
7
7
  name: string;
8
- phone_number?: "assign-automatically";
8
+ phone_number?: "assign-automatically" | null;
9
9
  /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
10
10
  timezone?: string;
11
11
  /** The voice ID to use. */
@@ -27,28 +27,33 @@ export interface CreateAgentRequest {
27
27
  /** Array of task objects with `name` and `description` fields. */
28
28
  tasks?: Phonic.Task[];
29
29
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
30
- no_input_poke_sec?: number;
30
+ no_input_poke_sec?: number | null;
31
31
  /** The message to send after the specified silence. */
32
32
  no_input_poke_text?: string;
33
33
  /** Seconds of silence before ending the conversation. */
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. */
38
- configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint;
40
+ configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null;
39
41
  }
40
42
  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" | "pcm_8000" | "mulaw_8000";
45
47
  const AudioFormat: {
46
48
  readonly Pcm44100: "pcm_44100";
49
+ readonly Pcm16000: "pcm_16000";
50
+ readonly Pcm8000: "pcm_8000";
47
51
  readonly Mulaw8000: "mulaw_8000";
48
52
  };
49
53
  namespace TemplateVariables {
50
54
  interface Value {
51
- default_value?: string;
55
+ default_value: string | null;
56
+ is_boosted_keyword?: boolean;
52
57
  }
53
58
  }
54
59
  type Tools = Tools.Item[];
@@ -8,6 +8,8 @@ var CreateAgentRequest;
8
8
  (function (CreateAgentRequest) {
9
9
  CreateAgentRequest.AudioFormat = {
10
10
  Pcm44100: "pcm_44100",
11
+ Pcm16000: "pcm_16000",
12
+ Pcm8000: "pcm_8000",
11
13
  Mulaw8000: "mulaw_8000",
12
14
  };
13
15
  })(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
@@ -7,7 +7,7 @@ export interface ExtractionField {
7
7
  /** The field type. */
8
8
  type: ExtractionField.Type;
9
9
  /** Description of the field. */
10
- description?: string;
10
+ description?: string | null;
11
11
  }
12
12
  export declare namespace ExtractionField {
13
13
  /**
@@ -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
  }
@@ -10,7 +10,7 @@ export interface OutboundCallConfig {
10
10
  /** The name of the project to use for the call. */
11
11
  project?: string;
12
12
  /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
13
- welcome_message?: string;
13
+ welcome_message?: string | null;
14
14
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
15
15
  system_prompt?: string;
16
16
  /** Variables that can be used in the welcome message and the system prompt. */
@@ -18,11 +18,13 @@ export interface OutboundCallConfig {
18
18
  /** The voice ID to use for the agent. */
19
19
  voice_id?: string;
20
20
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
21
- no_input_poke_sec?: number;
21
+ no_input_poke_sec?: number | null;
22
22
  /** The message to send after the specified silence. */
23
23
  no_input_poke_text?: string;
24
24
  /** Seconds of silence before ending the conversation. */
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. */
@@ -7,7 +7,7 @@ export interface Project {
7
7
  /** The name of the project. */
8
8
  name: string;
9
9
  /** The project's default agent. */
10
- default_agent?: Project.DefaultAgent;
10
+ default_agent: Project.DefaultAgent | null;
11
11
  }
12
12
  export declare namespace Project {
13
13
  /**
@@ -7,23 +7,23 @@ export interface ToolCallOutputProcessedPayload {
7
7
  tool_call_id: string;
8
8
  tool: ToolCallOutputProcessedPayload.Tool;
9
9
  /** Webhook endpoint URL (null for WebSocket tools) */
10
- endpoint_url?: string;
10
+ endpoint_url?: string | null;
11
11
  /** Webhook timeout in milliseconds (null for WebSocket tools) */
12
- endpoint_timeout_ms?: number;
12
+ endpoint_timeout_ms?: number | null;
13
13
  /** When webhook was called (null for WebSocket tools) */
14
- endpoint_called_at?: string;
14
+ endpoint_called_at?: string | null;
15
15
  /** Webhook request body (null for WebSocket tools) */
16
- request_body?: Record<string, unknown>;
16
+ request_body?: Record<string, unknown> | null;
17
17
  response_body?: unknown;
18
18
  /** WebSocket tool parameters (null for webhook tools) */
19
- parameters?: Record<string, unknown>;
19
+ parameters?: Record<string, unknown> | null;
20
20
  output?: unknown;
21
21
  /** Webhook HTTP status code (null for WebSocket tools) */
22
- response_status_code?: number;
22
+ response_status_code?: number | null;
23
23
  /** Whether the tool call timed out */
24
- timed_out?: boolean;
24
+ timed_out?: boolean | null;
25
25
  /** Error message if tool call failed */
26
- error_message?: string;
26
+ error_message?: string | null;
27
27
  }
28
28
  export declare namespace ToolCallOutputProcessedPayload {
29
29
  interface Tool {
@@ -7,5 +7,5 @@ export interface Voice {
7
7
  /** The voice name. */
8
8
  name: string;
9
9
  /** The voice description. */
10
- description?: string;
10
+ description: string | null;
11
11
  }
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.7";
1
+ export declare const SDK_VERSION = "0.30.9";
@@ -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.7";
4
+ exports.SDK_VERSION = "0.30.9";
@@ -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.7",
18
- "User-Agent": "phonic/0.30.7",
17
+ "X-Fern-SDK-Version": "0.30.9",
18
+ "User-Agent": "phonic/0.30.9",
19
19
  "X-Fern-Runtime": core.RUNTIME.type,
20
20
  "X-Fern-Runtime-Version": core.RUNTIME.version,
21
21
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -67,7 +67,9 @@ export declare class Agents {
67
67
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
68
68
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
69
69
  * template_variables: {
70
- * "customer_name": {},
70
+ * "customer_name": {
71
+ * default_value: null
72
+ * },
71
73
  * "subject": {
72
74
  * default_value: "Chess"
73
75
  * }
@@ -75,6 +77,7 @@ export declare class Agents {
75
77
  * tools: ["keypad_input"],
76
78
  * no_input_poke_sec: 30,
77
79
  * no_input_poke_text: "Are you still there?",
80
+ * recognized_languages: ["en", "es"],
78
81
  * boosted_keywords: ["Load ID", "dispatch"],
79
82
  * configuration_endpoint: {
80
83
  * url: "https://api.example.com/config",
@@ -108,7 +111,9 @@ export declare class Agents {
108
111
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
109
112
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
110
113
  * template_variables: {
111
- * "customer_name": {},
114
+ * "customer_name": {
115
+ * default_value: null
116
+ * },
112
117
  * "subject": {
113
118
  * default_value: "Chess"
114
119
  * }
@@ -116,6 +121,7 @@ export declare class Agents {
116
121
  * tools: ["keypad_input"],
117
122
  * no_input_poke_sec: 30,
118
123
  * no_input_poke_text: "Are you still there?",
124
+ * recognized_languages: ["en", "es"],
119
125
  * boosted_keywords: ["Load ID", "dispatch"],
120
126
  * configuration_endpoint: {
121
127
  * url: "https://api.example.com/config",
@@ -185,7 +191,9 @@ export declare class Agents {
185
191
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
186
192
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
187
193
  * template_variables: {
188
- * "customer_name": {},
194
+ * "customer_name": {
195
+ * default_value: null
196
+ * },
189
197
  * "subject": {
190
198
  * default_value: "Chess"
191
199
  * }
@@ -193,6 +201,7 @@ export declare class Agents {
193
201
  * tools: ["keypad_input"],
194
202
  * no_input_poke_sec: 30,
195
203
  * no_input_poke_text: "Are you still there?",
204
+ * recognized_languages: ["en", "es"],
196
205
  * boosted_keywords: ["Load ID", "dispatch"],
197
206
  * configuration_endpoint: {
198
207
  * url: "https://api.example.com/config",
@@ -205,5 +214,5 @@ export declare class Agents {
205
214
  */
206
215
  update(nameOrId: string, request?: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
207
216
  private __update;
208
- protected _getAuthorizationHeader(): Promise<string>;
217
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
209
218
  }
@@ -121,7 +121,9 @@ export class Agents {
121
121
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
122
122
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
123
123
  * template_variables: {
124
- * "customer_name": {},
124
+ * "customer_name": {
125
+ * default_value: null
126
+ * },
125
127
  * "subject": {
126
128
  * default_value: "Chess"
127
129
  * }
@@ -129,6 +131,7 @@ export class Agents {
129
131
  * tools: ["keypad_input"],
130
132
  * no_input_poke_sec: 30,
131
133
  * no_input_poke_text: "Are you still there?",
134
+ * recognized_languages: ["en", "es"],
132
135
  * boosted_keywords: ["Load ID", "dispatch"],
133
136
  * configuration_endpoint: {
134
137
  * url: "https://api.example.com/config",
@@ -223,7 +226,9 @@ export class Agents {
223
226
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
224
227
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
225
228
  * template_variables: {
226
- * "customer_name": {},
229
+ * "customer_name": {
230
+ * default_value: null
231
+ * },
227
232
  * "subject": {
228
233
  * default_value: "Chess"
229
234
  * }
@@ -231,6 +236,7 @@ export class Agents {
231
236
  * tools: ["keypad_input"],
232
237
  * no_input_poke_sec: 30,
233
238
  * no_input_poke_text: "Are you still there?",
239
+ * recognized_languages: ["en", "es"],
234
240
  * boosted_keywords: ["Load ID", "dispatch"],
235
241
  * configuration_endpoint: {
236
242
  * url: "https://api.example.com/config",
@@ -465,7 +471,9 @@ export class Agents {
465
471
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
466
472
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
467
473
  * template_variables: {
468
- * "customer_name": {},
474
+ * "customer_name": {
475
+ * default_value: null
476
+ * },
469
477
  * "subject": {
470
478
  * default_value: "Chess"
471
479
  * }
@@ -473,6 +481,7 @@ export class Agents {
473
481
  * tools: ["keypad_input"],
474
482
  * no_input_poke_sec: 30,
475
483
  * no_input_poke_text: "Are you still there?",
484
+ * recognized_languages: ["en", "es"],
476
485
  * boosted_keywords: ["Load ID", "dispatch"],
477
486
  * configuration_endpoint: {
478
487
  * url: "https://api.example.com/config",
@@ -548,12 +557,10 @@ export class Agents {
548
557
  return __awaiter(this, void 0, void 0, function* () {
549
558
  var _a;
550
559
  const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
551
- if (bearer == null) {
552
- throw new errors.PhonicError({
553
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
554
- });
560
+ if (bearer != null) {
561
+ return `Bearer ${bearer}`;
555
562
  }
556
- return `Bearer ${bearer}`;
563
+ return undefined;
557
564
  });
558
565
  }
559
566
  }
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.mjs";
15
15
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
16
16
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
17
17
  * template_variables: {
18
- * "customer_name": {},
18
+ * "customer_name": {
19
+ * default_value: null
20
+ * },
19
21
  * "subject": {
20
22
  * default_value: "Chess"
21
23
  * }
@@ -23,6 +25,7 @@ import * as Phonic from "../../../../index.mjs";
23
25
  * tools: ["keypad_input"],
24
26
  * no_input_poke_sec: 30,
25
27
  * no_input_poke_text: "Are you still there?",
28
+ * recognized_languages: ["en", "es"],
26
29
  * boosted_keywords: ["Load ID", "dispatch"],
27
30
  * configuration_endpoint: {
28
31
  * url: "https://api.example.com/config",
@@ -38,7 +41,7 @@ export interface AgentsCreateRequest {
38
41
  project?: string;
39
42
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
40
43
  name: string;
41
- phone_number?: "assign-automatically";
44
+ phone_number?: "assign-automatically" | null;
42
45
  /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
43
46
  timezone?: string;
44
47
  /** The voice ID to use. */
@@ -60,13 +63,15 @@ export interface AgentsCreateRequest {
60
63
  /** Array of task objects with `name` and `description` fields. */
61
64
  tasks?: Phonic.Task[];
62
65
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
63
- no_input_poke_sec?: number;
66
+ no_input_poke_sec?: number | null;
64
67
  /** The message to send after the specified silence. */
65
68
  no_input_poke_text?: string;
66
69
  /** Seconds of silence before ending the conversation. */
67
70
  no_input_end_conversation_sec?: number;
71
+ /** Array of ISO 639-1 language codes that the agent should be able to recognize */
72
+ recognized_languages?: string[];
68
73
  /** These words, or short phrases, will be more accurately recognized by the agent. */
69
74
  boosted_keywords?: string[];
70
75
  /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
71
- configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint;
76
+ configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint | null;
72
77
  }
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.mjs";
15
15
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
16
16
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
17
17
  * template_variables: {
18
- * "customer_name": {},
18
+ * "customer_name": {
19
+ * default_value: null
20
+ * },
19
21
  * "subject": {
20
22
  * default_value: "Chess"
21
23
  * }
@@ -23,6 +25,7 @@ import * as Phonic from "../../../../index.mjs";
23
25
  * tools: ["keypad_input"],
24
26
  * no_input_poke_sec: 30,
25
27
  * no_input_poke_text: "Are you still there?",
28
+ * recognized_languages: ["en", "es"],
26
29
  * boosted_keywords: ["Load ID", "dispatch"],
27
30
  * configuration_endpoint: {
28
31
  * url: "https://api.example.com/config",
@@ -38,7 +41,7 @@ export interface UpdateAgentRequest {
38
41
  project?: string;
39
42
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
40
43
  name?: string;
41
- phone_number?: "assign-automatically";
44
+ phone_number?: "assign-automatically" | null;
42
45
  /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
43
46
  timezone?: string;
44
47
  /** The voice ID to use. */
@@ -60,28 +63,33 @@ export interface UpdateAgentRequest {
60
63
  /** Array of task objects with `name` and `description` fields. */
61
64
  tasks?: Phonic.Task[];
62
65
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
63
- no_input_poke_sec?: number;
66
+ no_input_poke_sec?: number | null;
64
67
  /** The message to send after the specified silence. */
65
68
  no_input_poke_text?: string;
66
69
  /** Seconds of silence before ending the conversation. */
67
70
  no_input_end_conversation_sec?: number;
71
+ /** Array of ISO 639-1 language codes that the agent should be able to recognize */
72
+ recognized_languages?: string[];
68
73
  /** These words, or short phrases, will be more accurately recognized by the agent. */
69
74
  boosted_keywords?: string[];
70
75
  /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
71
- configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint;
76
+ configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint | null;
72
77
  }
73
78
  export declare namespace UpdateAgentRequest {
74
79
  /**
75
80
  * The audio format of the agent.
76
81
  */
77
- type AudioFormat = "pcm_44100" | "mulaw_8000";
82
+ type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
78
83
  const AudioFormat: {
79
84
  readonly Pcm44100: "pcm_44100";
85
+ readonly Pcm16000: "pcm_16000";
86
+ readonly Pcm8000: "pcm_8000";
80
87
  readonly Mulaw8000: "mulaw_8000";
81
88
  };
82
89
  namespace TemplateVariables {
83
90
  interface Value {
84
- default_value?: string;
91
+ default_value: string | null;
92
+ is_boosted_keyword?: boolean;
85
93
  }
86
94
  }
87
95
  type Tools = Tools.Item[];
@@ -5,6 +5,8 @@ export var UpdateAgentRequest;
5
5
  (function (UpdateAgentRequest) {
6
6
  UpdateAgentRequest.AudioFormat = {
7
7
  Pcm44100: "pcm_44100",
8
+ Pcm16000: "pcm_16000",
9
+ Pcm8000: "pcm_8000",
8
10
  Mulaw8000: "mulaw_8000",
9
11
  };
10
12
  })(UpdateAgentRequest || (UpdateAgentRequest = {}));
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.mjs";
15
15
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
16
16
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
17
17
  * template_variables: {
18
- * "customer_name": {},
18
+ * "customer_name": {
19
+ * default_value: null
20
+ * },
19
21
  * "subject": {
20
22
  * default_value: "Chess"
21
23
  * }
@@ -23,6 +25,7 @@ import * as Phonic from "../../../../index.mjs";
23
25
  * tools: ["keypad_input"],
24
26
  * no_input_poke_sec: 30,
25
27
  * no_input_poke_text: "Are you still there?",
28
+ * recognized_languages: ["en", "es"],
26
29
  * boosted_keywords: ["Load ID", "dispatch"],
27
30
  * configuration_endpoint: {
28
31
  * 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
  * }
@@ -232,5 +233,5 @@ export declare class Conversations {
232
233
  sipOutboundCall(request: Phonic.ConversationsSipOutboundCallRequest, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsSipOutboundCallResponse>;
233
234
  private __sipOutboundCall;
234
235
  connect(args?: Conversations.ConnectArgs): Promise<ConversationsSocket>;
235
- protected _getAuthorizationHeader(): Promise<string>;
236
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
236
237
  }
@@ -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
  * }
@@ -856,12 +857,10 @@ export class Conversations {
856
857
  return __awaiter(this, void 0, void 0, function* () {
857
858
  var _a;
858
859
  const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["PHONIC_API_KEY"];
859
- if (bearer == null) {
860
- throw new errors.PhonicError({
861
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
862
- });
860
+ if (bearer != null) {
861
+ return `Bearer ${bearer}`;
863
862
  }
864
- return `Bearer ${bearer}`;
863
+ return undefined;
865
864
  });
866
865
  }
867
866
  }
@@ -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;