phonic 0.32.1 → 0.32.3

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 (214) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +23 -18
  4. package/dist/cjs/api/errors/TooManyRequestsError.d.ts +6 -0
  5. package/dist/cjs/api/errors/TooManyRequestsError.js +54 -0
  6. package/dist/cjs/api/errors/index.d.ts +1 -0
  7. package/dist/cjs/api/errors/index.js +1 -0
  8. package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +8 -0
  9. package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +14 -0
  10. package/dist/cjs/api/resources/agents/client/requests/UpsertAgentRequest.d.ts +6 -0
  11. package/dist/cjs/api/resources/agents/types/AgentsUpdateResponse.d.ts +5 -0
  12. package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +79 -0
  13. package/dist/cjs/api/resources/apiKeys/client/Client.js +293 -0
  14. package/dist/cjs/api/resources/apiKeys/client/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/apiKeys/client/index.js +17 -0
  16. package/dist/cjs/api/resources/apiKeys/client/requests/CreateApiKeyRequest.d.ts +10 -0
  17. package/dist/cjs/api/resources/apiKeys/client/requests/CreateApiKeyRequest.js +3 -0
  18. package/dist/cjs/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.d.ts +10 -0
  19. package/dist/cjs/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.js +3 -0
  20. package/dist/cjs/api/resources/apiKeys/client/requests/index.d.ts +2 -0
  21. package/dist/cjs/api/resources/apiKeys/client/requests/index.js +2 -0
  22. package/dist/cjs/api/resources/apiKeys/exports.d.ts +2 -0
  23. package/dist/cjs/api/resources/apiKeys/exports.js +21 -0
  24. package/dist/cjs/api/resources/apiKeys/index.d.ts +2 -0
  25. package/dist/cjs/api/resources/apiKeys/index.js +18 -0
  26. package/dist/cjs/api/resources/apiKeys/types/ApiKeysDeleteResponse.d.ts +3 -0
  27. package/dist/cjs/api/resources/apiKeys/types/ApiKeysDeleteResponse.js +3 -0
  28. package/dist/cjs/api/resources/apiKeys/types/ApiKeysUpdateResponse.d.ts +3 -0
  29. package/dist/cjs/api/resources/apiKeys/types/ApiKeysUpdateResponse.js +3 -0
  30. package/dist/cjs/api/resources/apiKeys/types/index.d.ts +2 -0
  31. package/dist/cjs/api/resources/apiKeys/types/index.js +18 -0
  32. package/dist/cjs/api/resources/auth/client/Client.d.ts +20 -0
  33. package/dist/cjs/api/resources/auth/client/Client.js +70 -0
  34. package/dist/cjs/api/resources/auth/client/requests/CreateConversationTokenRequest.d.ts +13 -0
  35. package/dist/cjs/api/resources/auth/client/requests/CreateConversationTokenRequest.js +3 -0
  36. package/dist/cjs/api/resources/auth/client/requests/index.d.ts +1 -0
  37. package/dist/cjs/api/resources/auth/types/AuthCreateConversationTokenResponse.d.ts +6 -0
  38. package/dist/cjs/api/resources/auth/types/AuthCreateConversationTokenResponse.js +3 -0
  39. package/dist/cjs/api/resources/auth/types/index.d.ts +1 -0
  40. package/dist/cjs/api/resources/auth/types/index.js +1 -0
  41. package/dist/cjs/api/resources/conversations/client/Client.d.ts +26 -1
  42. package/dist/cjs/api/resources/conversations/client/Client.js +78 -0
  43. package/dist/cjs/api/resources/conversations/client/requests/ReplayConversationRequest.d.ts +10 -0
  44. package/dist/cjs/api/resources/conversations/client/requests/ReplayConversationRequest.js +3 -0
  45. package/dist/cjs/api/resources/conversations/client/requests/index.d.ts +1 -0
  46. package/dist/cjs/api/resources/conversations/types/ConversationsEvaluateResponse.d.ts +19 -0
  47. package/dist/cjs/api/resources/conversations/types/ConversationsEvaluateResponse.js +17 -0
  48. package/dist/cjs/api/resources/conversations/types/ConversationsReplayResponse.d.ts +4 -0
  49. package/dist/cjs/api/resources/conversations/types/ConversationsReplayResponse.js +3 -0
  50. package/dist/cjs/api/resources/conversations/types/index.d.ts +2 -0
  51. package/dist/cjs/api/resources/conversations/types/index.js +2 -0
  52. package/dist/cjs/api/resources/index.d.ts +4 -0
  53. package/dist/cjs/api/resources/index.js +5 -1
  54. package/dist/cjs/api/resources/projects/client/Client.d.ts +16 -0
  55. package/dist/cjs/api/resources/projects/client/Client.js +58 -0
  56. package/dist/cjs/api/resources/projects/types/ProjectsListEvalsResponse.d.ts +4 -0
  57. package/dist/cjs/api/resources/projects/types/ProjectsListEvalsResponse.js +3 -0
  58. package/dist/cjs/api/resources/projects/types/index.d.ts +1 -0
  59. package/dist/cjs/api/resources/projects/types/index.js +1 -0
  60. package/dist/cjs/api/resources/tools/client/Client.d.ts +2 -1
  61. package/dist/cjs/api/resources/tools/client/Client.js +2 -1
  62. package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +4 -1
  63. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +5 -13
  64. package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +0 -8
  65. package/dist/cjs/api/resources/workspace/client/Client.d.ts +20 -0
  66. package/dist/cjs/api/resources/workspace/client/Client.js +65 -0
  67. package/dist/cjs/api/resources/workspace/client/index.d.ts +1 -1
  68. package/dist/cjs/api/resources/workspace/client/index.js +15 -0
  69. package/dist/cjs/api/resources/workspace/client/requests/UpdateWorkspaceRequest.d.ts +16 -0
  70. package/dist/cjs/api/resources/workspace/client/requests/UpdateWorkspaceRequest.js +3 -0
  71. package/dist/cjs/api/resources/workspace/client/requests/index.d.ts +1 -0
  72. package/dist/cjs/api/resources/workspace/client/requests/index.js +2 -0
  73. package/dist/cjs/api/resources/workspace/types/WorkspaceGetResponse.d.ts +6 -0
  74. package/dist/cjs/api/resources/workspace/types/WorkspaceUpdateResponse.d.ts +3 -0
  75. package/dist/cjs/api/resources/workspace/types/WorkspaceUpdateResponse.js +3 -0
  76. package/dist/cjs/api/resources/workspace/types/index.d.ts +1 -0
  77. package/dist/cjs/api/resources/workspace/types/index.js +1 -0
  78. package/dist/cjs/api/types/Agent.d.ts +9 -0
  79. package/dist/cjs/api/types/AgentIntegration.d.ts +13 -0
  80. package/dist/cjs/api/types/AgentIntegration.js +3 -0
  81. package/dist/cjs/api/types/ApiKeyWithSecret.d.ts +8 -0
  82. package/dist/cjs/api/types/ApiKeyWithSecret.js +3 -0
  83. package/dist/cjs/api/types/AudioChunkResponsePayload.d.ts +2 -0
  84. package/dist/cjs/api/types/ConfigOptions.d.ts +67 -0
  85. package/dist/cjs/api/types/Conversation.d.ts +27 -0
  86. package/dist/cjs/api/types/Conversation.js +4 -0
  87. package/dist/cjs/api/types/ConversationEval.d.ts +22 -1
  88. package/dist/cjs/api/types/ConversationEval.js +11 -0
  89. package/dist/cjs/api/types/ConversationEvalPromptInfo.d.ts +7 -0
  90. package/dist/cjs/api/types/ConversationEvalPromptInfo.js +3 -0
  91. package/dist/cjs/api/types/ConversationExtraction.d.ts +2 -4
  92. package/dist/cjs/api/types/ConversationItem.d.ts +4 -2
  93. package/dist/cjs/api/types/CreateAgentRequest.d.ts +8 -0
  94. package/dist/cjs/api/types/DataRetentionPolicy.d.ts +21 -0
  95. package/dist/cjs/api/types/DataRetentionPolicy.js +3 -0
  96. package/dist/cjs/api/types/DtmfPayload.d.ts +2 -0
  97. package/dist/cjs/api/types/ExtractionField.d.ts +2 -2
  98. package/dist/cjs/api/types/OutboundCallConfig.d.ts +45 -1
  99. package/dist/cjs/api/types/OutboundCallConfig.js +6 -0
  100. package/dist/cjs/api/types/OutboundNumberPool.d.ts +9 -0
  101. package/dist/cjs/api/types/OutboundNumberPool.js +3 -0
  102. package/dist/cjs/api/types/Tool.d.ts +3 -1
  103. package/dist/cjs/api/types/index.d.ts +5 -0
  104. package/dist/cjs/api/types/index.js +5 -0
  105. package/dist/cjs/version.d.ts +1 -1
  106. package/dist/cjs/version.js +1 -1
  107. package/dist/esm/BaseClient.mjs +2 -2
  108. package/dist/esm/Client.d.mts +3 -0
  109. package/dist/esm/Client.mjs +5 -0
  110. package/dist/esm/api/errors/TooManyRequestsError.d.mts +6 -0
  111. package/dist/esm/api/errors/TooManyRequestsError.mjs +17 -0
  112. package/dist/esm/api/errors/index.d.mts +1 -0
  113. package/dist/esm/api/errors/index.mjs +1 -0
  114. package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +8 -0
  115. package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +14 -0
  116. package/dist/esm/api/resources/agents/client/requests/UpsertAgentRequest.d.mts +6 -0
  117. package/dist/esm/api/resources/agents/types/AgentsUpdateResponse.d.mts +5 -0
  118. package/dist/esm/api/resources/apiKeys/client/Client.d.mts +79 -0
  119. package/dist/esm/api/resources/apiKeys/client/Client.mjs +256 -0
  120. package/dist/esm/api/resources/apiKeys/client/index.d.mts +1 -0
  121. package/dist/esm/api/resources/apiKeys/client/index.mjs +1 -0
  122. package/dist/esm/api/resources/apiKeys/client/requests/CreateApiKeyRequest.d.mts +10 -0
  123. package/dist/esm/api/resources/apiKeys/client/requests/CreateApiKeyRequest.mjs +2 -0
  124. package/dist/esm/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.d.mts +10 -0
  125. package/dist/esm/api/resources/apiKeys/client/requests/UpdateApiKeyRequest.mjs +2 -0
  126. package/dist/esm/api/resources/apiKeys/client/requests/index.d.mts +2 -0
  127. package/dist/esm/api/resources/apiKeys/client/requests/index.mjs +1 -0
  128. package/dist/esm/api/resources/apiKeys/exports.d.mts +2 -0
  129. package/dist/esm/api/resources/apiKeys/exports.mjs +3 -0
  130. package/dist/esm/api/resources/apiKeys/index.d.mts +2 -0
  131. package/dist/esm/api/resources/apiKeys/index.mjs +2 -0
  132. package/dist/esm/api/resources/apiKeys/types/ApiKeysDeleteResponse.d.mts +3 -0
  133. package/dist/esm/api/resources/apiKeys/types/ApiKeysDeleteResponse.mjs +2 -0
  134. package/dist/esm/api/resources/apiKeys/types/ApiKeysUpdateResponse.d.mts +3 -0
  135. package/dist/esm/api/resources/apiKeys/types/ApiKeysUpdateResponse.mjs +2 -0
  136. package/dist/esm/api/resources/apiKeys/types/index.d.mts +2 -0
  137. package/dist/esm/api/resources/apiKeys/types/index.mjs +2 -0
  138. package/dist/esm/api/resources/auth/client/Client.d.mts +20 -0
  139. package/dist/esm/api/resources/auth/client/Client.mjs +70 -0
  140. package/dist/esm/api/resources/auth/client/requests/CreateConversationTokenRequest.d.mts +13 -0
  141. package/dist/esm/api/resources/auth/client/requests/CreateConversationTokenRequest.mjs +2 -0
  142. package/dist/esm/api/resources/auth/client/requests/index.d.mts +1 -0
  143. package/dist/esm/api/resources/auth/types/AuthCreateConversationTokenResponse.d.mts +6 -0
  144. package/dist/esm/api/resources/auth/types/AuthCreateConversationTokenResponse.mjs +2 -0
  145. package/dist/esm/api/resources/auth/types/index.d.mts +1 -0
  146. package/dist/esm/api/resources/auth/types/index.mjs +1 -0
  147. package/dist/esm/api/resources/conversations/client/Client.d.mts +26 -1
  148. package/dist/esm/api/resources/conversations/client/Client.mjs +78 -0
  149. package/dist/esm/api/resources/conversations/client/requests/ReplayConversationRequest.d.mts +10 -0
  150. package/dist/esm/api/resources/conversations/client/requests/ReplayConversationRequest.mjs +2 -0
  151. package/dist/esm/api/resources/conversations/client/requests/index.d.mts +1 -0
  152. package/dist/esm/api/resources/conversations/types/ConversationsEvaluateResponse.d.mts +19 -0
  153. package/dist/esm/api/resources/conversations/types/ConversationsEvaluateResponse.mjs +14 -0
  154. package/dist/esm/api/resources/conversations/types/ConversationsReplayResponse.d.mts +4 -0
  155. package/dist/esm/api/resources/conversations/types/ConversationsReplayResponse.mjs +2 -0
  156. package/dist/esm/api/resources/conversations/types/index.d.mts +2 -0
  157. package/dist/esm/api/resources/conversations/types/index.mjs +2 -0
  158. package/dist/esm/api/resources/index.d.mts +4 -0
  159. package/dist/esm/api/resources/index.mjs +4 -0
  160. package/dist/esm/api/resources/projects/client/Client.d.mts +16 -0
  161. package/dist/esm/api/resources/projects/client/Client.mjs +58 -0
  162. package/dist/esm/api/resources/projects/types/ProjectsListEvalsResponse.d.mts +4 -0
  163. package/dist/esm/api/resources/projects/types/ProjectsListEvalsResponse.mjs +2 -0
  164. package/dist/esm/api/resources/projects/types/index.d.mts +1 -0
  165. package/dist/esm/api/resources/projects/types/index.mjs +1 -0
  166. package/dist/esm/api/resources/tools/client/Client.d.mts +2 -1
  167. package/dist/esm/api/resources/tools/client/Client.mjs +2 -1
  168. package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +4 -1
  169. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +5 -13
  170. package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +0 -8
  171. package/dist/esm/api/resources/workspace/client/Client.d.mts +20 -0
  172. package/dist/esm/api/resources/workspace/client/Client.mjs +65 -0
  173. package/dist/esm/api/resources/workspace/client/index.d.mts +1 -1
  174. package/dist/esm/api/resources/workspace/client/index.mjs +1 -1
  175. package/dist/esm/api/resources/workspace/client/requests/UpdateWorkspaceRequest.d.mts +16 -0
  176. package/dist/esm/api/resources/workspace/client/requests/UpdateWorkspaceRequest.mjs +2 -0
  177. package/dist/esm/api/resources/workspace/client/requests/index.d.mts +1 -0
  178. package/dist/esm/api/resources/workspace/client/requests/index.mjs +1 -0
  179. package/dist/esm/api/resources/workspace/types/WorkspaceGetResponse.d.mts +6 -0
  180. package/dist/esm/api/resources/workspace/types/WorkspaceUpdateResponse.d.mts +3 -0
  181. package/dist/esm/api/resources/workspace/types/WorkspaceUpdateResponse.mjs +2 -0
  182. package/dist/esm/api/resources/workspace/types/index.d.mts +1 -0
  183. package/dist/esm/api/resources/workspace/types/index.mjs +1 -0
  184. package/dist/esm/api/types/Agent.d.mts +9 -0
  185. package/dist/esm/api/types/AgentIntegration.d.mts +13 -0
  186. package/dist/esm/api/types/AgentIntegration.mjs +2 -0
  187. package/dist/esm/api/types/ApiKeyWithSecret.d.mts +8 -0
  188. package/dist/esm/api/types/ApiKeyWithSecret.mjs +2 -0
  189. package/dist/esm/api/types/AudioChunkResponsePayload.d.mts +2 -0
  190. package/dist/esm/api/types/ConfigOptions.d.mts +67 -0
  191. package/dist/esm/api/types/Conversation.d.mts +27 -0
  192. package/dist/esm/api/types/Conversation.mjs +4 -0
  193. package/dist/esm/api/types/ConversationEval.d.mts +22 -1
  194. package/dist/esm/api/types/ConversationEval.mjs +10 -1
  195. package/dist/esm/api/types/ConversationEvalPromptInfo.d.mts +7 -0
  196. package/dist/esm/api/types/ConversationEvalPromptInfo.mjs +2 -0
  197. package/dist/esm/api/types/ConversationExtraction.d.mts +2 -4
  198. package/dist/esm/api/types/ConversationItem.d.mts +4 -2
  199. package/dist/esm/api/types/CreateAgentRequest.d.mts +8 -0
  200. package/dist/esm/api/types/DataRetentionPolicy.d.mts +21 -0
  201. package/dist/esm/api/types/DataRetentionPolicy.mjs +2 -0
  202. package/dist/esm/api/types/DtmfPayload.d.mts +2 -0
  203. package/dist/esm/api/types/ExtractionField.d.mts +2 -2
  204. package/dist/esm/api/types/OutboundCallConfig.d.mts +45 -1
  205. package/dist/esm/api/types/OutboundCallConfig.mjs +6 -0
  206. package/dist/esm/api/types/OutboundNumberPool.d.mts +9 -0
  207. package/dist/esm/api/types/OutboundNumberPool.mjs +2 -0
  208. package/dist/esm/api/types/Tool.d.mts +3 -1
  209. package/dist/esm/api/types/index.d.mts +5 -0
  210. package/dist/esm/api/types/index.mjs +5 -0
  211. package/dist/esm/version.d.mts +1 -1
  212. package/dist/esm/version.mjs +1 -1
  213. package/package.json +12 -1
  214. package/reference.md +540 -2
@@ -86,6 +86,20 @@ export interface Conversation {
86
86
  call_info: Conversation.CallInfo | null;
87
87
  /** Analysis of the conversation including latencies and interruptions. */
88
88
  analysis: Phonic.ConversationAnalysis;
89
+ /** Whether PII and PHI have been redacted from the conversation. */
90
+ is_redacted?: boolean | undefined;
91
+ /** The redacted transcript of the conversation. `null` when the conversation is not redacted. */
92
+ redacted_transcript?: (string | null) | undefined;
93
+ /** Arbitrary metadata associated with the conversation. */
94
+ metadata?: (Record<string, unknown> | null) | undefined;
95
+ /** Controls how long transcripts and audio recordings are retained before deletion. */
96
+ data_retention_policy?: Phonic.DataRetentionPolicy | undefined;
97
+ /** Information about when transcripts and audio recordings are or were scheduled to be deleted. */
98
+ deletion_info?: Conversation.DeletionInfo | undefined;
99
+ /** Whether the assistant produced backchannel responses during the conversation. */
100
+ enable_assistant_backchannel?: boolean | undefined;
101
+ /** How aggressively the assistant produced backchannel responses during the conversation. */
102
+ assistant_backchannel_aggressiveness?: number | undefined;
89
103
  }
90
104
  export declare namespace Conversation {
91
105
  /**
@@ -130,6 +144,10 @@ export declare namespace Conversation {
130
144
  readonly UserCanceled: "user_canceled";
131
145
  readonly UserValidationFailed: "user_validation_failed";
132
146
  readonly Assistant: "assistant";
147
+ readonly AssistantSilenceLimitReached: "assistant_silence_limit_reached";
148
+ readonly ConfigurationEndpointTimedOut: "configuration_endpoint_timed_out";
149
+ readonly ConfigurationEndpointError: "configuration_endpoint_error";
150
+ readonly ConfigurationEndpointInvalidResponse: "configuration_endpoint_invalid_response";
133
151
  readonly Error: "error";
134
152
  };
135
153
  type EndedBy = (typeof EndedBy)[keyof typeof EndedBy];
@@ -158,4 +176,13 @@ export declare namespace Conversation {
158
176
  /** Twilio Call SID. Only present for user SIP trunking calls. */
159
177
  twilio_call_sid?: string | undefined;
160
178
  }
179
+ /**
180
+ * Information about when transcripts and audio recordings are or were scheduled to be deleted.
181
+ */
182
+ interface DeletionInfo {
183
+ /** When the transcripts were deleted. `null` if not deleted. */
184
+ transcripts_deleted_at: string | null;
185
+ /** When the audio recordings were deleted. `null` if not deleted. */
186
+ audio_recordings_deleted_at: string | null;
187
+ }
161
188
  }
@@ -21,6 +21,10 @@ export var Conversation;
21
21
  UserCanceled: "user_canceled",
22
22
  UserValidationFailed: "user_validation_failed",
23
23
  Assistant: "assistant",
24
+ AssistantSilenceLimitReached: "assistant_silence_limit_reached",
25
+ ConfigurationEndpointTimedOut: "configuration_endpoint_timed_out",
26
+ ConfigurationEndpointError: "configuration_endpoint_error",
27
+ ConfigurationEndpointInvalidResponse: "configuration_endpoint_invalid_response",
24
28
  Error: "error",
25
29
  };
26
30
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
@@ -1 +1,22 @@
1
- export type ConversationEval = unknown;
1
+ import type * as Phonic from "../index.mjs";
2
+ export interface ConversationEval {
3
+ /** The evaluation ID. */
4
+ id: string;
5
+ /** The ID of the conversation that was evaluated. */
6
+ conversation_id: string;
7
+ prompt: Phonic.ConversationEvalPromptInfo;
8
+ /** The evaluation result. */
9
+ result: ConversationEval.Result;
10
+ /** When the evaluation was created. */
11
+ created_at: string;
12
+ }
13
+ export declare namespace ConversationEval {
14
+ /** The evaluation result. */
15
+ const Result: {
16
+ readonly Successful: "successful";
17
+ readonly Unsuccessful: "unsuccessful";
18
+ readonly Undecided: "undecided";
19
+ readonly Error: "error";
20
+ };
21
+ type Result = (typeof Result)[keyof typeof Result];
22
+ }
@@ -1,2 +1,11 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
- export {};
2
+ export var ConversationEval;
3
+ (function (ConversationEval) {
4
+ /** The evaluation result. */
5
+ ConversationEval.Result = {
6
+ Successful: "successful",
7
+ Unsuccessful: "unsuccessful",
8
+ Undecided: "undecided",
9
+ Error: "error",
10
+ };
11
+ })(ConversationEval || (ConversationEval = {}));
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The evaluation prompt information.
3
+ */
4
+ export interface ConversationEvalPromptInfo {
5
+ id: string;
6
+ name: string;
7
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,13 +1,9 @@
1
1
  export interface ConversationExtraction {
2
2
  /** The extraction ID. */
3
3
  id: string;
4
- /** The conversation ID. */
5
- conversation_id?: string | undefined;
6
4
  schema: ConversationExtraction.Schema;
7
5
  /** The extracted data. */
8
6
  result: Record<string, unknown>;
9
- /** Error message if extraction failed. */
10
- error: string | null;
11
7
  /** When the extraction was created. */
12
8
  created_at: string;
13
9
  }
@@ -15,5 +11,7 @@ export declare namespace ConversationExtraction {
15
11
  interface Schema {
16
12
  id: string;
17
13
  name: string;
14
+ /** Whether the extraction schema has been deleted. */
15
+ isDeleted: boolean;
18
16
  }
19
17
  }
@@ -5,10 +5,12 @@ export interface ConversationItem {
5
5
  item_idx: number;
6
6
  /** Who spoke in this turn. */
7
7
  role: ConversationItem.Role;
8
- /** Live transcript of this turn. */
9
- live_transcript: string;
8
+ /** Live transcript of this turn. `null` when the turn has been redacted. */
9
+ live_transcript: string | null;
10
10
  /** Post-call processed transcript. */
11
11
  post_call_transcript: string | null;
12
+ /** The redacted transcript of this turn. `null` when the turn is not redacted. */
13
+ redacted_transcript?: (string | null) | undefined;
12
14
  /** Duration of this turn in milliseconds. */
13
15
  duration_ms: number;
14
16
  /** When this turn started. */
@@ -2,6 +2,8 @@ import type * as Phonic from "../index.mjs";
2
2
  export interface CreateAgentRequest {
3
3
  /** The name of the agent. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
4
4
  name: string;
5
+ /** URL-friendly agent slug. Can only contain lowercase letters, numbers and hyphens. Must be unique within the project. */
6
+ slug?: string | undefined;
5
7
  /** When set to `null`, the agent will not be associated with a phone number. When set to `"assign-automatically"`, the agent will be assigned a random phone number. When set to `"custom"`, you must provide `custom_phone_numbers`. */
6
8
  phone_number?: (CreateAgentRequest.PhoneNumber | null) | undefined;
7
9
  /** The custom phone number to use for the agent in E.164 format (e.g., +1234567890). This field is deprecated. Use `custom_phone_numbers` instead. */
@@ -42,6 +44,12 @@ export interface CreateAgentRequest {
42
44
  no_input_poke_text?: string | undefined;
43
45
  /** Seconds of silence before ending the conversation. */
44
46
  no_input_end_conversation_sec?: number | undefined;
47
+ /** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
48
+ enable_assistant_backchannel?: boolean | undefined;
49
+ /** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
50
+ assistant_backchannel_aggressiveness?: number | undefined;
51
+ /** Controls how long transcripts and audio recordings are retained before deletion. */
52
+ data_retention_policy?: Phonic.DataRetentionPolicy | undefined;
45
53
  /** ISO 639-1 language code that sets the agent's default language to recognize and speak. Welcome message and no input poke text should be in this language. */
46
54
  default_language?: Phonic.LanguageCode | undefined;
47
55
  /** Array of additional ISO 639-1 language codes that the agent should be able to recognize and speak. Should not include `default_language`. */
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Controls how long transcripts and audio recordings are retained before deletion.
3
+ * When `zero_data_retention` is `true`, nothing is retained and `transcripts`/`audio_recordings` are omitted.
4
+ */
5
+ export type DataRetentionPolicy =
6
+ /**
7
+ * Zero data retention mode. No transcripts or audio recordings are retained. */
8
+ {
9
+ zero_data_retention: true;
10
+ }
11
+ /**
12
+ * Standard data retention with configurable deletion windows. */
13
+ | {
14
+ zero_data_retention: false;
15
+ transcripts: {
16
+ delete_after_hours: number | null;
17
+ };
18
+ audio_recordings: {
19
+ delete_after_hours: number | null;
20
+ };
21
+ };
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -2,4 +2,6 @@ export interface DtmfPayload {
2
2
  type: "dtmf";
3
3
  /** DTMF digits to play */
4
4
  digits: string;
5
+ /** Optional latency-breakdown metrics for the message, expressed as named millisecond durations. */
6
+ timings?: Record<string, number> | undefined;
5
7
  }
@@ -3,8 +3,8 @@ export interface ExtractionField {
3
3
  name: string;
4
4
  /** The field type. */
5
5
  type: ExtractionField.Type;
6
- /** Description of the field. */
7
- description?: (string | null) | undefined;
6
+ /** Description of the field. May be null, but the property must be present. */
7
+ description: string | null;
8
8
  }
9
9
  export declare namespace ExtractionField {
10
10
  /** The field type. */
@@ -7,7 +7,11 @@ export interface OutboundCallConfig {
7
7
  agent?: string | undefined;
8
8
  /** The name of the project to use for the call. */
9
9
  project?: string | undefined;
10
- /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. */
10
+ /** When `true`, the welcome message will be automatically generated and the `welcome_message` field will be ignored. */
11
+ generate_welcome_message?: boolean | undefined;
12
+ /** When `false`, the welcome message will not be interruptible by the user. */
13
+ is_welcome_message_interruptible?: boolean | undefined;
14
+ /** Message to play when the conversation starts. Can contain template variables like `{{customer_name}}`. Ignored when `generate_welcome_message` is `true`. */
11
15
  welcome_message?: (string | null) | undefined;
12
16
  /** Instructions for the conversation. Can contain template variables like `{{subject}}`. */
13
17
  system_prompt?: string | undefined;
@@ -43,6 +47,28 @@ export interface OutboundCallConfig {
43
47
  tools?: OutboundCallConfig.Tools.Item[] | undefined;
44
48
  /** When `true`, PII and PHI are redacted from text transcripts (e.g. replaced with tags like `[PHONE NUMBER]`) and bleeped from audio recordings after the conversation ends. */
45
49
  enable_redaction?: boolean | undefined;
50
+ /** The speech-to-speech model to use. */
51
+ model?: "merritt" | undefined;
52
+ /** The audio speed of the agent. */
53
+ audio_speed?: number | undefined;
54
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
55
+ background_noise?: (OutboundCallConfig.BackgroundNoise | null) | undefined;
56
+ /** The background noise level of the agent. */
57
+ background_noise_level?: number | undefined;
58
+ /** Array of MCP server names to use. */
59
+ mcp_servers?: string[] | undefined;
60
+ /** Array of task objects with `name` and `description` fields. */
61
+ tasks?: Phonic.Task[] | undefined;
62
+ /** Pool of phone numbers used for outbound calls. */
63
+ outbound_number_pool?: (Phonic.OutboundNumberPool | null) | undefined;
64
+ /** When `true`, the assistant will produce backchannel responses (e.g. "mm-hmm") while the user is speaking. */
65
+ enable_assistant_backchannel?: boolean | undefined;
66
+ /** How aggressively the assistant produces backchannel responses. Only relevant when `enable_assistant_backchannel` is `true`. */
67
+ assistant_backchannel_aggressiveness?: number | undefined;
68
+ /** When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options. */
69
+ configuration_endpoint?: (OutboundCallConfig.ConfigurationEndpoint | null) | undefined;
70
+ /** Controls how long transcripts and audio recordings are retained before deletion. */
71
+ data_retention_policy?: Phonic.DataRetentionPolicy | undefined;
46
72
  }
47
73
  export declare namespace OutboundCallConfig {
48
74
  /** If `"auto"`, each user audio is automatically identified for the language to respond in. If `"request"`, user must request to change language (recommended). If `"initial"` the first turn user audio determines the language for the rest of the conversation. */
@@ -66,4 +92,22 @@ export declare namespace OutboundCallConfig {
66
92
  * Custom tool */
67
93
  | string;
68
94
  }
95
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
96
+ const BackgroundNoise: {
97
+ readonly Office: "office";
98
+ readonly CallCenter: "call-center";
99
+ readonly CoffeeShop: "coffee-shop";
100
+ };
101
+ type BackgroundNoise = (typeof BackgroundNoise)[keyof typeof BackgroundNoise];
102
+ /**
103
+ * When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
104
+ */
105
+ interface ConfigurationEndpoint {
106
+ /** URL to call */
107
+ url: string;
108
+ /** Object of key-value pairs. */
109
+ headers?: Record<string, string> | undefined;
110
+ /** Timeout in milliseconds for the endpoint call. */
111
+ timeout_ms?: number | undefined;
112
+ }
69
113
  }
@@ -7,4 +7,10 @@ export var OutboundCallConfig;
7
7
  Request: "request",
8
8
  Initial: "initial",
9
9
  };
10
+ /** The background noise type. Can be "office", "call-center", "coffee-shop", or null. */
11
+ OutboundCallConfig.BackgroundNoise = {
12
+ Office: "office",
13
+ CallCenter: "call-center",
14
+ CoffeeShop: "coffee-shop",
15
+ };
10
16
  })(OutboundCallConfig || (OutboundCallConfig = {}));
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Pool of phone numbers used for outbound calls.
3
+ */
4
+ export interface OutboundNumberPool {
5
+ /** E.164 formatted phone numbers available for outbound calls. */
6
+ active: string[];
7
+ /** E.164 formatted phone numbers that are blocked from being used. */
8
+ blocked: string[];
9
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -10,7 +10,7 @@ export interface Tool {
10
10
  /** The type of tool. */
11
11
  type: Tool.Type;
12
12
  /** Mode of operation - sync waits for response, async continues without waiting. */
13
- execution_mode: Tool.ExecutionMode;
13
+ execution_mode?: Tool.ExecutionMode | undefined;
14
14
  /** Array of parameter definitions for the tool. */
15
15
  parameters: Phonic.ToolParameter[];
16
16
  /** HTTP method for webhook tools. */
@@ -43,6 +43,8 @@ export interface Tool {
43
43
  allow_tool_chaining?: boolean | undefined;
44
44
  /** The agent doesn't typically wait for the response of async custom_websocket tools. When true, makes the agent wait for a response, not call other tools and inform the user of the result. Only available for async custom_websocket tools. */
45
45
  wait_for_response?: boolean | undefined;
46
+ /** The static context returned to the agent. Only present for custom_context tools. */
47
+ context?: string | undefined;
46
48
  }
47
49
  export declare namespace Tool {
48
50
  interface Project {
@@ -1,5 +1,7 @@
1
1
  export * from "./AddSystemMessagePayload.mjs";
2
2
  export * from "./Agent.mjs";
3
+ export * from "./AgentIntegration.mjs";
4
+ export * from "./ApiKeyWithSecret.mjs";
3
5
  export * from "./AssistantChoseNotToRespondPayload.mjs";
4
6
  export * from "./AssistantEndedConversationPayload.mjs";
5
7
  export * from "./AssistantFinishedSpeakingPayload.mjs";
@@ -15,6 +17,7 @@ export * from "./ConversationAnalysis.mjs";
15
17
  export * from "./ConversationCreatedPayload.mjs";
16
18
  export * from "./ConversationEval.mjs";
17
19
  export * from "./ConversationEvalPrompt.mjs";
20
+ export * from "./ConversationEvalPromptInfo.mjs";
18
21
  export * from "./ConversationEvaluation.mjs";
19
22
  export * from "./ConversationEvaluationResult.mjs";
20
23
  export * from "./ConversationExtraction.mjs";
@@ -23,6 +26,7 @@ export * from "./ConversationsListResponseConversation.mjs";
23
26
  export * from "./ConversationsListResponseConversations.mjs";
24
27
  export * from "./ConversationsListResponseConversationsPagination.mjs";
25
28
  export * from "./CreateAgentRequest.mjs";
29
+ export * from "./DataRetentionPolicy.mjs";
26
30
  export * from "./DtmfPayload.mjs";
27
31
  export * from "./Error_.mjs";
28
32
  export * from "./ErrorPayload.mjs";
@@ -40,6 +44,7 @@ export * from "./OpenAiTool.mjs";
40
44
  export * from "./OutboundCallConfig.mjs";
41
45
  export * from "./OutboundCallInitiatedResponse.mjs";
42
46
  export * from "./OutboundDryRunResponse.mjs";
47
+ export * from "./OutboundNumberPool.mjs";
43
48
  export * from "./Project.mjs";
44
49
  export * from "./ReadyToStartConversationPayload.mjs";
45
50
  export * from "./ReplayConversationItemResponse.mjs";
@@ -1,5 +1,7 @@
1
1
  export * from "./AddSystemMessagePayload.mjs";
2
2
  export * from "./Agent.mjs";
3
+ export * from "./AgentIntegration.mjs";
4
+ export * from "./ApiKeyWithSecret.mjs";
3
5
  export * from "./AssistantChoseNotToRespondPayload.mjs";
4
6
  export * from "./AssistantEndedConversationPayload.mjs";
5
7
  export * from "./AssistantFinishedSpeakingPayload.mjs";
@@ -15,6 +17,7 @@ export * from "./ConversationAnalysis.mjs";
15
17
  export * from "./ConversationCreatedPayload.mjs";
16
18
  export * from "./ConversationEval.mjs";
17
19
  export * from "./ConversationEvalPrompt.mjs";
20
+ export * from "./ConversationEvalPromptInfo.mjs";
18
21
  export * from "./ConversationEvaluation.mjs";
19
22
  export * from "./ConversationEvaluationResult.mjs";
20
23
  export * from "./ConversationExtraction.mjs";
@@ -23,6 +26,7 @@ export * from "./ConversationsListResponseConversation.mjs";
23
26
  export * from "./ConversationsListResponseConversations.mjs";
24
27
  export * from "./ConversationsListResponseConversationsPagination.mjs";
25
28
  export * from "./CreateAgentRequest.mjs";
29
+ export * from "./DataRetentionPolicy.mjs";
26
30
  export * from "./DtmfPayload.mjs";
27
31
  export * from "./Error_.mjs";
28
32
  export * from "./ErrorPayload.mjs";
@@ -40,6 +44,7 @@ export * from "./OpenAiTool.mjs";
40
44
  export * from "./OutboundCallConfig.mjs";
41
45
  export * from "./OutboundCallInitiatedResponse.mjs";
42
46
  export * from "./OutboundDryRunResponse.mjs";
47
+ export * from "./OutboundNumberPool.mjs";
43
48
  export * from "./Project.mjs";
44
49
  export * from "./ReadyToStartConversationPayload.mjs";
45
50
  export * from "./ReplayConversationItemResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.32.1";
1
+ export declare const SDK_VERSION = "0.32.3";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.32.1";
1
+ export const SDK_VERSION = "0.32.3";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phonic",
3
- "version": "0.32.1",
3
+ "version": "0.32.3",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -78,6 +78,17 @@
78
78
  },
79
79
  "default": "./dist/cjs/api/resources/workspace/exports.js"
80
80
  },
81
+ "./apiKeys": {
82
+ "import": {
83
+ "types": "./dist/esm/api/resources/apiKeys/exports.d.mts",
84
+ "default": "./dist/esm/api/resources/apiKeys/exports.mjs"
85
+ },
86
+ "require": {
87
+ "types": "./dist/cjs/api/resources/apiKeys/exports.d.ts",
88
+ "default": "./dist/cjs/api/resources/apiKeys/exports.js"
89
+ },
90
+ "default": "./dist/cjs/api/resources/apiKeys/exports.js"
91
+ },
81
92
  "./conversationItems": {
82
93
  "import": {
83
94
  "types": "./dist/esm/api/resources/conversationItems/exports.d.mts",