phonic 0.32.10 → 0.32.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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/agents/client/requests/AgentsCreateRequest.d.ts +2 -0
- package/dist/cjs/api/resources/agents/client/requests/UpdateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +12 -0
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.js +9 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +9 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.js +6 -0
- package/dist/cjs/api/types/Agent.d.ts +2 -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 +1 -1
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +2 -0
- package/dist/cjs/api/types/GenerateReplyPayload.d.ts +2 -0
- 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 +3 -0
- package/dist/cjs/api/types/index.js +3 -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/api/resources/agents/client/requests/AgentsCreateRequest.d.mts +2 -0
- package/dist/esm/api/resources/agents/client/requests/UpdateAgentRequest.d.mts +2 -0
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +12 -0
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.mjs +9 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +9 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.mjs +6 -0
- package/dist/esm/api/types/Agent.d.mts +2 -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 +1 -1
- package/dist/esm/api/types/CreateAgentRequest.d.mts +2 -0
- package/dist/esm/api/types/GenerateReplyPayload.d.mts +2 -0
- 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 +3 -0
- package/dist/esm/api/types/index.mjs +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "phonic",
|
|
46
|
-
"X-Fern-SDK-Version": "0.32.
|
|
47
|
-
"User-Agent": "phonic/0.32.
|
|
46
|
+
"X-Fern-SDK-Version": "0.32.11",
|
|
47
|
+
"User-Agent": "phonic/0.32.11",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -83,6 +83,8 @@ export interface AgentsCreateRequest {
|
|
|
83
83
|
template_variables?: Record<string, Phonic.CreateAgentRequest.TemplateVariables.Value>;
|
|
84
84
|
/** Array of built-in or custom tool names to use. */
|
|
85
85
|
tools?: Phonic.CreateAgentRequest.Tools.Item[];
|
|
86
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. Built-in tools not listed here use their default configuration. */
|
|
87
|
+
built_in_tool_configs?: Phonic.BuiltInToolConfigs;
|
|
86
88
|
/** Array of task objects with `name` and `description` fields. */
|
|
87
89
|
tasks?: Phonic.Task[];
|
|
88
90
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -83,6 +83,8 @@ export interface UpdateAgentRequest {
|
|
|
83
83
|
template_variables?: Record<string, UpdateAgentRequest.TemplateVariables.Value>;
|
|
84
84
|
/** Array of built-in or custom tool names to use. */
|
|
85
85
|
tools?: UpdateAgentRequest.Tools.Item[];
|
|
86
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. Built-in tools not listed here use their default configuration. */
|
|
87
|
+
built_in_tool_configs?: Phonic.BuiltInToolConfigs;
|
|
86
88
|
/** Array of task objects with `name` and `description` fields. */
|
|
87
89
|
tasks?: Phonic.Task[];
|
|
88
90
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -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
|
}
|
|
@@ -11,6 +11,9 @@ var CreateToolRequest;
|
|
|
11
11
|
CustomWebsocket: "custom_websocket",
|
|
12
12
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
13
13
|
BuiltInTransferToAgent: "built_in_transfer_to_agent",
|
|
14
|
+
BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending",
|
|
15
|
+
BuiltInKeypadInput: "built_in_keypad_input",
|
|
16
|
+
BuiltInChooseNotToRespond: "built_in_choose_not_to_respond",
|
|
14
17
|
};
|
|
15
18
|
/** Mode of operation. */
|
|
16
19
|
CreateToolRequest.ExecutionMode = {
|
|
@@ -22,4 +25,10 @@ var CreateToolRequest;
|
|
|
22
25
|
Get: "GET",
|
|
23
26
|
Post: "POST",
|
|
24
27
|
};
|
|
28
|
+
/** 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. */
|
|
29
|
+
CreateToolRequest.SpeechBeforeToolCall = {
|
|
30
|
+
Required: "required",
|
|
31
|
+
Optional: "optional",
|
|
32
|
+
Suppressed: "suppressed",
|
|
33
|
+
};
|
|
25
34
|
})(CreateToolRequest || (exports.CreateToolRequest = CreateToolRequest = {}));
|
|
@@ -49,6 +49,8 @@ export interface UpdateToolRequest {
|
|
|
49
49
|
agents_to_transfer_to?: string[];
|
|
50
50
|
/** When true, forces the agent to speak before executing the tool. */
|
|
51
51
|
require_speech_before_tool_call?: boolean;
|
|
52
|
+
/** 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. */
|
|
53
|
+
speech_before_tool_call?: UpdateToolRequest.SpeechBeforeToolCall;
|
|
52
54
|
/** 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
55
|
wait_for_speech_before_tool_call?: boolean;
|
|
54
56
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -71,4 +73,11 @@ export declare namespace UpdateToolRequest {
|
|
|
71
73
|
readonly Post: "POST";
|
|
72
74
|
};
|
|
73
75
|
type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
|
|
76
|
+
/** 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. */
|
|
77
|
+
const SpeechBeforeToolCall: {
|
|
78
|
+
readonly Required: "required";
|
|
79
|
+
readonly Optional: "optional";
|
|
80
|
+
readonly Suppressed: "suppressed";
|
|
81
|
+
};
|
|
82
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
74
83
|
}
|
|
@@ -14,4 +14,10 @@ var UpdateToolRequest;
|
|
|
14
14
|
Get: "GET",
|
|
15
15
|
Post: "POST",
|
|
16
16
|
};
|
|
17
|
+
/** 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. */
|
|
18
|
+
UpdateToolRequest.SpeechBeforeToolCall = {
|
|
19
|
+
Required: "required",
|
|
20
|
+
Optional: "optional",
|
|
21
|
+
Suppressed: "suppressed",
|
|
22
|
+
};
|
|
17
23
|
})(UpdateToolRequest || (exports.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. */
|
|
@@ -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,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BuiltInToolConfig = void 0;
|
|
5
|
+
var BuiltInToolConfig;
|
|
6
|
+
(function (BuiltInToolConfig) {
|
|
7
|
+
/** 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). */
|
|
8
|
+
BuiltInToolConfig.SpeechBeforeToolCall = {
|
|
9
|
+
Required: "required",
|
|
10
|
+
Optional: "optional",
|
|
11
|
+
Suppressed: "suppressed",
|
|
12
|
+
};
|
|
13
|
+
})(BuiltInToolConfig || (exports.BuiltInToolConfig = BuiltInToolConfig = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type * as Phonic from "../index.js";
|
|
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.js";
|
|
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,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BuiltInToolDefinition = void 0;
|
|
5
|
+
var BuiltInToolDefinition;
|
|
6
|
+
(function (BuiltInToolDefinition) {
|
|
7
|
+
/** The name of the built-in tool. */
|
|
8
|
+
BuiltInToolDefinition.Name = {
|
|
9
|
+
KeypadInput: "keypad_input",
|
|
10
|
+
NaturalConversationEnding: "natural_conversation_ending",
|
|
11
|
+
};
|
|
12
|
+
})(BuiltInToolDefinition || (exports.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;
|
|
@@ -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. */
|
|
@@ -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
|
}
|
|
@@ -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
|
}
|
|
@@ -11,6 +11,9 @@ var Tool;
|
|
|
11
11
|
CustomWebsocket: "custom_websocket",
|
|
12
12
|
BuiltInTransferToPhoneNumber: "built_in_transfer_to_phone_number",
|
|
13
13
|
BuiltInTransferToAgent: "built_in_transfer_to_agent",
|
|
14
|
+
BuiltInNaturalConversationEnding: "built_in_natural_conversation_ending",
|
|
15
|
+
BuiltInKeypadInput: "built_in_keypad_input",
|
|
16
|
+
BuiltInChooseNotToRespond: "built_in_choose_not_to_respond",
|
|
14
17
|
};
|
|
15
18
|
/** Mode of operation - sync waits for response, async continues without waiting. */
|
|
16
19
|
Tool.ExecutionMode = {
|
|
@@ -22,4 +25,10 @@ var Tool;
|
|
|
22
25
|
Get: "GET",
|
|
23
26
|
Post: "POST",
|
|
24
27
|
};
|
|
28
|
+
/** 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. */
|
|
29
|
+
Tool.SpeechBeforeToolCall = {
|
|
30
|
+
Required: "required",
|
|
31
|
+
Optional: "optional",
|
|
32
|
+
Suppressed: "suppressed",
|
|
33
|
+
};
|
|
25
34
|
})(Tool || (exports.Tool = Tool = {}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type * as Phonic from "../index.js";
|
|
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.js";
|
|
|
10
10
|
export * from "./AudioChunkResponsePayload.js";
|
|
11
11
|
export * from "./BadRequestErrorBody.js";
|
|
12
12
|
export * from "./BasicError.js";
|
|
13
|
+
export * from "./BuiltInToolConfig.js";
|
|
14
|
+
export * from "./BuiltInToolConfigs.js";
|
|
15
|
+
export * from "./BuiltInToolDefinition.js";
|
|
13
16
|
export * from "./ConfigOptions.js";
|
|
14
17
|
export * from "./ConfigPayload.js";
|
|
15
18
|
export * from "./Conversation.js";
|
|
@@ -26,6 +26,9 @@ __exportStar(require("./AudioChunkPayload.js"), exports);
|
|
|
26
26
|
__exportStar(require("./AudioChunkResponsePayload.js"), exports);
|
|
27
27
|
__exportStar(require("./BadRequestErrorBody.js"), exports);
|
|
28
28
|
__exportStar(require("./BasicError.js"), exports);
|
|
29
|
+
__exportStar(require("./BuiltInToolConfig.js"), exports);
|
|
30
|
+
__exportStar(require("./BuiltInToolConfigs.js"), exports);
|
|
31
|
+
__exportStar(require("./BuiltInToolDefinition.js"), exports);
|
|
29
32
|
__exportStar(require("./ConfigOptions.js"), exports);
|
|
30
33
|
__exportStar(require("./ConfigPayload.js"), exports);
|
|
31
34
|
__exportStar(require("./Conversation.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.32.
|
|
1
|
+
export declare const SDK_VERSION = "0.32.11";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "phonic",
|
|
9
|
-
"X-Fern-SDK-Version": "0.32.
|
|
10
|
-
"User-Agent": "phonic/0.32.
|
|
9
|
+
"X-Fern-SDK-Version": "0.32.11",
|
|
10
|
+
"User-Agent": "phonic/0.32.11",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -83,6 +83,8 @@ export interface AgentsCreateRequest {
|
|
|
83
83
|
template_variables?: Record<string, Phonic.CreateAgentRequest.TemplateVariables.Value>;
|
|
84
84
|
/** Array of built-in or custom tool names to use. */
|
|
85
85
|
tools?: Phonic.CreateAgentRequest.Tools.Item[];
|
|
86
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. Built-in tools not listed here use their default configuration. */
|
|
87
|
+
built_in_tool_configs?: Phonic.BuiltInToolConfigs;
|
|
86
88
|
/** Array of task objects with `name` and `description` fields. */
|
|
87
89
|
tasks?: Phonic.Task[];
|
|
88
90
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -83,6 +83,8 @@ export interface UpdateAgentRequest {
|
|
|
83
83
|
template_variables?: Record<string, UpdateAgentRequest.TemplateVariables.Value>;
|
|
84
84
|
/** Array of built-in or custom tool names to use. */
|
|
85
85
|
tools?: UpdateAgentRequest.Tools.Item[];
|
|
86
|
+
/** Configuration overrides for built-in tools, keyed by built-in tool ID. Built-in tools not listed here use their default configuration. */
|
|
87
|
+
built_in_tool_configs?: Phonic.BuiltInToolConfigs;
|
|
86
88
|
/** Array of task objects with `name` and `description` fields. */
|
|
87
89
|
tasks?: Phonic.Task[];
|
|
88
90
|
/** Whether to have the no-input poke text be generated by AI. */
|
|
@@ -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 = {}));
|
|
@@ -49,6 +49,8 @@ export interface UpdateToolRequest {
|
|
|
49
49
|
agents_to_transfer_to?: string[];
|
|
50
50
|
/** When true, forces the agent to speak before executing the tool. */
|
|
51
51
|
require_speech_before_tool_call?: boolean;
|
|
52
|
+
/** 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. */
|
|
53
|
+
speech_before_tool_call?: UpdateToolRequest.SpeechBeforeToolCall;
|
|
52
54
|
/** 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
55
|
wait_for_speech_before_tool_call?: boolean;
|
|
54
56
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -71,4 +73,11 @@ export declare namespace UpdateToolRequest {
|
|
|
71
73
|
readonly Post: "POST";
|
|
72
74
|
};
|
|
73
75
|
type EndpointMethod = (typeof EndpointMethod)[keyof typeof EndpointMethod];
|
|
76
|
+
/** 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. */
|
|
77
|
+
const SpeechBeforeToolCall: {
|
|
78
|
+
readonly Required: "required";
|
|
79
|
+
readonly Optional: "optional";
|
|
80
|
+
readonly Suppressed: "suppressed";
|
|
81
|
+
};
|
|
82
|
+
type SpeechBeforeToolCall = (typeof SpeechBeforeToolCall)[keyof typeof SpeechBeforeToolCall];
|
|
74
83
|
}
|
|
@@ -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. */
|
|
@@ -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;
|
|
@@ -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. */
|
|
@@ -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
|
}
|
|
@@ -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";
|
|
@@ -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";
|
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.11";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.32.
|
|
1
|
+
export const SDK_VERSION = "0.32.11";
|