phonic 0.32.10 → 0.32.12
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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +17 -12
- package/dist/cjs/api/resources/agents/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/agents/client/Client.js +3 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.ts +10 -7
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +4 -0
- package/dist/cjs/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +5 -1
- package/dist/cjs/api/resources/externalStoragePolicies/client/Client.d.ts +117 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/Client.js +427 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/index.js +17 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.d.ts +43 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.js +13 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.d.ts +10 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.d.ts +10 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.d.ts +10 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.d.ts +37 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.js +13 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/index.d.ts +5 -0
- package/dist/cjs/api/resources/externalStoragePolicies/client/requests/index.js +7 -0
- package/dist/cjs/api/resources/externalStoragePolicies/exports.d.ts +2 -0
- package/dist/cjs/api/resources/externalStoragePolicies/exports.js +21 -0
- package/dist/cjs/api/resources/externalStoragePolicies/index.d.ts +2 -0
- package/dist/cjs/api/resources/externalStoragePolicies/index.js +18 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.d.ts +6 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.d.ts +4 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.d.ts +4 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.d.ts +4 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.d.ts +4 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.js +3 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/index.d.ts +5 -0
- package/dist/cjs/api/resources/externalStoragePolicies/types/index.js +21 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +13 -1
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +9 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +10 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +6 -0
- package/dist/cjs/api/types/Agent.d.ts +4 -0
- package/dist/cjs/api/types/AudioChunkPayload.d.ts +1 -1
- package/dist/cjs/api/types/BuiltInToolConfig.d.ts +16 -0
- package/dist/cjs/api/types/BuiltInToolConfig.js +13 -0
- package/dist/cjs/api/types/BuiltInToolConfigs.d.ts +5 -0
- package/dist/cjs/api/types/BuiltInToolConfigs.js +3 -0
- package/dist/cjs/api/types/BuiltInToolDefinition.d.ts +18 -0
- package/dist/cjs/api/types/BuiltInToolDefinition.js +12 -0
- package/dist/cjs/api/types/ConfigOptions.d.ts +4 -2
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +5 -1
- package/dist/cjs/api/types/ExternalStoragePolicy.d.ts +30 -0
- package/dist/cjs/api/types/ExternalStoragePolicy.js +13 -0
- package/dist/cjs/api/types/GenerateReplyPayload.d.ts +2 -0
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +1 -1
- package/dist/cjs/api/types/Tool.d.ts +12 -0
- package/dist/cjs/api/types/Tool.js +9 -0
- package/dist/cjs/api/types/ToolDefinition.d.ts +1 -1
- package/dist/cjs/api/types/index.d.ts +4 -0
- package/dist/cjs/api/types/index.js +4 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +3 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsAddCustomPhoneNumberRequest.d.mts +10 -7
- package/dist/esm/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +4 -0
- package/dist/esm/api/resources/agents/client/requests/AgentsUpdatePhoneNumberRequest.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +5 -1
- package/dist/esm/api/resources/externalStoragePolicies/client/Client.d.mts +117 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/Client.mjs +390 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/index.d.mts +1 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/index.mjs +1 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.d.mts +43 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/CreateExternalStoragePolicyRequest.mjs +10 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.d.mts +10 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesDeleteRequest.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.d.mts +10 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesGetRequest.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.d.mts +10 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/ExternalStoragePoliciesListRequest.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.d.mts +37 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/UpdateExternalStoragePolicyRequest.mjs +10 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/index.d.mts +5 -0
- package/dist/esm/api/resources/externalStoragePolicies/client/requests/index.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/exports.d.mts +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/exports.mjs +3 -0
- package/dist/esm/api/resources/externalStoragePolicies/index.d.mts +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/index.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.d.mts +6 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesCreateResponse.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.d.mts +4 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesDeleteResponse.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.d.mts +4 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesGetResponse.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.d.mts +4 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesListResponse.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.d.mts +4 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/ExternalStoragePoliciesUpdateResponse.mjs +2 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/index.d.mts +5 -0
- package/dist/esm/api/resources/externalStoragePolicies/types/index.mjs +5 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +13 -1
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +9 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +10 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +6 -0
- package/dist/esm/api/types/Agent.d.mts +4 -0
- package/dist/esm/api/types/AudioChunkPayload.d.mts +1 -1
- package/dist/esm/api/types/BuiltInToolConfig.d.mts +16 -0
- package/dist/esm/api/types/BuiltInToolConfig.mjs +10 -0
- package/dist/esm/api/types/BuiltInToolConfigs.d.mts +5 -0
- package/dist/esm/api/types/BuiltInToolConfigs.mjs +2 -0
- package/dist/esm/api/types/BuiltInToolDefinition.d.mts +18 -0
- package/dist/esm/api/types/BuiltInToolDefinition.mjs +9 -0
- package/dist/esm/api/types/ConfigOptions.d.mts +4 -2
- package/dist/esm/api/types/CreateAgentRequest.d.mts +5 -1
- package/dist/esm/api/types/ExternalStoragePolicy.d.mts +30 -0
- package/dist/esm/api/types/ExternalStoragePolicy.mjs +10 -0
- package/dist/esm/api/types/GenerateReplyPayload.d.mts +2 -0
- package/dist/esm/api/types/OutboundCallConfig.d.mts +1 -1
- package/dist/esm/api/types/Tool.d.mts +12 -0
- package/dist/esm/api/types/Tool.mjs +9 -0
- package/dist/esm/api/types/ToolDefinition.d.mts +1 -1
- package/dist/esm/api/types/index.d.mts +4 -0
- package/dist/esm/api/types/index.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +12 -1
- package/reference.md +363 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./ExternalStoragePoliciesCreateResponse.mjs";
|
|
2
|
+
export * from "./ExternalStoragePoliciesDeleteResponse.mjs";
|
|
3
|
+
export * from "./ExternalStoragePoliciesGetResponse.mjs";
|
|
4
|
+
export * from "./ExternalStoragePoliciesListResponse.mjs";
|
|
5
|
+
export * from "./ExternalStoragePoliciesUpdateResponse.mjs";
|
|
@@ -12,6 +12,9 @@ export * as conversationItems from "./conversationItems/index.mjs";
|
|
|
12
12
|
export * from "./conversations/client/requests/index.mjs";
|
|
13
13
|
export * as conversations from "./conversations/index.mjs";
|
|
14
14
|
export * from "./conversations/types/index.mjs";
|
|
15
|
+
export * from "./externalStoragePolicies/client/requests/index.mjs";
|
|
16
|
+
export * as externalStoragePolicies from "./externalStoragePolicies/index.mjs";
|
|
17
|
+
export * from "./externalStoragePolicies/types/index.mjs";
|
|
15
18
|
export * from "./extractionSchemas/client/requests/index.mjs";
|
|
16
19
|
export * as extractionSchemas from "./extractionSchemas/index.mjs";
|
|
17
20
|
export * from "./extractionSchemas/types/index.mjs";
|
|
@@ -12,6 +12,9 @@ export * as conversationItems from "./conversationItems/index.mjs";
|
|
|
12
12
|
export * from "./conversations/client/requests/index.mjs";
|
|
13
13
|
export * as conversations from "./conversations/index.mjs";
|
|
14
14
|
export * from "./conversations/types/index.mjs";
|
|
15
|
+
export * from "./externalStoragePolicies/client/requests/index.mjs";
|
|
16
|
+
export * as externalStoragePolicies from "./externalStoragePolicies/index.mjs";
|
|
17
|
+
export * from "./externalStoragePolicies/types/index.mjs";
|
|
15
18
|
export * from "./extractionSchemas/client/requests/index.mjs";
|
|
16
19
|
export * as extractionSchemas from "./extractionSchemas/index.mjs";
|
|
17
20
|
export * from "./extractionSchemas/types/index.mjs";
|
|
@@ -119,7 +119,7 @@ export interface CreateToolRequest {
|
|
|
119
119
|
parameters?: Phonic.ToolParameter[];
|
|
120
120
|
/** Required for webhook tools. HTTP method for the webhook endpoint. */
|
|
121
121
|
endpoint_method?: CreateToolRequest.EndpointMethod;
|
|
122
|
-
/** Required for webhook tools. */
|
|
122
|
+
/** Required for webhook tools. Must be a publicly routable HTTPS URL without embedded credentials. */
|
|
123
123
|
endpoint_url?: string;
|
|
124
124
|
/** Optional headers for webhook tools. */
|
|
125
125
|
endpoint_headers?: Record<string, string>;
|
|
@@ -141,6 +141,8 @@ export interface CreateToolRequest {
|
|
|
141
141
|
agents_to_transfer_to?: string[];
|
|
142
142
|
/** When true, forces the agent to speak before executing the tool. */
|
|
143
143
|
require_speech_before_tool_call?: boolean;
|
|
144
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
145
|
+
speech_before_tool_call?: CreateToolRequest.SpeechBeforeToolCall;
|
|
144
146
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
145
147
|
wait_for_speech_before_tool_call?: boolean;
|
|
146
148
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -160,6 +162,9 @@ export declare namespace CreateToolRequest {
|
|
|
160
162
|
readonly CustomWebsocket: "custom_websocket";
|
|
161
163
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
162
164
|
readonly BuiltInTransferToAgent: "built_in_transfer_to_agent";
|
|
165
|
+
readonly BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending";
|
|
166
|
+
readonly BuiltInKeypadInput: "built_in_keypad_input";
|
|
167
|
+
readonly BuiltInChooseNotToRespond: "built_in_choose_not_to_respond";
|
|
163
168
|
};
|
|
164
169
|
type Type = (typeof Type)[keyof typeof Type];
|
|
165
170
|
/** Mode of operation. */
|
|
@@ -174,4 +179,11 @@ export declare namespace CreateToolRequest {
|
|
|
174
179
|
readonly Post: "POST";
|
|
175
180
|
};
|
|
176
181
|
type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
|
|
182
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
183
|
+
const SpeechBeforeToolCall: {
|
|
184
|
+
readonly Required: "required";
|
|
185
|
+
readonly Optional: "optional";
|
|
186
|
+
readonly Suppressed: "suppressed";
|
|
187
|
+
};
|
|
188
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
177
189
|
}
|
|
@@ -8,6 +8,9 @@ export var CreateToolRequest;
|
|
|
8
8
|
CustomWebsocket: "custom_websocket",
|
|
9
9
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
10
10
|
BuiltInTransferToAgent: "built_in_transfer_to_agent",
|
|
11
|
+
BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending",
|
|
12
|
+
BuiltInKeypadInput: "built_in_keypad_input",
|
|
13
|
+
BuiltInChooseNotToRespond: "built_in_choose_not_to_respond",
|
|
11
14
|
};
|
|
12
15
|
/** Mode of operation. */
|
|
13
16
|
CreateToolRequest.ExecutionMode = {
|
|
@@ -19,4 +22,10 @@ export var CreateToolRequest;
|
|
|
19
22
|
Get: "GET",
|
|
20
23
|
Post: "POST",
|
|
21
24
|
};
|
|
25
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
26
|
+
CreateToolRequest.SpeechBeforeToolCall = {
|
|
27
|
+
Required: "required",
|
|
28
|
+
Optional: "optional",
|
|
29
|
+
Suppressed: "suppressed",
|
|
30
|
+
};
|
|
22
31
|
})(CreateToolRequest || (CreateToolRequest = {}));
|
|
@@ -30,6 +30,7 @@ export interface UpdateToolRequest {
|
|
|
30
30
|
parameters?: Phonic.ToolParameter[];
|
|
31
31
|
/** HTTP method for webhook tools. When changing this value, all parameters must include explicit `location` values. */
|
|
32
32
|
endpoint_method?: UpdateToolRequest.EndpointMethod;
|
|
33
|
+
/** URL for webhook tools. Must be a publicly routable HTTPS URL without embedded credentials. */
|
|
33
34
|
endpoint_url?: string;
|
|
34
35
|
/** Headers for webhook tools. Set to null to clear existing headers. */
|
|
35
36
|
endpoint_headers?: Record<string, string | null> | null;
|
|
@@ -49,6 +50,8 @@ export interface UpdateToolRequest {
|
|
|
49
50
|
agents_to_transfer_to?: string[];
|
|
50
51
|
/** When true, forces the agent to speak before executing the tool. */
|
|
51
52
|
require_speech_before_tool_call?: boolean;
|
|
53
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
54
|
+
speech_before_tool_call?: UpdateToolRequest.SpeechBeforeToolCall;
|
|
52
55
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
53
56
|
wait_for_speech_before_tool_call?: boolean;
|
|
54
57
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -71,4 +74,11 @@ export declare namespace UpdateToolRequest {
|
|
|
71
74
|
readonly Post: "POST";
|
|
72
75
|
};
|
|
73
76
|
type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
|
|
77
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
78
|
+
const SpeechBeforeToolCall: {
|
|
79
|
+
readonly Required: "required";
|
|
80
|
+
readonly Optional: "optional";
|
|
81
|
+
readonly Suppressed: "suppressed";
|
|
82
|
+
};
|
|
83
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
74
84
|
}
|
|
@@ -11,4 +11,10 @@ export var UpdateToolRequest;
|
|
|
11
11
|
Get: "GET",
|
|
12
12
|
Post: "POST",
|
|
13
13
|
};
|
|
14
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
15
|
+
UpdateToolRequest.SpeechBeforeToolCall = {
|
|
16
|
+
Required: "required",
|
|
17
|
+
Optional: "optional",
|
|
18
|
+
Suppressed: "suppressed",
|
|
19
|
+
};
|
|
14
20
|
})(UpdateToolRequest || (UpdateToolRequest = {}));
|
|
@@ -36,6 +36,8 @@ export interface Agent {
|
|
|
36
36
|
template_variables: Record<string, Agent.TemplateVariables.Value>;
|
|
37
37
|
/** List of tools available to the agent. */
|
|
38
38
|
tools: Agent.Tools.Item[];
|
|
39
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. */
|
|
40
|
+
built_in_tool_configs: Phonic.BuiltInToolConfigs;
|
|
39
41
|
/** Tasks for the agent to complete during the conversation. */
|
|
40
42
|
tasks: Phonic.Task[];
|
|
41
43
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -62,6 +64,8 @@ export interface Agent {
|
|
|
62
64
|
boosted_keywords: string[];
|
|
63
65
|
/** Names of observability integrations enabled for the agent. Each must be one of the supported providers. */
|
|
64
66
|
observability_integrations?: "braintrust"[] | undefined;
|
|
67
|
+
/** Name of the external storage policy that conversation artifacts are delivered to. `null` when the agent doesn't deliver artifacts to external storage. */
|
|
68
|
+
external_storage_policy?: (string | null) | undefined;
|
|
65
69
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
66
70
|
pronunciation_dictionary: Agent.PronunciationDictionary.Item[];
|
|
67
71
|
/** Minimum number of words required to interrupt the assistant. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface AudioChunkPayload {
|
|
2
2
|
type: "audio_chunk";
|
|
3
|
-
/** Base64-encoded audio data (Int16Array for PCM, Uint8Array for mulaw) */
|
|
3
|
+
/** Base64-encoded audio data (Int16Array for PCM, Uint8Array for mulaw). Each chunk may contain at most 40 ms of audio — longer chunks are rejected with an error. Batch ~20 ms frames for headroom. */
|
|
4
4
|
audio: string;
|
|
5
5
|
/** ISO 8601 timestamp (required for first chunk only) */
|
|
6
6
|
iso_date_time?: string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for a simple built-in tool (`keypad_input`, `natural_conversation_ending`, or `choose_not_to_respond`).
|
|
3
|
+
*/
|
|
4
|
+
export interface BuiltInToolConfig {
|
|
5
|
+
/** Controls whether the assistant speaks before the tool is called. `required`: the assistant must speak first. `optional`: the model decides. `suppressed`: the assistant is strongly instructed to stay silent before the call (best effort). */
|
|
6
|
+
speech_before_tool_call: BuiltInToolConfig.SpeechBeforeToolCall;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace BuiltInToolConfig {
|
|
9
|
+
/** Controls whether the assistant speaks before the tool is called. `required`: the assistant must speak first. `optional`: the model decides. `suppressed`: the assistant is strongly instructed to stay silent before the call (best effort). */
|
|
10
|
+
const SpeechBeforeToolCall: {
|
|
11
|
+
readonly Required: "required";
|
|
12
|
+
readonly Optional: "optional";
|
|
13
|
+
readonly Suppressed: "suppressed";
|
|
14
|
+
};
|
|
15
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
16
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var BuiltInToolConfig;
|
|
3
|
+
(function (BuiltInToolConfig) {
|
|
4
|
+
/** Controls whether the assistant speaks before the tool is called. `required`: the assistant must speak first. `optional`: the model decides. `suppressed`: the assistant is strongly instructed to stay silent before the call (best effort). */
|
|
5
|
+
BuiltInToolConfig.SpeechBeforeToolCall = {
|
|
6
|
+
Required: "required",
|
|
7
|
+
Optional: "optional",
|
|
8
|
+
Suppressed: "suppressed",
|
|
9
|
+
};
|
|
10
|
+
})(BuiltInToolConfig || (BuiltInToolConfig = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Phonic from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Per-tool configuration overrides for built-in tools, keyed by built-in tool ID (e.g. `tool_natural_conversation_ending`). A built-in tool referenced in `tools` but absent from this map uses its default configuration.
|
|
4
|
+
*/
|
|
5
|
+
export type BuiltInToolConfigs = Record<string, Phonic.BuiltInToolConfig>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as Phonic from "../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* A built-in tool with an explicit configuration, as an alternative to referencing it by bare name (which uses the tool's default configuration). Only `keypad_input` and `natural_conversation_ending` accept configuration this way.
|
|
4
|
+
*/
|
|
5
|
+
export interface BuiltInToolDefinition {
|
|
6
|
+
type: "built_in";
|
|
7
|
+
/** The name of the built-in tool. */
|
|
8
|
+
name: BuiltInToolDefinition.Name;
|
|
9
|
+
tool_config: Phonic.BuiltInToolConfig;
|
|
10
|
+
}
|
|
11
|
+
export declare namespace BuiltInToolDefinition {
|
|
12
|
+
/** The name of the built-in tool. */
|
|
13
|
+
const Name: {
|
|
14
|
+
readonly KeypadInput: "keypad_input";
|
|
15
|
+
readonly NaturalConversationEnding: "natural_conversation_ending";
|
|
16
|
+
};
|
|
17
|
+
type Name = (typeof Name)[keyof typeof Name];
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var BuiltInToolDefinition;
|
|
3
|
+
(function (BuiltInToolDefinition) {
|
|
4
|
+
/** The name of the built-in tool. */
|
|
5
|
+
BuiltInToolDefinition.Name = {
|
|
6
|
+
KeypadInput: "keypad_input",
|
|
7
|
+
NaturalConversationEnding: "natural_conversation_ending",
|
|
8
|
+
};
|
|
9
|
+
})(BuiltInToolDefinition || (BuiltInToolDefinition = {}));
|
|
@@ -65,7 +65,7 @@ export interface ConfigOptions {
|
|
|
65
65
|
boosted_keywords?: string[] | undefined;
|
|
66
66
|
/** Array of `{ word, pronunciation }` entries. Words must be unique. */
|
|
67
67
|
pronunciation_dictionary?: ConfigOptions.PronunciationDictionary.Item[] | undefined;
|
|
68
|
-
/** Tools available to the assistant. Use a string to reference a pre-defined tool by name, or define an inline WebSocket tool for this conversation. */
|
|
68
|
+
/** Tools available to the assistant. Use a string to reference a pre-defined tool by name, provide a built-in tool object to override its default configuration, or define an inline WebSocket tool for this conversation. */
|
|
69
69
|
tools?: Phonic.ToolDefinition[] | undefined;
|
|
70
70
|
/** Template variables for system prompt and welcome message */
|
|
71
71
|
template_variables?: Record<string, string> | undefined;
|
|
@@ -75,6 +75,8 @@ export interface ConfigOptions {
|
|
|
75
75
|
mcp_servers?: string[] | undefined;
|
|
76
76
|
/** Names of observability integrations to enable for the conversation. Each must be one of the supported providers. */
|
|
77
77
|
observability_integrations?: "braintrust"[] | undefined;
|
|
78
|
+
/** Name of an external storage policy in the same project that conversation artifacts are delivered to. Requires `data_retention_policy.zero_data_retention` to be `true` and cannot be combined with `enable_redaction`. Set to `null` to disable external delivery. */
|
|
79
|
+
external_storage_policy?: (string | null) | undefined;
|
|
78
80
|
/** Tasks the assistant should accomplish during the conversation. */
|
|
79
81
|
tasks?: ConfigOptions.Tasks.Item[] | undefined;
|
|
80
82
|
/** Pool of phone numbers to use as the caller ID for outbound calls. */
|
|
@@ -161,7 +163,7 @@ export declare namespace ConfigOptions {
|
|
|
161
163
|
* When not `null`, the agent will call this endpoint to get configuration options for the conversation.
|
|
162
164
|
*/
|
|
163
165
|
interface ConfigurationEndpoint {
|
|
164
|
-
/** URL to call. */
|
|
166
|
+
/** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
|
|
165
167
|
url: string;
|
|
166
168
|
/** Object of key-value pairs sent as headers when calling the endpoint. */
|
|
167
169
|
headers?: Record<string, string> | undefined;
|
|
@@ -36,6 +36,8 @@ export interface CreateAgentRequest {
|
|
|
36
36
|
template_variables?: Record<string, CreateAgentRequest.TemplateVariables.Value> | undefined;
|
|
37
37
|
/** Array of built-in or custom tool names to use. */
|
|
38
38
|
tools?: CreateAgentRequest.Tools.Item[] | undefined;
|
|
39
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. Built-in tools not listed here use their default configuration. */
|
|
40
|
+
built_in_tool_configs?: Phonic.BuiltInToolConfigs | undefined;
|
|
39
41
|
/** Array of task objects with `name` and `description` fields. */
|
|
40
42
|
tasks?: Phonic.Task[] | undefined;
|
|
41
43
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -90,6 +92,8 @@ export interface CreateAgentRequest {
|
|
|
90
92
|
mcp_server_ids?: string[] | undefined;
|
|
91
93
|
/** Names of observability integrations to enable for the agent. Each must be one of the supported providers. */
|
|
92
94
|
observability_integrations?: "braintrust"[] | undefined;
|
|
95
|
+
/** Name of an external storage policy in the same project that conversation artifacts are delivered to. Requires zero data retention and cannot be combined with `enable_redaction`. */
|
|
96
|
+
external_storage_policy?: (string | null) | undefined;
|
|
93
97
|
}
|
|
94
98
|
export declare namespace CreateAgentRequest {
|
|
95
99
|
const PhoneNumber: {
|
|
@@ -150,7 +154,7 @@ export declare namespace CreateAgentRequest {
|
|
|
150
154
|
* When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
|
|
151
155
|
*/
|
|
152
156
|
interface ConfigurationEndpoint {
|
|
153
|
-
/** URL to call */
|
|
157
|
+
/** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
|
|
154
158
|
url: string;
|
|
155
159
|
/** Object of key-value pairs. */
|
|
156
160
|
headers?: Record<string, string> | undefined;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An S3-compatible destination that conversation artifacts are delivered to.
|
|
3
|
+
*/
|
|
4
|
+
export interface ExternalStoragePolicy {
|
|
5
|
+
/** The ID of the external storage policy. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The name of the external storage policy. Agents reference the policy by this name. */
|
|
8
|
+
name: string;
|
|
9
|
+
/** The S3-compatible endpoint URL that artifacts are uploaded to. */
|
|
10
|
+
endpoint_url: string;
|
|
11
|
+
/** The bucket that artifacts are uploaded to. */
|
|
12
|
+
bucket: string;
|
|
13
|
+
/** The region of the bucket. `null` when the endpoint doesn't require a region. */
|
|
14
|
+
region: string | null;
|
|
15
|
+
/** Prefix prepended to every object key. `null` when objects are written at the bucket root. */
|
|
16
|
+
key_prefix: string | null;
|
|
17
|
+
/** How bucket names are addressed in requests to the endpoint. */
|
|
18
|
+
addressing_style: ExternalStoragePolicy.AddressingStyle;
|
|
19
|
+
/** Number of agents currently referencing this external storage policy. */
|
|
20
|
+
agent_count: number;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace ExternalStoragePolicy {
|
|
23
|
+
/** How bucket names are addressed in requests to the endpoint. */
|
|
24
|
+
const AddressingStyle: {
|
|
25
|
+
readonly Auto: "auto";
|
|
26
|
+
readonly Virtual: "virtual";
|
|
27
|
+
readonly Path: "path";
|
|
28
|
+
};
|
|
29
|
+
type AddressingStyle = (typeof AddressingStyle)[keyof typeof AddressingStyle];
|
|
30
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var ExternalStoragePolicy;
|
|
3
|
+
(function (ExternalStoragePolicy) {
|
|
4
|
+
/** How bucket names are addressed in requests to the endpoint. */
|
|
5
|
+
ExternalStoragePolicy.AddressingStyle = {
|
|
6
|
+
Auto: "auto",
|
|
7
|
+
Virtual: "virtual",
|
|
8
|
+
Path: "path",
|
|
9
|
+
};
|
|
10
|
+
})(ExternalStoragePolicy || (ExternalStoragePolicy = {}));
|
|
@@ -2,4 +2,6 @@ export interface GenerateReplyPayload {
|
|
|
2
2
|
type: "generate_reply";
|
|
3
3
|
/** Optional system message to guide the assistant's reply */
|
|
4
4
|
system_message?: (string | null) | undefined;
|
|
5
|
+
/** Optional user message for the assistant to reply to */
|
|
6
|
+
user_message?: (string | null) | undefined;
|
|
5
7
|
}
|
|
@@ -113,7 +113,7 @@ export declare namespace OutboundCallConfig {
|
|
|
113
113
|
* When not `null`, at the beginning of the conversation the agent will make a POST request to this endpoint to get configuration options.
|
|
114
114
|
*/
|
|
115
115
|
interface ConfigurationEndpoint {
|
|
116
|
-
/** URL to call */
|
|
116
|
+
/** URL to call. Must be a publicly routable HTTPS URL without embedded credentials. */
|
|
117
117
|
url: string;
|
|
118
118
|
/** Object of key-value pairs. */
|
|
119
119
|
headers?: Record<string, string> | undefined;
|
|
@@ -37,6 +37,8 @@ export interface Tool {
|
|
|
37
37
|
agents_to_transfer_to?: string[] | undefined;
|
|
38
38
|
/** When true, forces the agent to speak before executing the tool. */
|
|
39
39
|
require_speech_before_tool_call?: boolean | undefined;
|
|
40
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
41
|
+
speech_before_tool_call?: Tool.SpeechBeforeToolCall | undefined;
|
|
40
42
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
41
43
|
wait_for_speech_before_tool_call?: boolean | undefined;
|
|
42
44
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -60,6 +62,9 @@ export declare namespace Tool {
|
|
|
60
62
|
readonly CustomWebsocket: "custom_websocket";
|
|
61
63
|
readonly BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number";
|
|
62
64
|
readonly BuiltInTransferToAgent: "built_in_transfer_to_agent";
|
|
65
|
+
readonly BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending";
|
|
66
|
+
readonly BuiltInKeypadInput: "built_in_keypad_input";
|
|
67
|
+
readonly BuiltInChooseNotToRespond: "built_in_choose_not_to_respond";
|
|
63
68
|
};
|
|
64
69
|
type Type = (typeof Type)[keyof typeof Type];
|
|
65
70
|
/** Mode of operation - sync waits for response, async continues without waiting. */
|
|
@@ -74,4 +79,11 @@ export declare namespace Tool {
|
|
|
74
79
|
readonly Post: "POST";
|
|
75
80
|
};
|
|
76
81
|
type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
|
|
82
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
83
|
+
const SpeechBeforeToolCall: {
|
|
84
|
+
readonly Required: "required";
|
|
85
|
+
readonly Optional: "optional";
|
|
86
|
+
readonly Suppressed: "suppressed";
|
|
87
|
+
};
|
|
88
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
77
89
|
}
|
|
@@ -8,6 +8,9 @@ export var Tool;
|
|
|
8
8
|
CustomWebsocket: "custom_websocket",
|
|
9
9
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
10
10
|
BuiltInTransferToAgent: "built_in_transfer_to_agent",
|
|
11
|
+
BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending",
|
|
12
|
+
BuiltInKeypadInput: "built_in_keypad_input",
|
|
13
|
+
BuiltInChooseNotToRespond: "built_in_choose_not_to_respond",
|
|
11
14
|
};
|
|
12
15
|
/** Mode of operation - sync waits for response, async continues without waiting. */
|
|
13
16
|
Tool.ExecutionMode = {
|
|
@@ -19,4 +22,10 @@ export var Tool;
|
|
|
19
22
|
Get: "GET",
|
|
20
23
|
Post: "POST",
|
|
21
24
|
};
|
|
25
|
+
/** For built_in_natural_conversation_ending and built_in_keypad_input tools. Whether the agent must speak before calling the tool ("required"), the model decides ("optional"), or the agent must stay silent ("suppressed"). Not used by other tool types. */
|
|
26
|
+
Tool.SpeechBeforeToolCall = {
|
|
27
|
+
Required: "required",
|
|
28
|
+
Optional: "optional",
|
|
29
|
+
Suppressed: "suppressed",
|
|
30
|
+
};
|
|
22
31
|
})(Tool || (Tool = {}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type * as Phonic from "../index.mjs";
|
|
2
|
-
export type ToolDefinition = Phonic.ToolName | Phonic.InlineWebSocketTool;
|
|
2
|
+
export type ToolDefinition = Phonic.ToolName | Phonic.BuiltInToolDefinition | Phonic.InlineWebSocketTool;
|
|
@@ -10,6 +10,9 @@ export * from "./AudioChunkPayload.mjs";
|
|
|
10
10
|
export * from "./AudioChunkResponsePayload.mjs";
|
|
11
11
|
export * from "./BadRequestErrorBody.mjs";
|
|
12
12
|
export * from "./BasicError.mjs";
|
|
13
|
+
export * from "./BuiltInToolConfig.mjs";
|
|
14
|
+
export * from "./BuiltInToolConfigs.mjs";
|
|
15
|
+
export * from "./BuiltInToolDefinition.mjs";
|
|
13
16
|
export * from "./ConfigOptions.mjs";
|
|
14
17
|
export * from "./ConfigPayload.mjs";
|
|
15
18
|
export * from "./Conversation.mjs";
|
|
@@ -30,6 +33,7 @@ export * from "./DataRetentionPolicy.mjs";
|
|
|
30
33
|
export * from "./DtmfPayload.mjs";
|
|
31
34
|
export * from "./Error_.mjs";
|
|
32
35
|
export * from "./ErrorPayload.mjs";
|
|
36
|
+
export * from "./ExternalStoragePolicy.mjs";
|
|
33
37
|
export * from "./ExtractionField.mjs";
|
|
34
38
|
export * from "./ExtractionSchema.mjs";
|
|
35
39
|
export * from "./GenerateReplyPayload.mjs";
|
|
@@ -10,6 +10,9 @@ export * from "./AudioChunkPayload.mjs";
|
|
|
10
10
|
export * from "./AudioChunkResponsePayload.mjs";
|
|
11
11
|
export * from "./BadRequestErrorBody.mjs";
|
|
12
12
|
export * from "./BasicError.mjs";
|
|
13
|
+
export * from "./BuiltInToolConfig.mjs";
|
|
14
|
+
export * from "./BuiltInToolConfigs.mjs";
|
|
15
|
+
export * from "./BuiltInToolDefinition.mjs";
|
|
13
16
|
export * from "./ConfigOptions.mjs";
|
|
14
17
|
export * from "./ConfigPayload.mjs";
|
|
15
18
|
export * from "./Conversation.mjs";
|
|
@@ -30,6 +33,7 @@ export * from "./DataRetentionPolicy.mjs";
|
|
|
30
33
|
export * from "./DtmfPayload.mjs";
|
|
31
34
|
export * from "./Error_.mjs";
|
|
32
35
|
export * from "./ErrorPayload.mjs";
|
|
36
|
+
export * from "./ExternalStoragePolicy.mjs";
|
|
33
37
|
export * from "./ExtractionField.mjs";
|
|
34
38
|
export * from "./ExtractionSchema.mjs";
|
|
35
39
|
export * from "./GenerateReplyPayload.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.32.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.12";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.32.
|
|
1
|
+
export const SDK_VERSION = "0.32.12";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "phonic",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,6 +45,17 @@
|
|
|
45
45
|
},
|
|
46
46
|
"default": "./dist/cjs/api/resources/tools/exports.js"
|
|
47
47
|
},
|
|
48
|
+
"./externalStoragePolicies": {
|
|
49
|
+
"import": {
|
|
50
|
+
"types": "./dist/esm/api/resources/externalStoragePolicies/exports.d.mts",
|
|
51
|
+
"default": "./dist/esm/api/resources/externalStoragePolicies/exports.mjs"
|
|
52
|
+
},
|
|
53
|
+
"require": {
|
|
54
|
+
"types": "./dist/cjs/api/resources/externalStoragePolicies/exports.d.ts",
|
|
55
|
+
"default": "./dist/cjs/api/resources/externalStoragePolicies/exports.js"
|
|
56
|
+
},
|
|
57
|
+
"default": "./dist/cjs/api/resources/externalStoragePolicies/exports.js"
|
|
58
|
+
},
|
|
48
59
|
"./extractionSchemas": {
|
|
49
60
|
"import": {
|
|
50
61
|
"types": "./dist/esm/api/resources/extractionSchemas/exports.d.mts",
|