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
@@ -0,0 +1,24 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export const LanguageCode = {
5
+ Ar: "ar",
6
+ Zh: "zh",
7
+ Cs: "cs",
8
+ Da: "da",
9
+ Nl: "nl",
10
+ En: "en",
11
+ Fr: "fr",
12
+ De: "de",
13
+ Id: "id",
14
+ It: "it",
15
+ Ja: "ja",
16
+ Ko: "ko",
17
+ Pl: "pl",
18
+ Pt: "pt",
19
+ Ru: "ru",
20
+ Es: "es",
21
+ Sv: "sv",
22
+ Tr: "tr",
23
+ Vi: "vi",
24
+ };
@@ -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.mjs";
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.mjs";
2
2
  export * from "./Error_.mjs";
3
3
  export * from "./BasicError.mjs";
4
4
  export * from "./ValidationError.mjs";
5
+ export * from "./LanguageCode.mjs";
5
6
  export * from "./Agent.mjs";
6
7
  export * from "./CreateAgentRequest.mjs";
7
8
  export * from "./Tool.mjs";
@@ -2,6 +2,7 @@ export * from "./BadRequestErrorBody.mjs";
2
2
  export * from "./Error_.mjs";
3
3
  export * from "./BasicError.mjs";
4
4
  export * from "./ValidationError.mjs";
5
+ export * from "./LanguageCode.mjs";
5
6
  export * from "./Agent.mjs";
6
7
  export * from "./CreateAgentRequest.mjs";
7
8
  export * from "./Tool.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.30.8";
1
+ export declare const SDK_VERSION = "0.30.10";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.30.8";
1
+ export const SDK_VERSION = "0.30.10";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.30.8",
3
+ "version": "0.30.10",
4
4
  "private": false,
5
5
  "repository": "github:Phonic-Co/phonic-node",
6
6
  "type": "commonjs",
@@ -50,7 +50,7 @@
50
50
  "@types/jest": "^29.5.14",
51
51
  "ts-jest": "^29.3.4",
52
52
  "jest-environment-jsdom": "^29.7.0",
53
- "msw": "^2.8.4",
53
+ "msw": "2.11.2",
54
54
  "@types/node": "^18.19.70",
55
55
  "prettier": "^3.4.2",
56
56
  "typescript": "~5.7.2"
package/reference.md CHANGED
@@ -104,7 +104,9 @@ await client.agents.create({
104
104
  welcome_message: "Hi {{customer_name}}. How can I help you today?",
105
105
  system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
106
106
  template_variables: {
107
- customer_name: {},
107
+ customer_name: {
108
+ default_value: null,
109
+ },
108
110
  subject: {
109
111
  default_value: "Chess",
110
112
  },
@@ -112,7 +114,7 @@ await client.agents.create({
112
114
  tools: ["keypad_input"],
113
115
  no_input_poke_sec: 30,
114
116
  no_input_poke_text: "Are you still there?",
115
- recognized_languages: ["en", "es"],
117
+ languages: ["en", "es"],
116
118
  boosted_keywords: ["Load ID", "dispatch"],
117
119
  configuration_endpoint: {
118
120
  url: "https://api.example.com/config",
@@ -195,7 +197,9 @@ await client.agents.upsert({
195
197
  welcome_message: "Hi {{customer_name}}. How can I help you today?",
196
198
  system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
197
199
  template_variables: {
198
- customer_name: {},
200
+ customer_name: {
201
+ default_value: null,
202
+ },
199
203
  subject: {
200
204
  default_value: "Chess",
201
205
  },
@@ -203,7 +207,7 @@ await client.agents.upsert({
203
207
  tools: ["keypad_input"],
204
208
  no_input_poke_sec: 30,
205
209
  no_input_poke_text: "Are you still there?",
206
- recognized_languages: ["en", "es"],
210
+ languages: ["en", "es"],
207
211
  boosted_keywords: ["Load ID", "dispatch"],
208
212
  configuration_endpoint: {
209
213
  url: "https://api.example.com/config",
@@ -432,7 +436,9 @@ await client.agents.update("nameOrId", {
432
436
  welcome_message: "Hi {{customer_name}}. How can I help you today?",
433
437
  system_prompt: "You are an expert in {{subject}}. Be friendly, helpful and concise.",
434
438
  template_variables: {
435
- customer_name: {},
439
+ customer_name: {
440
+ default_value: null,
441
+ },
436
442
  subject: {
437
443
  default_value: "Chess",
438
444
  },
@@ -440,7 +446,7 @@ await client.agents.update("nameOrId", {
440
446
  tools: ["keypad_input"],
441
447
  no_input_poke_sec: 30,
442
448
  no_input_poke_text: "Are you still there?",
443
- recognized_languages: ["en", "es"],
449
+ languages: ["en", "es"],
444
450
  boosted_keywords: ["Load ID", "dispatch"],
445
451
  configuration_endpoint: {
446
452
  url: "https://api.example.com/config",
@@ -1955,7 +1961,7 @@ await client.conversations.outboundCall({
1955
1961
  no_input_poke_sec: 30,
1956
1962
  no_input_poke_text: "Are you still there?",
1957
1963
  no_input_end_conversation_sec: 180,
1958
- recognized_languages: ["en", "es"],
1964
+ languages: ["en", "es"],
1959
1965
  boosted_keywords: ["Load ID", "dispatch"],
1960
1966
  tools: ["keypad_input"],
1961
1967
  },