phonic 0.32.14 → 0.32.15
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/UpdateAgentRequest.d.ts +1 -1
- package/dist/cjs/api/resources/tools/client/requests/CreateToolRequest.d.ts +2 -0
- package/dist/cjs/api/resources/tools/client/requests/UpdateToolRequest.d.ts +2 -0
- package/dist/cjs/api/resources/tts/client/requests/StreamTtsRequest.d.ts +6 -0
- package/dist/cjs/api/types/Agent.d.ts +1 -1
- package/dist/cjs/api/types/BuiltInToolConfig.d.ts +1 -1
- package/dist/cjs/api/types/BuiltInToolConfigs.d.ts +5 -2
- package/dist/cjs/api/types/BuiltInToolDefinition.d.ts +8 -2
- package/dist/cjs/api/types/BuiltInToolDefinition.js +1 -0
- package/dist/cjs/api/types/ChooseNotToRespondToolConfig.d.ts +7 -0
- package/dist/cjs/api/types/ChooseNotToRespondToolConfig.js +3 -0
- package/dist/cjs/api/types/CreateAgentRequest.d.ts +1 -1
- package/dist/cjs/api/types/OutboundCallConfig.d.ts +1 -1
- package/dist/cjs/api/types/Tool.d.ts +2 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -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/UpdateAgentRequest.d.mts +1 -1
- package/dist/esm/api/resources/tools/client/requests/CreateToolRequest.d.mts +2 -0
- package/dist/esm/api/resources/tools/client/requests/UpdateToolRequest.d.mts +2 -0
- package/dist/esm/api/resources/tts/client/requests/StreamTtsRequest.d.mts +6 -0
- package/dist/esm/api/types/Agent.d.mts +1 -1
- package/dist/esm/api/types/BuiltInToolConfig.d.mts +1 -1
- package/dist/esm/api/types/BuiltInToolConfigs.d.mts +5 -2
- package/dist/esm/api/types/BuiltInToolDefinition.d.mts +8 -2
- package/dist/esm/api/types/BuiltInToolDefinition.mjs +1 -0
- package/dist/esm/api/types/ChooseNotToRespondToolConfig.d.mts +7 -0
- package/dist/esm/api/types/ChooseNotToRespondToolConfig.mjs +2 -0
- package/dist/esm/api/types/CreateAgentRequest.d.mts +1 -1
- package/dist/esm/api/types/OutboundCallConfig.d.mts +1 -1
- package/dist/esm/api/types/Tool.d.mts +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -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.15",
|
|
47
|
+
"User-Agent": "phonic/0.32.15",
|
|
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);
|
|
@@ -178,7 +178,7 @@ export declare namespace UpdateAgentRequest {
|
|
|
178
178
|
}
|
|
179
179
|
type Tools = Tools.Item[];
|
|
180
180
|
namespace Tools {
|
|
181
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
181
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
182
182
|
/**
|
|
183
183
|
* Custom tool */
|
|
184
184
|
| string;
|
|
@@ -217,6 +217,8 @@ export interface CreateToolRequest {
|
|
|
217
217
|
require_speech_before_tool_call?: boolean;
|
|
218
218
|
/** 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. */
|
|
219
219
|
speech_before_tool_call?: CreateToolRequest.SpeechBeforeToolCall;
|
|
220
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
221
|
+
respond_after_sec?: number | null;
|
|
220
222
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
221
223
|
wait_for_speech_before_tool_call?: boolean;
|
|
222
224
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -57,6 +57,8 @@ export interface UpdateToolRequest {
|
|
|
57
57
|
require_speech_before_tool_call?: boolean;
|
|
58
58
|
/** 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. */
|
|
59
59
|
speech_before_tool_call?: UpdateToolRequest.SpeechBeforeToolCall;
|
|
60
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
61
|
+
respond_after_sec?: number | null;
|
|
60
62
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
61
63
|
wait_for_speech_before_tool_call?: boolean;
|
|
62
64
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Phonic from "../../../../index.js";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -15,6 +16,11 @@ export interface StreamTtsRequest {
|
|
|
15
16
|
voice_id?: string;
|
|
16
17
|
/** The audio format to stream. */
|
|
17
18
|
output_format?: StreamTtsRequest.OutputFormat;
|
|
19
|
+
/**
|
|
20
|
+
* Candidate languages for synthesis. An empty array defaults to English, one language
|
|
21
|
+
* selects it directly, and multiple languages let Phonic detect among those candidates.
|
|
22
|
+
*/
|
|
23
|
+
languages?: Phonic.LanguageCode[];
|
|
18
24
|
}
|
|
19
25
|
export declare namespace StreamTtsRequest {
|
|
20
26
|
/** The audio format to stream. */
|
|
@@ -127,7 +127,7 @@ export declare namespace Agent {
|
|
|
127
127
|
}
|
|
128
128
|
type Tools = Tools.Item[];
|
|
129
129
|
namespace Tools {
|
|
130
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
130
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
131
131
|
/**
|
|
132
132
|
* Custom tool */
|
|
133
133
|
| string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Configuration for a simple built-in tool (`keypad_input
|
|
2
|
+
* Configuration for a simple built-in tool (`keypad_input` or `natural_conversation_ending`).
|
|
3
3
|
*/
|
|
4
4
|
export interface BuiltInToolConfig {
|
|
5
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). */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type * as Phonic from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* Per-tool configuration overrides for built-in tools, keyed by built-in tool ID
|
|
3
|
+
* Per-tool configuration overrides for built-in tools, keyed by built-in tool ID. The value's shape depends on the tool: `tool_keypad_input` and `tool_natural_conversation_ending` take a `speech_before_tool_call` config; `tool_choose_not_to_respond` takes a `respond_after_sec` config. A built-in tool referenced in `tools` but absent from this map uses its default configuration.
|
|
4
4
|
*/
|
|
5
|
-
export type BuiltInToolConfigs = Record<string,
|
|
5
|
+
export type BuiltInToolConfigs = Record<string, BuiltInToolConfigs.Value>;
|
|
6
|
+
export declare namespace BuiltInToolConfigs {
|
|
7
|
+
type Value = Phonic.BuiltInToolConfig | Phonic.ChooseNotToRespondToolConfig;
|
|
8
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type * as Phonic from "../index.js";
|
|
2
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).
|
|
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). `keypad_input` and `natural_conversation_ending` take a `speech_before_tool_call` config; `choose_not_to_respond` takes a `respond_after_sec` config.
|
|
4
4
|
*/
|
|
5
5
|
export interface BuiltInToolDefinition {
|
|
6
6
|
type: "built_in";
|
|
7
7
|
/** The name of the built-in tool. */
|
|
8
8
|
name: BuiltInToolDefinition.Name;
|
|
9
|
-
|
|
9
|
+
/** The tool's configuration. Use `BuiltInToolConfig` for `keypad_input` and `natural_conversation_ending`, or `ChooseNotToRespondToolConfig` for `choose_not_to_respond`. */
|
|
10
|
+
tool_config: BuiltInToolDefinition.ToolConfig;
|
|
10
11
|
}
|
|
11
12
|
export declare namespace BuiltInToolDefinition {
|
|
12
13
|
/** The name of the built-in tool. */
|
|
13
14
|
const Name: {
|
|
14
15
|
readonly KeypadInput: "keypad_input";
|
|
15
16
|
readonly NaturalConversationEnding: "natural_conversation_ending";
|
|
17
|
+
readonly ChooseNotToRespond: "choose_not_to_respond";
|
|
16
18
|
};
|
|
17
19
|
type Name = (typeof Name)[keyof typeof Name];
|
|
20
|
+
/**
|
|
21
|
+
* The tool's configuration. Use `BuiltInToolConfig` for `keypad_input` and `natural_conversation_ending`, or `ChooseNotToRespondToolConfig` for `choose_not_to_respond`.
|
|
22
|
+
*/
|
|
23
|
+
type ToolConfig = Phonic.BuiltInToolConfig | Phonic.ChooseNotToRespondToolConfig;
|
|
18
24
|
}
|
|
@@ -8,5 +8,6 @@ var BuiltInToolDefinition;
|
|
|
8
8
|
BuiltInToolDefinition.Name = {
|
|
9
9
|
KeypadInput: "keypad_input",
|
|
10
10
|
NaturalConversationEnding: "natural_conversation_ending",
|
|
11
|
+
ChooseNotToRespond: "choose_not_to_respond",
|
|
11
12
|
};
|
|
12
13
|
})(BuiltInToolDefinition || (exports.BuiltInToolDefinition = BuiltInToolDefinition = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for the `choose_not_to_respond` built-in tool.
|
|
3
|
+
*/
|
|
4
|
+
export interface ChooseNotToRespondToolConfig {
|
|
5
|
+
/** Number of seconds to wait after the tool fires before the assistant speaks a follow-up if the user stays silent. When null, the assistant stays silent (default). */
|
|
6
|
+
respond_after_sec?: (number | null) | undefined;
|
|
7
|
+
}
|
|
@@ -125,7 +125,7 @@ export declare namespace CreateAgentRequest {
|
|
|
125
125
|
}
|
|
126
126
|
type Tools = Tools.Item[];
|
|
127
127
|
namespace Tools {
|
|
128
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
128
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
129
129
|
/**
|
|
130
130
|
* Custom tool */
|
|
131
131
|
| string;
|
|
@@ -97,7 +97,7 @@ export declare namespace OutboundCallConfig {
|
|
|
97
97
|
}
|
|
98
98
|
type Tools = Tools.Item[];
|
|
99
99
|
namespace Tools {
|
|
100
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
100
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
101
101
|
/**
|
|
102
102
|
* Custom tool */
|
|
103
103
|
| string;
|
|
@@ -48,6 +48,8 @@ export interface Tool {
|
|
|
48
48
|
require_speech_before_tool_call?: boolean | undefined;
|
|
49
49
|
/** 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. */
|
|
50
50
|
speech_before_tool_call?: Tool.SpeechBeforeToolCall | undefined;
|
|
51
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
52
|
+
respond_after_sec?: (number | null) | undefined;
|
|
51
53
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
52
54
|
wait_for_speech_before_tool_call?: boolean | undefined;
|
|
53
55
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -13,6 +13,7 @@ export * from "./BasicError.js";
|
|
|
13
13
|
export * from "./BuiltInToolConfig.js";
|
|
14
14
|
export * from "./BuiltInToolConfigs.js";
|
|
15
15
|
export * from "./BuiltInToolDefinition.js";
|
|
16
|
+
export * from "./ChooseNotToRespondToolConfig.js";
|
|
16
17
|
export * from "./ConfigOptions.js";
|
|
17
18
|
export * from "./ConfigPayload.js";
|
|
18
19
|
export * from "./Conversation.js";
|
|
@@ -29,6 +29,7 @@ __exportStar(require("./BasicError.js"), exports);
|
|
|
29
29
|
__exportStar(require("./BuiltInToolConfig.js"), exports);
|
|
30
30
|
__exportStar(require("./BuiltInToolConfigs.js"), exports);
|
|
31
31
|
__exportStar(require("./BuiltInToolDefinition.js"), exports);
|
|
32
|
+
__exportStar(require("./ChooseNotToRespondToolConfig.js"), exports);
|
|
32
33
|
__exportStar(require("./ConfigOptions.js"), exports);
|
|
33
34
|
__exportStar(require("./ConfigPayload.js"), exports);
|
|
34
35
|
__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.15";
|
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.15",
|
|
10
|
+
"User-Agent": "phonic/0.32.15",
|
|
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);
|
|
@@ -178,7 +178,7 @@ export declare namespace UpdateAgentRequest {
|
|
|
178
178
|
}
|
|
179
179
|
type Tools = Tools.Item[];
|
|
180
180
|
namespace Tools {
|
|
181
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
181
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
182
182
|
/**
|
|
183
183
|
* Custom tool */
|
|
184
184
|
| string;
|
|
@@ -217,6 +217,8 @@ export interface CreateToolRequest {
|
|
|
217
217
|
require_speech_before_tool_call?: boolean;
|
|
218
218
|
/** 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. */
|
|
219
219
|
speech_before_tool_call?: CreateToolRequest.SpeechBeforeToolCall;
|
|
220
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
221
|
+
respond_after_sec?: number | null;
|
|
220
222
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
221
223
|
wait_for_speech_before_tool_call?: boolean;
|
|
222
224
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -57,6 +57,8 @@ export interface UpdateToolRequest {
|
|
|
57
57
|
require_speech_before_tool_call?: boolean;
|
|
58
58
|
/** 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. */
|
|
59
59
|
speech_before_tool_call?: UpdateToolRequest.SpeechBeforeToolCall;
|
|
60
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
61
|
+
respond_after_sec?: number | null;
|
|
60
62
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
61
63
|
wait_for_speech_before_tool_call?: boolean;
|
|
62
64
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Phonic from "../../../../index.mjs";
|
|
1
2
|
/**
|
|
2
3
|
* @example
|
|
3
4
|
* {
|
|
@@ -15,6 +16,11 @@ export interface StreamTtsRequest {
|
|
|
15
16
|
voice_id?: string;
|
|
16
17
|
/** The audio format to stream. */
|
|
17
18
|
output_format?: StreamTtsRequest.OutputFormat;
|
|
19
|
+
/**
|
|
20
|
+
* Candidate languages for synthesis. An empty array defaults to English, one language
|
|
21
|
+
* selects it directly, and multiple languages let Phonic detect among those candidates.
|
|
22
|
+
*/
|
|
23
|
+
languages?: Phonic.LanguageCode[];
|
|
18
24
|
}
|
|
19
25
|
export declare namespace StreamTtsRequest {
|
|
20
26
|
/** The audio format to stream. */
|
|
@@ -127,7 +127,7 @@ export declare namespace Agent {
|
|
|
127
127
|
}
|
|
128
128
|
type Tools = Tools.Item[];
|
|
129
129
|
namespace Tools {
|
|
130
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
130
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
131
131
|
/**
|
|
132
132
|
* Custom tool */
|
|
133
133
|
| string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Configuration for a simple built-in tool (`keypad_input
|
|
2
|
+
* Configuration for a simple built-in tool (`keypad_input` or `natural_conversation_ending`).
|
|
3
3
|
*/
|
|
4
4
|
export interface BuiltInToolConfig {
|
|
5
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). */
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type * as Phonic from "../index.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* Per-tool configuration overrides for built-in tools, keyed by built-in tool ID
|
|
3
|
+
* Per-tool configuration overrides for built-in tools, keyed by built-in tool ID. The value's shape depends on the tool: `tool_keypad_input` and `tool_natural_conversation_ending` take a `speech_before_tool_call` config; `tool_choose_not_to_respond` takes a `respond_after_sec` config. A built-in tool referenced in `tools` but absent from this map uses its default configuration.
|
|
4
4
|
*/
|
|
5
|
-
export type BuiltInToolConfigs = Record<string,
|
|
5
|
+
export type BuiltInToolConfigs = Record<string, BuiltInToolConfigs.Value>;
|
|
6
|
+
export declare namespace BuiltInToolConfigs {
|
|
7
|
+
type Value = Phonic.BuiltInToolConfig | Phonic.ChooseNotToRespondToolConfig;
|
|
8
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type * as Phonic from "../index.mjs";
|
|
2
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).
|
|
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). `keypad_input` and `natural_conversation_ending` take a `speech_before_tool_call` config; `choose_not_to_respond` takes a `respond_after_sec` config.
|
|
4
4
|
*/
|
|
5
5
|
export interface BuiltInToolDefinition {
|
|
6
6
|
type: "built_in";
|
|
7
7
|
/** The name of the built-in tool. */
|
|
8
8
|
name: BuiltInToolDefinition.Name;
|
|
9
|
-
|
|
9
|
+
/** The tool's configuration. Use `BuiltInToolConfig` for `keypad_input` and `natural_conversation_ending`, or `ChooseNotToRespondToolConfig` for `choose_not_to_respond`. */
|
|
10
|
+
tool_config: BuiltInToolDefinition.ToolConfig;
|
|
10
11
|
}
|
|
11
12
|
export declare namespace BuiltInToolDefinition {
|
|
12
13
|
/** The name of the built-in tool. */
|
|
13
14
|
const Name: {
|
|
14
15
|
readonly KeypadInput: "keypad_input";
|
|
15
16
|
readonly NaturalConversationEnding: "natural_conversation_ending";
|
|
17
|
+
readonly ChooseNotToRespond: "choose_not_to_respond";
|
|
16
18
|
};
|
|
17
19
|
type Name = (typeof Name)[keyof typeof Name];
|
|
20
|
+
/**
|
|
21
|
+
* The tool's configuration. Use `BuiltInToolConfig` for `keypad_input` and `natural_conversation_ending`, or `ChooseNotToRespondToolConfig` for `choose_not_to_respond`.
|
|
22
|
+
*/
|
|
23
|
+
type ToolConfig = Phonic.BuiltInToolConfig | Phonic.ChooseNotToRespondToolConfig;
|
|
18
24
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration for the `choose_not_to_respond` built-in tool.
|
|
3
|
+
*/
|
|
4
|
+
export interface ChooseNotToRespondToolConfig {
|
|
5
|
+
/** Number of seconds to wait after the tool fires before the assistant speaks a follow-up if the user stays silent. When null, the assistant stays silent (default). */
|
|
6
|
+
respond_after_sec?: (number | null) | undefined;
|
|
7
|
+
}
|
|
@@ -125,7 +125,7 @@ export declare namespace CreateAgentRequest {
|
|
|
125
125
|
}
|
|
126
126
|
type Tools = Tools.Item[];
|
|
127
127
|
namespace Tools {
|
|
128
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
128
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
129
129
|
/**
|
|
130
130
|
* Custom tool */
|
|
131
131
|
| string;
|
|
@@ -97,7 +97,7 @@ export declare namespace OutboundCallConfig {
|
|
|
97
97
|
}
|
|
98
98
|
type Tools = Tools.Item[];
|
|
99
99
|
namespace Tools {
|
|
100
|
-
type Item = "keypad_input" | "natural_conversation_ending"
|
|
100
|
+
type Item = "keypad_input" | "natural_conversation_ending" | "choose_not_to_respond"
|
|
101
101
|
/**
|
|
102
102
|
* Custom tool */
|
|
103
103
|
| string;
|
|
@@ -48,6 +48,8 @@ export interface Tool {
|
|
|
48
48
|
require_speech_before_tool_call?: boolean | undefined;
|
|
49
49
|
/** 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. */
|
|
50
50
|
speech_before_tool_call?: Tool.SpeechBeforeToolCall | undefined;
|
|
51
|
+
/** For built_in_choose_not_to_respond tools. Number of seconds to wait after the tool fires before the agent speaks a follow-up if the user stays silent. When null, the agent stays silent (default). Not used by other tool types. */
|
|
52
|
+
respond_after_sec?: (number | null) | undefined;
|
|
51
53
|
/** If true, the agent will wait to finish speaking before executing the tool. This is only available for custom_webhook and custom_websocket tools. */
|
|
52
54
|
wait_for_speech_before_tool_call?: boolean | undefined;
|
|
53
55
|
/** When true, forbids the agent from speaking after executing the tool. Available for custom_context, custom_webhook and custom_websocket tools. */
|
|
@@ -13,6 +13,7 @@ export * from "./BasicError.mjs";
|
|
|
13
13
|
export * from "./BuiltInToolConfig.mjs";
|
|
14
14
|
export * from "./BuiltInToolConfigs.mjs";
|
|
15
15
|
export * from "./BuiltInToolDefinition.mjs";
|
|
16
|
+
export * from "./ChooseNotToRespondToolConfig.mjs";
|
|
16
17
|
export * from "./ConfigOptions.mjs";
|
|
17
18
|
export * from "./ConfigPayload.mjs";
|
|
18
19
|
export * from "./Conversation.mjs";
|
|
@@ -13,6 +13,7 @@ export * from "./BasicError.mjs";
|
|
|
13
13
|
export * from "./BuiltInToolConfig.mjs";
|
|
14
14
|
export * from "./BuiltInToolConfigs.mjs";
|
|
15
15
|
export * from "./BuiltInToolDefinition.mjs";
|
|
16
|
+
export * from "./ChooseNotToRespondToolConfig.mjs";
|
|
16
17
|
export * from "./ConfigOptions.mjs";
|
|
17
18
|
export * from "./ConfigPayload.mjs";
|
|
18
19
|
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.15";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.32.
|
|
1
|
+
export const SDK_VERSION = "0.32.15";
|