phonic 0.30.8 → 0.30.10

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 (83) hide show
  1. package/README.md +4 -2
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agents/client/Client.d.ts +13 -7
  4. package/dist/cjs/api/resources/agents/client/Client.js +15 -11
  5. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +8 -6
  6. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +11 -8
  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 +4 -2
  9. package/dist/cjs/api/resources/conversations/client/Client.d.ts +2 -2
  10. package/dist/cjs/api/resources/conversations/client/Client.js +4 -6
  11. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -1
  12. package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +1 -1
  13. package/dist/cjs/api/resources/extractionSchemas/client/Client.js +3 -5
  14. package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
  15. package/dist/cjs/api/resources/projects/client/Client.js +3 -5
  16. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +1 -1
  17. package/dist/cjs/api/resources/tools/client/Client.d.ts +1 -1
  18. package/dist/cjs/api/resources/tools/client/Client.js +3 -5
  19. package/dist/cjs/api/resources/voices/client/Client.d.ts +1 -1
  20. package/dist/cjs/api/resources/voices/client/Client.js +3 -5
  21. package/dist/cjs/api/types/Agent.d.ts +8 -7
  22. package/dist/cjs/api/types/Agent.js +1 -0
  23. package/dist/cjs/api/types/ConfigPayload.d.ts +6 -4
  24. package/dist/cjs/api/types/ConfigPayload.js +2 -0
  25. package/dist/cjs/api/types/Conversation.d.ts +30 -9
  26. package/dist/cjs/api/types/Conversation.js +11 -0
  27. package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -1
  28. package/dist/cjs/api/types/ConversationItem.d.ts +13 -13
  29. package/dist/cjs/api/types/CreateAgentRequest.d.ts +7 -6
  30. package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
  31. package/dist/cjs/api/types/ExtractionField.d.ts +1 -1
  32. package/dist/cjs/api/types/LanguageCode.d.ts +28 -0
  33. package/dist/cjs/api/types/LanguageCode.js +27 -0
  34. package/dist/cjs/api/types/OutboundCallConfig.d.ts +4 -3
  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/api/types/index.d.ts +1 -0
  39. package/dist/cjs/api/types/index.js +1 -0
  40. package/dist/cjs/version.d.ts +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/esm/Client.mjs +2 -2
  43. package/dist/esm/api/resources/agents/client/Client.d.mts +13 -7
  44. package/dist/esm/api/resources/agents/client/Client.mjs +15 -11
  45. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +8 -6
  46. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +11 -8
  47. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
  48. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +4 -2
  49. package/dist/esm/api/resources/conversations/client/Client.d.mts +2 -2
  50. package/dist/esm/api/resources/conversations/client/Client.mjs +4 -6
  51. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -1
  52. package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +1 -1
  53. package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +3 -5
  54. package/dist/esm/api/resources/projects/client/Client.d.mts +1 -1
  55. package/dist/esm/api/resources/projects/client/Client.mjs +3 -5
  56. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +1 -1
  57. package/dist/esm/api/resources/tools/client/Client.d.mts +1 -1
  58. package/dist/esm/api/resources/tools/client/Client.mjs +3 -5
  59. package/dist/esm/api/resources/voices/client/Client.d.mts +1 -1
  60. package/dist/esm/api/resources/voices/client/Client.mjs +3 -5
  61. package/dist/esm/api/types/Agent.d.mts +8 -7
  62. package/dist/esm/api/types/Agent.mjs +1 -0
  63. package/dist/esm/api/types/ConfigPayload.d.mts +6 -4
  64. package/dist/esm/api/types/ConfigPayload.mjs +2 -0
  65. package/dist/esm/api/types/Conversation.d.mts +30 -9
  66. package/dist/esm/api/types/Conversation.mjs +10 -1
  67. package/dist/esm/api/types/ConversationExtraction.d.mts +1 -1
  68. package/dist/esm/api/types/ConversationItem.d.mts +13 -13
  69. package/dist/esm/api/types/CreateAgentRequest.d.mts +7 -6
  70. package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
  71. package/dist/esm/api/types/ExtractionField.d.mts +1 -1
  72. package/dist/esm/api/types/LanguageCode.d.mts +28 -0
  73. package/dist/esm/api/types/LanguageCode.mjs +24 -0
  74. package/dist/esm/api/types/OutboundCallConfig.d.mts +4 -3
  75. package/dist/esm/api/types/Project.d.mts +1 -1
  76. package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +8 -8
  77. package/dist/esm/api/types/Voice.d.mts +1 -1
  78. package/dist/esm/api/types/index.d.mts +1 -0
  79. package/dist/esm/api/types/index.mjs +1 -0
  80. package/dist/esm/version.d.mts +1 -1
  81. package/dist/esm/version.mjs +1 -1
  82. package/package.json +2 -2
  83. package/reference.md +13 -7
@@ -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,21 +28,31 @@ 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
40
  /** Who or what ended the conversation. */
41
- ended_by?: string;
42
- /** Array of conversation items (turns). */
43
- items: Phonic.ConversationItem[];
41
+ ended_by: Conversation.EndedBy | null;
42
+ /** These words, or short phrases, are more accurately recognized by the model. */
43
+ boosted_keywords: string[] | null;
44
+ /** Array of ISO 639-1 language codes recognized by the model. */
45
+ languages: string[] | null;
46
+ /** Number of seconds of silence before a poke message is sent. `null` means the poke message is disabled. */
47
+ no_input_poke_sec: number | null;
48
+ /** The message to send after the specified silence. Relevant only if `no_input_poke_sec` is not `null`. */
49
+ no_input_poke_text: string | null;
50
+ /** Seconds of silence before the conversation is ended. */
51
+ no_input_end_conversation_sec: number | null;
44
52
  /** Results from conversation evaluations and extractions. */
45
53
  task_results: Record<string, unknown>;
54
+ /** Array of conversation items (turns). */
55
+ items: Phonic.ConversationItem[];
46
56
  }
47
57
  export declare namespace Conversation {
48
58
  /**
@@ -65,4 +75,15 @@ export declare namespace Conversation {
65
75
  /** The name of the project. */
66
76
  name: string;
67
77
  }
78
+ /**
79
+ * Who or what ended the conversation.
80
+ */
81
+ type EndedBy = "user" | "user_canceled" | "user_validation_failed" | "assistant" | "error";
82
+ const EndedBy: {
83
+ readonly User: "user";
84
+ readonly UserCanceled: "user_canceled";
85
+ readonly UserValidationFailed: "user_validation_failed";
86
+ readonly Assistant: "assistant";
87
+ readonly Error: "error";
88
+ };
68
89
  }
@@ -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,31 +27,32 @@ 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
35
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
36
- recognized_languages?: string[];
36
+ languages?: Phonic.LanguageCode[];
37
37
  /** These words, or short phrases, will be more accurately recognized by the agent. */
38
38
  boosted_keywords?: string[];
39
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. */
40
- configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint;
40
+ configuration_endpoint?: CreateAgentRequest.ConfigurationEndpoint | null;
41
41
  }
42
42
  export declare namespace CreateAgentRequest {
43
43
  /**
44
44
  * The audio format of the agent.
45
45
  */
46
- type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
46
+ type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
47
47
  const AudioFormat: {
48
48
  readonly Pcm44100: "pcm_44100";
49
49
  readonly Pcm16000: "pcm_16000";
50
+ readonly Pcm8000: "pcm_8000";
50
51
  readonly Mulaw8000: "mulaw_8000";
51
52
  };
52
53
  namespace TemplateVariables {
53
54
  interface Value {
54
- default_value?: string;
55
+ default_value: string | null;
55
56
  is_boosted_keyword?: boolean;
56
57
  }
57
58
  }
@@ -9,6 +9,7 @@ var CreateAgentRequest;
9
9
  CreateAgentRequest.AudioFormat = {
10
10
  Pcm44100: "pcm_44100",
11
11
  Pcm16000: "pcm_16000",
12
+ Pcm8000: "pcm_8000",
12
13
  Mulaw8000: "mulaw_8000",
13
14
  };
14
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
  /**
@@ -0,0 +1,28 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * ISO 639-1 language codes supported by the agent
6
+ */
7
+ export type LanguageCode = "ar" | "zh" | "cs" | "da" | "nl" | "en" | "fr" | "de" | "id" | "it" | "ja" | "ko" | "pl" | "pt" | "ru" | "es" | "sv" | "tr" | "vi";
8
+ export declare const LanguageCode: {
9
+ readonly Ar: "ar";
10
+ readonly Zh: "zh";
11
+ readonly Cs: "cs";
12
+ readonly Da: "da";
13
+ readonly Nl: "nl";
14
+ readonly En: "en";
15
+ readonly Fr: "fr";
16
+ readonly De: "de";
17
+ readonly Id: "id";
18
+ readonly It: "it";
19
+ readonly Ja: "ja";
20
+ readonly Ko: "ko";
21
+ readonly Pl: "pl";
22
+ readonly Pt: "pt";
23
+ readonly Ru: "ru";
24
+ readonly Es: "es";
25
+ readonly Sv: "sv";
26
+ readonly Tr: "tr";
27
+ readonly Vi: "vi";
28
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LanguageCode = void 0;
7
+ exports.LanguageCode = {
8
+ Ar: "ar",
9
+ Zh: "zh",
10
+ Cs: "cs",
11
+ Da: "da",
12
+ Nl: "nl",
13
+ En: "en",
14
+ Fr: "fr",
15
+ De: "de",
16
+ Id: "id",
17
+ It: "it",
18
+ Ja: "ja",
19
+ Ko: "ko",
20
+ Pl: "pl",
21
+ Pt: "pt",
22
+ Ru: "ru",
23
+ Es: "es",
24
+ Sv: "sv",
25
+ Tr: "tr",
26
+ Vi: "vi",
27
+ };
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
+ import * as Phonic from "../index.js";
4
5
  /**
5
6
  * When an `agent` is provided, these `config` options override the agent settings.
6
7
  */
@@ -10,7 +11,7 @@ export interface OutboundCallConfig {
10
11
  /** The name of the project to use for the call. */
11
12
  project?: string;
12
13
  /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
13
- welcome_message?: string;
14
+ welcome_message?: string | null;
14
15
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
15
16
  system_prompt?: string;
16
17
  /** Variables that can be used in the welcome message and the system prompt. */
@@ -18,13 +19,13 @@ export interface OutboundCallConfig {
18
19
  /** The voice ID to use for the agent. */
19
20
  voice_id?: string;
20
21
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
21
- no_input_poke_sec?: number;
22
+ no_input_poke_sec?: number | null;
22
23
  /** The message to send after the specified silence. */
23
24
  no_input_poke_text?: string;
24
25
  /** Seconds of silence before ending the conversation. */
25
26
  no_input_end_conversation_sec?: number;
26
27
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
27
- recognized_languages?: string[];
28
+ languages?: Phonic.LanguageCode[];
28
29
  /** These words, or short phrases, will be more accurately recognized by the agent. */
29
30
  boosted_keywords?: string[];
30
31
  /** 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
  }
@@ -2,6 +2,7 @@ export * from "./BadRequestErrorBody.js";
2
2
  export * from "./Error_.js";
3
3
  export * from "./BasicError.js";
4
4
  export * from "./ValidationError.js";
5
+ export * from "./LanguageCode.js";
5
6
  export * from "./Agent.js";
6
7
  export * from "./CreateAgentRequest.js";
7
8
  export * from "./Tool.js";
@@ -18,6 +18,7 @@ __exportStar(require("./BadRequestErrorBody.js"), exports);
18
18
  __exportStar(require("./Error_.js"), exports);
19
19
  __exportStar(require("./BasicError.js"), exports);
20
20
  __exportStar(require("./ValidationError.js"), exports);
21
+ __exportStar(require("./LanguageCode.js"), exports);
21
22
  __exportStar(require("./Agent.js"), exports);
22
23
  __exportStar(require("./CreateAgentRequest.js"), exports);
23
24
  __exportStar(require("./Tool.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.8";
1
+ export declare const SDK_VERSION = "0.30.10";
@@ -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.8";
4
+ exports.SDK_VERSION = "0.30.10";
@@ -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.8",
18
- "User-Agent": "phonic/0.30.8",
17
+ "X-Fern-SDK-Version": "0.30.10",
18
+ "User-Agent": "phonic/0.30.10",
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,7 +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?",
78
- * recognized_languages: ["en", "es"],
80
+ * languages: ["en", "es"],
79
81
  * boosted_keywords: ["Load ID", "dispatch"],
80
82
  * configuration_endpoint: {
81
83
  * url: "https://api.example.com/config",
@@ -109,7 +111,9 @@ export declare class Agents {
109
111
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
110
112
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
111
113
  * template_variables: {
112
- * "customer_name": {},
114
+ * "customer_name": {
115
+ * default_value: null
116
+ * },
113
117
  * "subject": {
114
118
  * default_value: "Chess"
115
119
  * }
@@ -117,7 +121,7 @@ export declare class Agents {
117
121
  * tools: ["keypad_input"],
118
122
  * no_input_poke_sec: 30,
119
123
  * no_input_poke_text: "Are you still there?",
120
- * recognized_languages: ["en", "es"],
124
+ * languages: ["en", "es"],
121
125
  * boosted_keywords: ["Load ID", "dispatch"],
122
126
  * configuration_endpoint: {
123
127
  * url: "https://api.example.com/config",
@@ -187,7 +191,9 @@ export declare class Agents {
187
191
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
188
192
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
189
193
  * template_variables: {
190
- * "customer_name": {},
194
+ * "customer_name": {
195
+ * default_value: null
196
+ * },
191
197
  * "subject": {
192
198
  * default_value: "Chess"
193
199
  * }
@@ -195,7 +201,7 @@ export declare class Agents {
195
201
  * tools: ["keypad_input"],
196
202
  * no_input_poke_sec: 30,
197
203
  * no_input_poke_text: "Are you still there?",
198
- * recognized_languages: ["en", "es"],
204
+ * languages: ["en", "es"],
199
205
  * boosted_keywords: ["Load ID", "dispatch"],
200
206
  * configuration_endpoint: {
201
207
  * url: "https://api.example.com/config",
@@ -208,5 +214,5 @@ export declare class Agents {
208
214
  */
209
215
  update(nameOrId: string, request?: Phonic.UpdateAgentRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Phonic.AgentsUpdateResponse>;
210
216
  private __update;
211
- protected _getAuthorizationHeader(): Promise<string>;
217
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
212
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,7 +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?",
132
- * recognized_languages: ["en", "es"],
134
+ * languages: ["en", "es"],
133
135
  * boosted_keywords: ["Load ID", "dispatch"],
134
136
  * configuration_endpoint: {
135
137
  * url: "https://api.example.com/config",
@@ -224,7 +226,9 @@ export class Agents {
224
226
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
225
227
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
226
228
  * template_variables: {
227
- * "customer_name": {},
229
+ * "customer_name": {
230
+ * default_value: null
231
+ * },
228
232
  * "subject": {
229
233
  * default_value: "Chess"
230
234
  * }
@@ -232,7 +236,7 @@ export class Agents {
232
236
  * tools: ["keypad_input"],
233
237
  * no_input_poke_sec: 30,
234
238
  * no_input_poke_text: "Are you still there?",
235
- * recognized_languages: ["en", "es"],
239
+ * languages: ["en", "es"],
236
240
  * boosted_keywords: ["Load ID", "dispatch"],
237
241
  * configuration_endpoint: {
238
242
  * url: "https://api.example.com/config",
@@ -467,7 +471,9 @@ export class Agents {
467
471
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
468
472
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
469
473
  * template_variables: {
470
- * "customer_name": {},
474
+ * "customer_name": {
475
+ * default_value: null
476
+ * },
471
477
  * "subject": {
472
478
  * default_value: "Chess"
473
479
  * }
@@ -475,7 +481,7 @@ export class Agents {
475
481
  * tools: ["keypad_input"],
476
482
  * no_input_poke_sec: 30,
477
483
  * no_input_poke_text: "Are you still there?",
478
- * recognized_languages: ["en", "es"],
484
+ * languages: ["en", "es"],
479
485
  * boosted_keywords: ["Load ID", "dispatch"],
480
486
  * configuration_endpoint: {
481
487
  * url: "https://api.example.com/config",
@@ -551,12 +557,10 @@ export class Agents {
551
557
  return __awaiter(this, void 0, void 0, function* () {
552
558
  var _a;
553
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"];
554
- if (bearer == null) {
555
- throw new errors.PhonicError({
556
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
557
- });
560
+ if (bearer != null) {
561
+ return `Bearer ${bearer}`;
558
562
  }
559
- return `Bearer ${bearer}`;
563
+ return undefined;
560
564
  });
561
565
  }
562
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,7 +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?",
26
- * recognized_languages: ["en", "es"],
28
+ * languages: ["en", "es"],
27
29
  * boosted_keywords: ["Load ID", "dispatch"],
28
30
  * configuration_endpoint: {
29
31
  * url: "https://api.example.com/config",
@@ -39,7 +41,7 @@ export interface AgentsCreateRequest {
39
41
  project?: string;
40
42
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
41
43
  name: string;
42
- phone_number?: "assign-automatically";
44
+ phone_number?: "assign-automatically" | null;
43
45
  /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
44
46
  timezone?: string;
45
47
  /** The voice ID to use. */
@@ -61,15 +63,15 @@ export interface AgentsCreateRequest {
61
63
  /** Array of task objects with `name` and `description` fields. */
62
64
  tasks?: Phonic.Task[];
63
65
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
64
- no_input_poke_sec?: number;
66
+ no_input_poke_sec?: number | null;
65
67
  /** The message to send after the specified silence. */
66
68
  no_input_poke_text?: string;
67
69
  /** Seconds of silence before ending the conversation. */
68
70
  no_input_end_conversation_sec?: number;
69
71
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
70
- recognized_languages?: string[];
72
+ languages?: Phonic.LanguageCode[];
71
73
  /** These words, or short phrases, will be more accurately recognized by the agent. */
72
74
  boosted_keywords?: string[];
73
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. */
74
- configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint;
76
+ configuration_endpoint?: Phonic.CreateAgentRequest.ConfigurationEndpoint | null;
75
77
  }