phonic 0.30.9 → 0.30.11

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/Client.d.ts +2 -2
  3. package/dist/cjs/Client.js +2 -2
  4. package/dist/cjs/api/resources/agents/client/Client.d.ts +5 -5
  5. package/dist/cjs/api/resources/agents/client/Client.js +3 -3
  6. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +4 -2
  7. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +13 -2
  8. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.js +5 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +1 -1
  10. package/dist/cjs/api/resources/conversations/client/Client.d.ts +3 -3
  11. package/dist/cjs/api/resources/conversations/client/Client.js +1 -1
  12. package/dist/cjs/api/resources/conversations/client/requests/OutboundCallRequest.d.ts +1 -1
  13. package/dist/cjs/api/resources/extractionSchemas/client/Client.d.ts +2 -2
  14. package/dist/cjs/api/resources/projects/client/Client.d.ts +2 -2
  15. package/dist/cjs/api/resources/tools/client/Client.d.ts +2 -2
  16. package/dist/cjs/api/resources/voices/client/Client.d.ts +2 -2
  17. package/dist/cjs/api/types/Agent.d.ts +12 -1
  18. package/dist/cjs/api/types/Agent.js +5 -0
  19. package/dist/cjs/api/types/ConfigPayload.d.ts +11 -0
  20. package/dist/cjs/api/types/ConfigPayload.js +5 -0
  21. package/dist/cjs/api/types/Conversation.d.ts +23 -2
  22. package/dist/cjs/api/types/Conversation.js +5 -0
  23. package/dist/cjs/api/types/CreateAgentRequest.d.ts +12 -1
  24. package/dist/cjs/api/types/CreateAgentRequest.js +5 -0
  25. package/dist/cjs/api/types/LanguageCode.d.ts +28 -0
  26. package/dist/cjs/api/types/LanguageCode.js +27 -0
  27. package/dist/cjs/api/types/OutboundCallConfig.d.ts +2 -1
  28. package/dist/cjs/api/types/index.d.ts +1 -0
  29. package/dist/cjs/api/types/index.js +1 -0
  30. package/dist/cjs/core/fetcher/Fetcher.d.ts +1 -1
  31. package/dist/cjs/core/fetcher/requestWithRetries.js +44 -8
  32. package/dist/cjs/core/headers.d.ts +2 -2
  33. package/dist/cjs/version.d.ts +1 -1
  34. package/dist/cjs/version.js +1 -1
  35. package/dist/esm/Client.d.mts +2 -2
  36. package/dist/esm/Client.mjs +2 -2
  37. package/dist/esm/api/resources/agents/client/Client.d.mts +5 -5
  38. package/dist/esm/api/resources/agents/client/Client.mjs +3 -3
  39. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +4 -2
  40. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +13 -2
  41. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.mjs +5 -0
  42. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +1 -1
  43. package/dist/esm/api/resources/conversations/client/Client.d.mts +3 -3
  44. package/dist/esm/api/resources/conversations/client/Client.mjs +1 -1
  45. package/dist/esm/api/resources/conversations/client/requests/OutboundCallRequest.d.mts +1 -1
  46. package/dist/esm/api/resources/extractionSchemas/client/Client.d.mts +2 -2
  47. package/dist/esm/api/resources/projects/client/Client.d.mts +2 -2
  48. package/dist/esm/api/resources/tools/client/Client.d.mts +2 -2
  49. package/dist/esm/api/resources/voices/client/Client.d.mts +2 -2
  50. package/dist/esm/api/types/Agent.d.mts +12 -1
  51. package/dist/esm/api/types/Agent.mjs +5 -0
  52. package/dist/esm/api/types/ConfigPayload.d.mts +11 -0
  53. package/dist/esm/api/types/ConfigPayload.mjs +5 -0
  54. package/dist/esm/api/types/Conversation.d.mts +23 -2
  55. package/dist/esm/api/types/Conversation.mjs +5 -0
  56. package/dist/esm/api/types/CreateAgentRequest.d.mts +12 -1
  57. package/dist/esm/api/types/CreateAgentRequest.mjs +5 -0
  58. package/dist/esm/api/types/LanguageCode.d.mts +28 -0
  59. package/dist/esm/api/types/LanguageCode.mjs +24 -0
  60. package/dist/esm/api/types/OutboundCallConfig.d.mts +2 -1
  61. package/dist/esm/api/types/index.d.mts +1 -0
  62. package/dist/esm/api/types/index.mjs +1 -0
  63. package/dist/esm/core/fetcher/Fetcher.d.mts +1 -1
  64. package/dist/esm/core/fetcher/requestWithRetries.mjs +44 -8
  65. package/dist/esm/core/headers.d.mts +2 -2
  66. package/dist/esm/version.d.mts +1 -1
  67. package/dist/esm/version.mjs +1 -1
  68. package/package.json +1 -1
  69. package/reference.md +4 -4
package/README.md CHANGED
@@ -44,7 +44,7 @@ await client.agents.create({
44
44
  tools: ["keypad_input"],
45
45
  no_input_poke_sec: 30,
46
46
  no_input_poke_text: "Are you still there?",
47
- recognized_languages: ["en", "es"],
47
+ languages: ["en", "es"],
48
48
  boosted_keywords: ["Load ID", "dispatch"],
49
49
  configuration_endpoint: {
50
50
  url: "https://api.example.com/config",
@@ -16,7 +16,7 @@ export declare namespace PhonicClient {
16
16
  baseUrl?: core.Supplier<string>;
17
17
  apiKey?: core.Supplier<core.BearerToken | undefined>;
18
18
  /** Additional headers to include in requests. */
19
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
19
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
20
20
  fetcher?: core.FetchFunction;
21
21
  }
22
22
  interface RequestOptions {
@@ -29,7 +29,7 @@ export declare namespace PhonicClient {
29
29
  /** Additional query string parameters to include in the request. */
30
30
  queryParams?: Record<string, unknown>;
31
31
  /** Additional headers to include in the request. */
32
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
32
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
33
33
  }
34
34
  }
35
35
  export declare class PhonicClient {
@@ -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.9",
54
- "User-Agent": "phonic/0.30.9",
53
+ "X-Fern-SDK-Version": "0.30.11",
54
+ "User-Agent": "phonic/0.30.11",
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) });
@@ -11,7 +11,7 @@ export declare namespace Agents {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -24,7 +24,7 @@ export declare namespace Agents {
24
24
  /** Additional query string parameters to include in the request. */
25
25
  queryParams?: Record<string, unknown>;
26
26
  /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
28
  }
29
29
  }
30
30
  export declare class Agents {
@@ -77,7 +77,7 @@ export declare class Agents {
77
77
  * tools: ["keypad_input"],
78
78
  * no_input_poke_sec: 30,
79
79
  * no_input_poke_text: "Are you still there?",
80
- * recognized_languages: ["en", "es"],
80
+ * languages: ["en", "es"],
81
81
  * boosted_keywords: ["Load ID", "dispatch"],
82
82
  * configuration_endpoint: {
83
83
  * url: "https://api.example.com/config",
@@ -121,7 +121,7 @@ export declare class Agents {
121
121
  * tools: ["keypad_input"],
122
122
  * no_input_poke_sec: 30,
123
123
  * no_input_poke_text: "Are you still there?",
124
- * recognized_languages: ["en", "es"],
124
+ * languages: ["en", "es"],
125
125
  * boosted_keywords: ["Load ID", "dispatch"],
126
126
  * configuration_endpoint: {
127
127
  * url: "https://api.example.com/config",
@@ -201,7 +201,7 @@ export declare class Agents {
201
201
  * tools: ["keypad_input"],
202
202
  * no_input_poke_sec: 30,
203
203
  * no_input_poke_text: "Are you still there?",
204
- * recognized_languages: ["en", "es"],
204
+ * languages: ["en", "es"],
205
205
  * boosted_keywords: ["Load ID", "dispatch"],
206
206
  * configuration_endpoint: {
207
207
  * url: "https://api.example.com/config",
@@ -167,7 +167,7 @@ class Agents {
167
167
  * tools: ["keypad_input"],
168
168
  * no_input_poke_sec: 30,
169
169
  * no_input_poke_text: "Are you still there?",
170
- * recognized_languages: ["en", "es"],
170
+ * languages: ["en", "es"],
171
171
  * boosted_keywords: ["Load ID", "dispatch"],
172
172
  * configuration_endpoint: {
173
173
  * url: "https://api.example.com/config",
@@ -272,7 +272,7 @@ class Agents {
272
272
  * tools: ["keypad_input"],
273
273
  * no_input_poke_sec: 30,
274
274
  * no_input_poke_text: "Are you still there?",
275
- * recognized_languages: ["en", "es"],
275
+ * languages: ["en", "es"],
276
276
  * boosted_keywords: ["Load ID", "dispatch"],
277
277
  * configuration_endpoint: {
278
278
  * url: "https://api.example.com/config",
@@ -517,7 +517,7 @@ class Agents {
517
517
  * tools: ["keypad_input"],
518
518
  * no_input_poke_sec: 30,
519
519
  * no_input_poke_text: "Are you still there?",
520
- * recognized_languages: ["en", "es"],
520
+ * languages: ["en", "es"],
521
521
  * boosted_keywords: ["Load ID", "dispatch"],
522
522
  * configuration_endpoint: {
523
523
  * url: "https://api.example.com/config",
@@ -25,7 +25,7 @@ import * as Phonic from "../../../../index.js";
25
25
  * tools: ["keypad_input"],
26
26
  * no_input_poke_sec: 30,
27
27
  * no_input_poke_text: "Are you still there?",
28
- * recognized_languages: ["en", "es"],
28
+ * languages: ["en", "es"],
29
29
  * boosted_keywords: ["Load ID", "dispatch"],
30
30
  * configuration_endpoint: {
31
31
  * url: "https://api.example.com/config",
@@ -52,6 +52,8 @@ export interface AgentsCreateRequest {
52
52
  audio_speed?: number;
53
53
  /** The background noise level of the agent. */
54
54
  background_noise_level?: number;
55
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
56
+ background_noise?: Phonic.CreateAgentRequest.BackgroundNoise | null;
55
57
  /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
56
58
  welcome_message?: string;
57
59
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
@@ -69,7 +71,7 @@ export interface AgentsCreateRequest {
69
71
  /** Seconds of silence before ending the conversation. */
70
72
  no_input_end_conversation_sec?: number;
71
73
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
72
- recognized_languages?: string[];
74
+ languages?: Phonic.LanguageCode[];
73
75
  /** These words, or short phrases, will be more accurately recognized by the agent. */
74
76
  boosted_keywords?: string[];
75
77
  /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
@@ -25,7 +25,7 @@ import * as Phonic from "../../../../index.js";
25
25
  * tools: ["keypad_input"],
26
26
  * no_input_poke_sec: 30,
27
27
  * no_input_poke_text: "Are you still there?",
28
- * recognized_languages: ["en", "es"],
28
+ * languages: ["en", "es"],
29
29
  * boosted_keywords: ["Load ID", "dispatch"],
30
30
  * configuration_endpoint: {
31
31
  * url: "https://api.example.com/config",
@@ -52,6 +52,8 @@ export interface UpdateAgentRequest {
52
52
  audio_speed?: number;
53
53
  /** The background noise level of the agent. */
54
54
  background_noise_level?: number;
55
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
56
+ background_noise?: UpdateAgentRequest.BackgroundNoise | null;
55
57
  /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
56
58
  welcome_message?: string;
57
59
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
@@ -69,7 +71,7 @@ export interface UpdateAgentRequest {
69
71
  /** Seconds of silence before ending the conversation. */
70
72
  no_input_end_conversation_sec?: number;
71
73
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
72
- recognized_languages?: string[];
74
+ languages?: Phonic.LanguageCode[];
73
75
  /** These words, or short phrases, will be more accurately recognized by the agent. */
74
76
  boosted_keywords?: string[];
75
77
  /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
@@ -86,6 +88,15 @@ export declare namespace UpdateAgentRequest {
86
88
  readonly Pcm8000: "pcm_8000";
87
89
  readonly Mulaw8000: "mulaw_8000";
88
90
  };
91
+ /**
92
+ * The background noise type. Can be "office", "call-center", "coffee-shop", or null.
93
+ */
94
+ type BackgroundNoise = "office" | "call-center" | "coffee-shop";
95
+ const BackgroundNoise: {
96
+ readonly Office: "office";
97
+ readonly CallCenter: "call-center";
98
+ readonly CoffeeShop: "coffee-shop";
99
+ };
89
100
  namespace TemplateVariables {
90
101
  interface Value {
91
102
  default_value: string | null;
@@ -12,4 +12,9 @@ var UpdateAgentRequest;
12
12
  Pcm8000: "pcm_8000",
13
13
  Mulaw8000: "mulaw_8000",
14
14
  };
15
+ UpdateAgentRequest.BackgroundNoise = {
16
+ Office: "office",
17
+ CallCenter: "call-center",
18
+ CoffeeShop: "coffee-shop",
19
+ };
15
20
  })(UpdateAgentRequest || (exports.UpdateAgentRequest = UpdateAgentRequest = {}));
@@ -25,7 +25,7 @@ import * as Phonic from "../../../../index.js";
25
25
  * tools: ["keypad_input"],
26
26
  * no_input_poke_sec: 30,
27
27
  * no_input_poke_text: "Are you still there?",
28
- * recognized_languages: ["en", "es"],
28
+ * languages: ["en", "es"],
29
29
  * boosted_keywords: ["Load ID", "dispatch"],
30
30
  * configuration_endpoint: {
31
31
  * url: "https://api.example.com/config",
@@ -12,7 +12,7 @@ export declare namespace Conversations {
12
12
  baseUrl?: core.Supplier<string>;
13
13
  apiKey?: core.Supplier<core.BearerToken | undefined>;
14
14
  /** Additional headers to include in requests. */
15
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
15
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
16
16
  fetcher?: core.FetchFunction;
17
17
  }
18
18
  interface RequestOptions {
@@ -25,7 +25,7 @@ export declare namespace Conversations {
25
25
  /** Additional query string parameters to include in the request. */
26
26
  queryParams?: Record<string, unknown>;
27
27
  /** Additional headers to include in the request. */
28
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
28
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
29
29
  }
30
30
  interface ConnectArgs {
31
31
  downstream_websocket_url?: string | undefined;
@@ -205,7 +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
+ * languages: ["en", "es"],
209
209
  * boosted_keywords: ["Load ID", "dispatch"],
210
210
  * tools: ["keypad_input"]
211
211
  * }
@@ -713,7 +713,7 @@ class Conversations {
713
713
  * no_input_poke_sec: 30,
714
714
  * no_input_poke_text: "Are you still there?",
715
715
  * no_input_end_conversation_sec: 180,
716
- * recognized_languages: ["en", "es"],
716
+ * languages: ["en", "es"],
717
717
  * boosted_keywords: ["Load ID", "dispatch"],
718
718
  * tools: ["keypad_input"]
719
719
  * }
@@ -18,7 +18,7 @@ import * as Phonic from "../../../../index.js";
18
18
  * no_input_poke_sec: 30,
19
19
  * no_input_poke_text: "Are you still there?",
20
20
  * no_input_end_conversation_sec: 180,
21
- * recognized_languages: ["en", "es"],
21
+ * languages: ["en", "es"],
22
22
  * boosted_keywords: ["Load ID", "dispatch"],
23
23
  * tools: ["keypad_input"]
24
24
  * }
@@ -11,7 +11,7 @@ export declare namespace ExtractionSchemas {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -24,7 +24,7 @@ export declare namespace ExtractionSchemas {
24
24
  /** Additional query string parameters to include in the request. */
25
25
  queryParams?: Record<string, unknown>;
26
26
  /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
28
  }
29
29
  }
30
30
  export declare class ExtractionSchemas {
@@ -11,7 +11,7 @@ export declare namespace Projects {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -24,7 +24,7 @@ export declare namespace Projects {
24
24
  /** Additional query string parameters to include in the request. */
25
25
  queryParams?: Record<string, unknown>;
26
26
  /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
28
  }
29
29
  }
30
30
  export declare class Projects {
@@ -11,7 +11,7 @@ export declare namespace Tools {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -24,7 +24,7 @@ export declare namespace Tools {
24
24
  /** Additional query string parameters to include in the request. */
25
25
  queryParams?: Record<string, unknown>;
26
26
  /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
28
  }
29
29
  }
30
30
  export declare class Tools {
@@ -11,7 +11,7 @@ export declare namespace Voices {
11
11
  baseUrl?: core.Supplier<string>;
12
12
  apiKey?: core.Supplier<core.BearerToken | undefined>;
13
13
  /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
14
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
15
  fetcher?: core.FetchFunction;
16
16
  }
17
17
  interface RequestOptions {
@@ -24,7 +24,7 @@ export declare namespace Voices {
24
24
  /** Additional query string parameters to include in the request. */
25
25
  queryParams?: Record<string, unknown>;
26
26
  /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
27
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
28
  }
29
29
  }
30
30
  export declare class Voices {
@@ -21,6 +21,8 @@ export interface Agent {
21
21
  audio_speed: number;
22
22
  /** The background noise level of the agent. Must be between 0 and 1. */
23
23
  background_noise_level: number;
24
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
25
+ background_noise: Agent.BackgroundNoise | null;
24
26
  /** Message to play when the conversation starts. */
25
27
  welcome_message: string | null;
26
28
  /** Instructions for the conversation. */
@@ -38,7 +40,7 @@ export interface Agent {
38
40
  /** Seconds of silence before ending the conversation. */
39
41
  no_input_end_conversation_sec: number;
40
42
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
41
- recognized_languages: string[];
43
+ languages: Phonic.LanguageCode[];
42
44
  /** These words, or short phrases, will be more accurately recognized by the agent. */
43
45
  boosted_keywords: string[];
44
46
  /** When not `null`, the agent will call this endpoint to get configuration options. */
@@ -62,6 +64,15 @@ export declare namespace Agent {
62
64
  readonly Pcm8000: "pcm_8000";
63
65
  readonly Mulaw8000: "mulaw_8000";
64
66
  };
67
+ /**
68
+ * The background noise type. Can be "office", "call-center", "coffee-shop", or null.
69
+ */
70
+ type BackgroundNoise = "office" | "call-center" | "coffee-shop";
71
+ const BackgroundNoise: {
72
+ readonly Office: "office";
73
+ readonly CallCenter: "call-center";
74
+ readonly CoffeeShop: "coffee-shop";
75
+ };
65
76
  namespace TemplateVariables {
66
77
  interface Value {
67
78
  default_value: string | null;
@@ -12,4 +12,9 @@ var Agent;
12
12
  Pcm8000: "pcm_8000",
13
13
  Mulaw8000: "mulaw_8000",
14
14
  };
15
+ Agent.BackgroundNoise = {
16
+ Office: "office",
17
+ CallCenter: "call-center",
18
+ CoffeeShop: "coffee-shop",
19
+ };
15
20
  })(Agent || (exports.Agent = Agent = {}));
@@ -15,6 +15,8 @@ export interface ConfigPayload {
15
15
  audio_speed?: number;
16
16
  /** Background noise level for the conversation */
17
17
  background_noise_level?: number;
18
+ /** Background noise type for the conversation */
19
+ background_noise?: ConfigPayload.BackgroundNoise | null;
18
20
  /** Message to play when conversation starts */
19
21
  welcome_message?: string | null;
20
22
  /** Voice ID to use for speech synthesis */
@@ -51,6 +53,15 @@ export interface ConfigPayload {
51
53
  template_variables?: Record<string, string>;
52
54
  }
53
55
  export declare namespace ConfigPayload {
56
+ /**
57
+ * Background noise type for the conversation
58
+ */
59
+ type BackgroundNoise = "office" | "call-center" | "coffee-shop";
60
+ const BackgroundNoise: {
61
+ readonly Office: "office";
62
+ readonly CallCenter: "call-center";
63
+ readonly CoffeeShop: "coffee-shop";
64
+ };
54
65
  /**
55
66
  * Audio input format
56
67
  */
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfigPayload = void 0;
7
7
  var ConfigPayload;
8
8
  (function (ConfigPayload) {
9
+ ConfigPayload.BackgroundNoise = {
10
+ Office: "office",
11
+ CallCenter: "call-center",
12
+ CoffeeShop: "coffee-shop",
13
+ };
9
14
  ConfigPayload.InputFormat = {
10
15
  Pcm44100: "pcm_44100",
11
16
  Pcm16000: "pcm_16000",
@@ -25,6 +25,8 @@ export interface Conversation {
25
25
  output_format: string;
26
26
  /** Background noise level used in the conversation. */
27
27
  background_noise_level: number;
28
+ /** The background noise type used in the conversation. */
29
+ background_noise: Conversation.BackgroundNoise | null;
28
30
  /** Live transcript of the conversation. */
29
31
  live_transcript: string;
30
32
  /** Post-call processed transcript. */
@@ -39,10 +41,20 @@ export interface Conversation {
39
41
  ended_at: string | null;
40
42
  /** Who or what ended the conversation. */
41
43
  ended_by: Conversation.EndedBy | null;
42
- /** Array of conversation items (turns). */
43
- items: Phonic.ConversationItem[];
44
+ /** These words, or short phrases, are more accurately recognized by the model. */
45
+ boosted_keywords: string[] | null;
46
+ /** Array of ISO 639-1 language codes recognized by the model. */
47
+ languages: string[] | null;
48
+ /** Number of seconds of silence before a poke message is sent. `null` means the poke message is disabled. */
49
+ no_input_poke_sec: number | null;
50
+ /** The message to send after the specified silence. Relevant only if `no_input_poke_sec` is not `null`. */
51
+ no_input_poke_text: string | null;
52
+ /** Seconds of silence before the conversation is ended. */
53
+ no_input_end_conversation_sec: number | null;
44
54
  /** Results from conversation evaluations and extractions. */
45
55
  task_results: Record<string, unknown>;
56
+ /** Array of conversation items (turns). */
57
+ items: Phonic.ConversationItem[];
46
58
  }
47
59
  export declare namespace Conversation {
48
60
  /**
@@ -65,6 +77,15 @@ export declare namespace Conversation {
65
77
  /** The name of the project. */
66
78
  name: string;
67
79
  }
80
+ /**
81
+ * The background noise type used in the conversation.
82
+ */
83
+ type BackgroundNoise = "office" | "call-center" | "coffee-shop";
84
+ const BackgroundNoise: {
85
+ readonly Office: "office";
86
+ readonly CallCenter: "call-center";
87
+ readonly CoffeeShop: "coffee-shop";
88
+ };
68
89
  /**
69
90
  * Who or what ended the conversation.
70
91
  */
@@ -6,6 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Conversation = void 0;
7
7
  var Conversation;
8
8
  (function (Conversation) {
9
+ Conversation.BackgroundNoise = {
10
+ Office: "office",
11
+ CallCenter: "call-center",
12
+ CoffeeShop: "coffee-shop",
13
+ };
9
14
  Conversation.EndedBy = {
10
15
  User: "user",
11
16
  UserCanceled: "user_canceled",
@@ -16,6 +16,8 @@ export interface CreateAgentRequest {
16
16
  audio_speed?: number;
17
17
  /** The background noise level of the agent. */
18
18
  background_noise_level?: number;
19
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
20
+ background_noise?: CreateAgentRequest.BackgroundNoise | null;
19
21
  /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
20
22
  welcome_message?: string;
21
23
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
@@ -33,7 +35,7 @@ export interface CreateAgentRequest {
33
35
  /** Seconds of silence before ending the conversation. */
34
36
  no_input_end_conversation_sec?: number;
35
37
  /** Array of ISO 639-1 language codes that the agent should be able to recognize */
36
- recognized_languages?: string[];
38
+ languages?: Phonic.LanguageCode[];
37
39
  /** These words, or short phrases, will be more accurately recognized by the agent. */
38
40
  boosted_keywords?: string[];
39
41
  /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint when to get configuration options. */
@@ -50,6 +52,15 @@ export declare namespace CreateAgentRequest {
50
52
  readonly Pcm8000: "pcm_8000";
51
53
  readonly Mulaw8000: "mulaw_8000";
52
54
  };
55
+ /**
56
+ * The background noise type. Can be "office", "call-center", "coffee-shop", or null.
57
+ */
58
+ type BackgroundNoise = "office" | "call-center" | "coffee-shop";
59
+ const BackgroundNoise: {
60
+ readonly Office: "office";
61
+ readonly CallCenter: "call-center";
62
+ readonly CoffeeShop: "coffee-shop";
63
+ };
53
64
  namespace TemplateVariables {
54
65
  interface Value {
55
66
  default_value: string | null;
@@ -12,4 +12,9 @@ var CreateAgentRequest;
12
12
  Pcm8000: "pcm_8000",
13
13
  Mulaw8000: "mulaw_8000",
14
14
  };
15
+ CreateAgentRequest.BackgroundNoise = {
16
+ Office: "office",
17
+ CallCenter: "call-center",
18
+ CoffeeShop: "coffee-shop",
19
+ };
15
20
  })(CreateAgentRequest || (exports.CreateAgentRequest = CreateAgentRequest = {}));
@@ -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
  */
@@ -24,7 +25,7 @@ export interface OutboundCallConfig {
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. */
@@ -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);
@@ -6,7 +6,7 @@ export declare namespace Fetcher {
6
6
  url: string;
7
7
  method: string;
8
8
  contentType?: string;
9
- headers?: Record<string, string | Supplier<string | undefined> | undefined>;
9
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
10
10
  queryParameters?: Record<string, unknown>;
11
11
  body?: unknown;
12
12
  timeoutMs?: number;