phonic 0.30.8 → 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 (73) hide show
  1. package/README.md +3 -1
  2. package/dist/cjs/Client.js +2 -2
  3. package/dist/cjs/api/resources/agents/client/Client.d.ts +10 -4
  4. package/dist/cjs/api/resources/agents/client/Client.js +12 -8
  5. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +6 -4
  6. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +9 -6
  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 +3 -1
  9. package/dist/cjs/api/resources/conversations/client/Client.d.ts +1 -1
  10. package/dist/cjs/api/resources/conversations/client/Client.js +3 -5
  11. package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +1 -1
  12. package/dist/cjs/api/resources/extractionSchemas/client/Client.js +3 -5
  13. package/dist/cjs/api/resources/projects/client/Client.d.ts +1 -1
  14. package/dist/cjs/api/resources/projects/client/Client.js +3 -5
  15. package/dist/cjs/api/resources/projects/client/requests/UpdateProjectRequest.d.ts +1 -1
  16. package/dist/cjs/api/resources/tools/client/Client.d.ts +1 -1
  17. package/dist/cjs/api/resources/tools/client/Client.js +3 -5
  18. package/dist/cjs/api/resources/voices/client/Client.d.ts +1 -1
  19. package/dist/cjs/api/resources/voices/client/Client.js +3 -5
  20. package/dist/cjs/api/types/Agent.d.ts +7 -6
  21. package/dist/cjs/api/types/Agent.js +1 -0
  22. package/dist/cjs/api/types/ConfigPayload.d.ts +6 -4
  23. package/dist/cjs/api/types/ConfigPayload.js +2 -0
  24. package/dist/cjs/api/types/Conversation.d.ts +18 -7
  25. package/dist/cjs/api/types/Conversation.js +11 -0
  26. package/dist/cjs/api/types/ConversationExtraction.d.ts +1 -1
  27. package/dist/cjs/api/types/ConversationItem.d.ts +13 -13
  28. package/dist/cjs/api/types/CreateAgentRequest.d.ts +6 -5
  29. package/dist/cjs/api/types/CreateAgentRequest.js +1 -0
  30. package/dist/cjs/api/types/ExtractionField.d.ts +1 -1
  31. package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -2
  32. package/dist/cjs/api/types/Project.d.ts +1 -1
  33. package/dist/cjs/api/types/ToolCallOutputProcessedPayload.d.ts +8 -8
  34. package/dist/cjs/api/types/Voice.d.ts +1 -1
  35. package/dist/cjs/version.d.ts +1 -1
  36. package/dist/cjs/version.js +1 -1
  37. package/dist/esm/Client.mjs +2 -2
  38. package/dist/esm/api/resources/agents/client/Client.d.mts +10 -4
  39. package/dist/esm/api/resources/agents/client/Client.mjs +12 -8
  40. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +6 -4
  41. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +9 -6
  42. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +1 -0
  43. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +3 -1
  44. package/dist/esm/api/resources/conversations/client/Client.d.mts +1 -1
  45. package/dist/esm/api/resources/conversations/client/Client.mjs +3 -5
  46. package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +1 -1
  47. package/dist/esm/api/resources/extractionSchemas/client/Client.mjs +3 -5
  48. package/dist/esm/api/resources/projects/client/Client.d.mts +1 -1
  49. package/dist/esm/api/resources/projects/client/Client.mjs +3 -5
  50. package/dist/esm/api/resources/projects/client/requests/UpdateProjectRequest.d.mts +1 -1
  51. package/dist/esm/api/resources/tools/client/Client.d.mts +1 -1
  52. package/dist/esm/api/resources/tools/client/Client.mjs +3 -5
  53. package/dist/esm/api/resources/voices/client/Client.d.mts +1 -1
  54. package/dist/esm/api/resources/voices/client/Client.mjs +3 -5
  55. package/dist/esm/api/types/Agent.d.mts +7 -6
  56. package/dist/esm/api/types/Agent.mjs +1 -0
  57. package/dist/esm/api/types/ConfigPayload.d.mts +6 -4
  58. package/dist/esm/api/types/ConfigPayload.mjs +2 -0
  59. package/dist/esm/api/types/Conversation.d.mts +18 -7
  60. package/dist/esm/api/types/Conversation.mjs +10 -1
  61. package/dist/esm/api/types/ConversationExtraction.d.mts +1 -1
  62. package/dist/esm/api/types/ConversationItem.d.mts +13 -13
  63. package/dist/esm/api/types/CreateAgentRequest.d.mts +6 -5
  64. package/dist/esm/api/types/CreateAgentRequest.mjs +1 -0
  65. package/dist/esm/api/types/ExtractionField.d.mts +1 -1
  66. package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -2
  67. package/dist/esm/api/types/Project.d.mts +1 -1
  68. package/dist/esm/api/types/ToolCallOutputProcessedPayload.d.mts +8 -8
  69. package/dist/esm/api/types/Voice.d.mts +1 -1
  70. package/dist/esm/version.d.mts +1 -1
  71. package/dist/esm/version.mjs +1 -1
  72. package/package.json +2 -2
  73. package/reference.md +9 -3
package/README.md CHANGED
@@ -34,7 +34,9 @@ await client.agents.create({
34
34
  welcome_message: "Hi {{customer_name}}. How can I help you today?",
35
35
  system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
36
36
  template_variables: {
37
- customer_name: {},
37
+ customer_name: {
38
+ default_value: null,
39
+ },
38
40
  subject: {
39
41
  default_value: "Chess",
40
42
  },
@@ -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.8",
54
- "User-Agent": "phonic/0.30.8",
53
+ "X-Fern-SDK-Version": "0.30.9",
54
+ "User-Agent": "phonic/0.30.9",
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) });
@@ -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
  * }
@@ -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
  * }
@@ -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
  * }
@@ -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
  }
@@ -157,7 +157,9 @@ class Agents {
157
157
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
158
158
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
159
159
  * template_variables: {
160
- * "customer_name": {},
160
+ * "customer_name": {
161
+ * default_value: null
162
+ * },
161
163
  * "subject": {
162
164
  * default_value: "Chess"
163
165
  * }
@@ -260,7 +262,9 @@ class Agents {
260
262
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
261
263
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
262
264
  * template_variables: {
263
- * "customer_name": {},
265
+ * "customer_name": {
266
+ * default_value: null
267
+ * },
264
268
  * "subject": {
265
269
  * default_value: "Chess"
266
270
  * }
@@ -503,7 +507,9 @@ class Agents {
503
507
  * welcome_message: "Hi {{customer_name}}. How can I help you today?",
504
508
  * system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
505
509
  * template_variables: {
506
- * "customer_name": {},
510
+ * "customer_name": {
511
+ * default_value: null
512
+ * },
507
513
  * "subject": {
508
514
  * default_value: "Chess"
509
515
  * }
@@ -587,12 +593,10 @@ class Agents {
587
593
  return __awaiter(this, void 0, void 0, function* () {
588
594
  var _a;
589
595
  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"];
590
- if (bearer == null) {
591
- throw new errors.PhonicError({
592
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
593
- });
596
+ if (bearer != null) {
597
+ return `Bearer ${bearer}`;
594
598
  }
595
- return `Bearer ${bearer}`;
599
+ return undefined;
596
600
  });
597
601
  }
598
602
  }
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
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
  * }
@@ -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,7 +63,7 @@ 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. */
@@ -71,5 +73,5 @@ export interface AgentsCreateRequest {
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
  }
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
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
  * }
@@ -39,7 +41,7 @@ export interface UpdateAgentRequest {
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,7 +63,7 @@ export interface UpdateAgentRequest {
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. */
@@ -71,21 +73,22 @@ export interface UpdateAgentRequest {
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?: UpdateAgentRequest.ConfigurationEndpoint;
76
+ configuration_endpoint?: UpdateAgentRequest.ConfigurationEndpoint | null;
75
77
  }
76
78
  export declare namespace UpdateAgentRequest {
77
79
  /**
78
80
  * The audio format of the agent.
79
81
  */
80
- type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
82
+ type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
81
83
  const AudioFormat: {
82
84
  readonly Pcm44100: "pcm_44100";
83
85
  readonly Pcm16000: "pcm_16000";
86
+ readonly Pcm8000: "pcm_8000";
84
87
  readonly Mulaw8000: "mulaw_8000";
85
88
  };
86
89
  namespace TemplateVariables {
87
90
  interface Value {
88
- default_value?: string;
91
+ default_value: string | null;
89
92
  is_boosted_keyword?: boolean;
90
93
  }
91
94
  }
@@ -9,6 +9,7 @@ var UpdateAgentRequest;
9
9
  UpdateAgentRequest.AudioFormat = {
10
10
  Pcm44100: "pcm_44100",
11
11
  Pcm16000: "pcm_16000",
12
+ Pcm8000: "pcm_8000",
12
13
  Mulaw8000: "mulaw_8000",
13
14
  };
14
15
  })(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
@@ -15,7 +15,9 @@ import * as Phonic from "../../../../index.js";
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
  * }
@@ -233,5 +233,5 @@ export declare class Conversations {
233
233
  sipOutboundCall(request: Phonic.ConversationsSipOutboundCallRequest, requestOptions?: Conversations.RequestOptions): core.HttpResponsePromise<Phonic.ConversationsSipOutboundCallResponse>;
234
234
  private __sipOutboundCall;
235
235
  connect(args?: Conversations.ConnectArgs): Promise<ConversationsSocket>;
236
- protected _getAuthorizationHeader(): Promise<string>;
236
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
237
237
  }
@@ -893,12 +893,10 @@ class Conversations {
893
893
  return __awaiter(this, void 0, void 0, function* () {
894
894
  var _a;
895
895
  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"];
896
- if (bearer == null) {
897
- throw new errors.PhonicError({
898
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
899
- });
896
+ if (bearer != null) {
897
+ return `Bearer ${bearer}`;
900
898
  }
901
- return `Bearer ${bearer}`;
899
+ return undefined;
902
900
  });
903
901
  }
904
902
  }
@@ -138,5 +138,5 @@ export declare class ExtractionSchemas {
138
138
  */
139
139
  update(nameOrId: string, request?: Phonic.UpdateExtractionSchemaRequest, requestOptions?: ExtractionSchemas.RequestOptions): core.HttpResponsePromise<Phonic.ExtractionSchemasUpdateResponse>;
140
140
  private __update;
141
- protected _getAuthorizationHeader(): Promise<string>;
141
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
142
142
  }
@@ -461,12 +461,10 @@ class ExtractionSchemas {
461
461
  return __awaiter(this, void 0, void 0, function* () {
462
462
  var _a;
463
463
  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"];
464
- if (bearer == null) {
465
- throw new errors.PhonicError({
466
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
467
- });
464
+ if (bearer != null) {
465
+ return `Bearer ${bearer}`;
468
466
  }
469
- return `Bearer ${bearer}`;
467
+ return undefined;
470
468
  });
471
469
  }
472
470
  }
@@ -153,5 +153,5 @@ export declare class Projects {
153
153
  */
154
154
  createEvalPrompt(id: string, request: Phonic.CreateConversationEvalPromptRequest, requestOptions?: Projects.RequestOptions): core.HttpResponsePromise<Phonic.ProjectsCreateEvalPromptResponse>;
155
155
  private __createEvalPrompt;
156
- protected _getAuthorizationHeader(): Promise<string>;
156
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
157
157
  }
@@ -572,12 +572,10 @@ class Projects {
572
572
  return __awaiter(this, void 0, void 0, function* () {
573
573
  var _a;
574
574
  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"];
575
- if (bearer == null) {
576
- throw new errors.PhonicError({
577
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
578
- });
575
+ if (bearer != null) {
576
+ return `Bearer ${bearer}`;
579
577
  }
580
- return `Bearer ${bearer}`;
578
+ return undefined;
581
579
  });
582
580
  }
583
581
  }
@@ -11,5 +11,5 @@
11
11
  export interface UpdateProjectRequest {
12
12
  /** The name of the project. Can only contain lowercase letters, numbers and hyphens. Must be unique within the workspace. */
13
13
  name?: string;
14
- default_agent?: string;
14
+ default_agent?: string | null;
15
15
  }
@@ -166,5 +166,5 @@ export declare class Tools {
166
166
  */
167
167
  update(nameOrId: string, request?: Phonic.UpdateToolRequest, requestOptions?: Tools.RequestOptions): core.HttpResponsePromise<Phonic.ToolsUpdateResponse>;
168
168
  private __update;
169
- protected _getAuthorizationHeader(): Promise<string>;
169
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
170
170
  }
@@ -482,12 +482,10 @@ class Tools {
482
482
  return __awaiter(this, void 0, void 0, function* () {
483
483
  var _a;
484
484
  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"];
485
- if (bearer == null) {
486
- throw new errors.PhonicError({
487
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
488
- });
485
+ if (bearer != null) {
486
+ return `Bearer ${bearer}`;
489
487
  }
490
- return `Bearer ${bearer}`;
488
+ return undefined;
491
489
  });
492
490
  }
493
491
  }
@@ -61,5 +61,5 @@ export declare class Voices {
61
61
  */
62
62
  get(id: string, requestOptions?: Voices.RequestOptions): core.HttpResponsePromise<Phonic.VoicesGetResponse>;
63
63
  private __get;
64
- protected _getAuthorizationHeader(): Promise<string>;
64
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
65
65
  }
@@ -193,12 +193,10 @@ class Voices {
193
193
  return __awaiter(this, void 0, void 0, function* () {
194
194
  var _a;
195
195
  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"];
196
- if (bearer == null) {
197
- throw new errors.PhonicError({
198
- message: "Please specify a bearer by either passing it in to the constructor or initializing a PHONIC_API_KEY environment variable",
199
- });
196
+ if (bearer != null) {
197
+ return `Bearer ${bearer}`;
200
198
  }
201
- return `Bearer ${bearer}`;
199
+ return undefined;
202
200
  });
203
201
  }
204
202
  }
@@ -8,7 +8,7 @@ export interface Agent {
8
8
  /** The name of the agent. */
9
9
  name: string;
10
10
  /** The phone number that the agent uses to accept and initiate phone calls. `null` if the agent is not associated with a phone number, in which can the agent can be used via WebSockets. */
11
- phone_number?: string;
11
+ phone_number: string | null;
12
12
  /** The project the agent belongs to. */
13
13
  project: Agent.Project;
14
14
  /** The timezone of the agent. Used to format system variables like `{{system_time}}`. */
@@ -22,7 +22,7 @@ export interface Agent {
22
22
  /** The background noise level of the agent. Must be between 0 and 1. */
23
23
  background_noise_level: number;
24
24
  /** Message to play when the conversation starts. */
25
- welcome_message?: string;
25
+ welcome_message: string | null;
26
26
  /** Instructions for the conversation. */
27
27
  system_prompt: string;
28
28
  /** Template variables that the agent can use in the welcome message and the system prompt. */
@@ -32,7 +32,7 @@ export interface Agent {
32
32
  /** Tasks for the agent to complete during the conversation. */
33
33
  tasks: Phonic.Task[];
34
34
  /** Number of seconds of silence before sending a poke message. `null` disables the poke message. */
35
- no_input_poke_sec?: number;
35
+ no_input_poke_sec: number | null;
36
36
  /** The message to send after the specified silence. */
37
37
  no_input_poke_text: string;
38
38
  /** Seconds of silence before ending the conversation. */
@@ -42,7 +42,7 @@ export interface Agent {
42
42
  /** These words, or short phrases, will be more accurately recognized by the agent. */
43
43
  boosted_keywords: string[];
44
44
  /** When not `null`, the agent will call this endpoint to get configuration options. */
45
- configuration_endpoint?: Agent.ConfigurationEndpoint;
45
+ configuration_endpoint: Agent.ConfigurationEndpoint | null;
46
46
  }
47
47
  export declare namespace Agent {
48
48
  /**
@@ -55,15 +55,16 @@ export declare namespace Agent {
55
55
  /**
56
56
  * The audio format of the agent. If the agent has a phone number, the audio format will be `mulaw_8000`.
57
57
  */
58
- type AudioFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
58
+ type AudioFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
59
59
  const AudioFormat: {
60
60
  readonly Pcm44100: "pcm_44100";
61
61
  readonly Pcm16000: "pcm_16000";
62
+ readonly Pcm8000: "pcm_8000";
62
63
  readonly Mulaw8000: "mulaw_8000";
63
64
  };
64
65
  namespace TemplateVariables {
65
66
  interface Value {
66
- default_value?: string;
67
+ default_value: string | null;
67
68
  }
68
69
  }
69
70
  type Tools = Tools.Item[];
@@ -9,6 +9,7 @@ var Agent;
9
9
  Agent.AudioFormat = {
10
10
  Pcm44100: "pcm_44100",
11
11
  Pcm16000: "pcm_16000",
12
+ Pcm8000: "pcm_8000",
12
13
  Mulaw8000: "mulaw_8000",
13
14
  };
14
15
  })(Agent || (exports.Agent = Agent = {}));
@@ -16,7 +16,7 @@ export interface ConfigPayload {
16
16
  /** Background noise level for the conversation */
17
17
  background_noise_level?: number;
18
18
  /** Message to play when conversation starts */
19
- welcome_message?: string;
19
+ welcome_message?: string | null;
20
20
  /** Voice ID to use for speech synthesis */
21
21
  voice_id?: string;
22
22
  /** Audio input format */
@@ -36,7 +36,7 @@ export interface ConfigPayload {
36
36
  /** Enable transcript RAG */
37
37
  enable_transcripts_rag?: boolean;
38
38
  /** Seconds of silence before poke message */
39
- no_input_poke_sec?: number;
39
+ no_input_poke_sec?: number | null;
40
40
  /** Poke message text */
41
41
  no_input_poke_text?: string;
42
42
  /** Seconds of silence before ending conversation */
@@ -54,19 +54,21 @@ export declare namespace ConfigPayload {
54
54
  /**
55
55
  * Audio input format
56
56
  */
57
- type InputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
57
+ type InputFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
58
58
  const InputFormat: {
59
59
  readonly Pcm44100: "pcm_44100";
60
60
  readonly Pcm16000: "pcm_16000";
61
+ readonly Pcm8000: "pcm_8000";
61
62
  readonly Mulaw8000: "mulaw_8000";
62
63
  };
63
64
  /**
64
65
  * Audio output format
65
66
  */
66
- type OutputFormat = "pcm_44100" | "pcm_16000" | "mulaw_8000";
67
+ type OutputFormat = "pcm_44100" | "pcm_16000" | "pcm_8000" | "mulaw_8000";
67
68
  const OutputFormat: {
68
69
  readonly Pcm44100: "pcm_44100";
69
70
  readonly Pcm16000: "pcm_16000";
71
+ readonly Pcm8000: "pcm_8000";
70
72
  readonly Mulaw8000: "mulaw_8000";
71
73
  };
72
74
  }
@@ -9,11 +9,13 @@ var ConfigPayload;
9
9
  ConfigPayload.InputFormat = {
10
10
  Pcm44100: "pcm_44100",
11
11
  Pcm16000: "pcm_16000",
12
+ Pcm8000: "pcm_8000",
12
13
  Mulaw8000: "mulaw_8000",
13
14
  };
14
15
  ConfigPayload.OutputFormat = {
15
16
  Pcm44100: "pcm_44100",
16
17
  Pcm16000: "pcm_16000",
18
+ Pcm8000: "pcm_8000",
17
19
  Mulaw8000: "mulaw_8000",
18
20
  };
19
21
  })(ConfigPayload || (exports.ConfigPayload = ConfigPayload = {}));
@@ -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,17 +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
40
  /** Who or what ended the conversation. */
41
- ended_by?: string;
41
+ ended_by: Conversation.EndedBy | null;
42
42
  /** Array of conversation items (turns). */
43
43
  items: Phonic.ConversationItem[];
44
44
  /** Results from conversation evaluations and extractions. */
@@ -65,4 +65,15 @@ export declare namespace Conversation {
65
65
  /** The name of the project. */
66
66
  name: string;
67
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
+ };
68
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 {