-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathBetaRunnableTool.ts
More file actions
40 lines (37 loc) · 1.21 KB
/
BetaRunnableTool.ts
File metadata and controls
40 lines (37 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import {
BetaMemoryTool20250818,
BetaTool,
BetaToolBash20241022,
BetaToolBash20250124,
BetaToolComputerUse20241022,
BetaToolComputerUse20250124,
BetaToolComputerUse20251124,
BetaToolResultContentBlockParam,
BetaToolTextEditor20241022,
BetaToolTextEditor20250124,
BetaToolTextEditor20250429,
BetaToolTextEditor20250728,
} from '../../resources/beta';
export type { Promisable } from '../type-utils';
/**
* Tool types that can be implemented on the client.
* Excludes server-side tools like code execution, web search, and MCP toolsets.
*/
export type BetaClientRunnableToolType =
| BetaTool
| BetaMemoryTool20250818
| BetaToolBash20241022
| BetaToolBash20250124
| BetaToolComputerUse20241022
| BetaToolComputerUse20250124
| BetaToolComputerUse20251124
| BetaToolTextEditor20241022
| BetaToolTextEditor20250124
| BetaToolTextEditor20250429
| BetaToolTextEditor20250728;
// this type is just an extension of BetaTool with a run and parse method
// that will be called by `toolRunner()` helpers
export type BetaRunnableTool<Input = any> = BetaClientRunnableToolType & {
run: (args: Input) => Promisable<string | Array<BetaToolResultContentBlockParam>>;
parse: (content: unknown) => Input;
};