Download packages/agent-core-v2/src/human/tool/tool.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/human/tool/tool.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/agent-core-v2/src/human/tool/tool.ts
-
curl -L -o tool.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/agent-core-v2/src/human/tool/tool.ts
426 Bytes
| import type { ToolDescription } from '#/llm/message'; | |
| import type { ToolExecuteInput, ToolResult } from './executor'; | |
| export interface ToolDefinition extends ToolDescription { | |
| execute(input: ToolExecuteInput): Promise<ToolResult>; | |
| } | |
| export function defineTool(tool: ToolDefinition): ToolDefinition { | |
| if (tool.name.trim() === '') { | |
| throw new Error('tool name must not be empty'); | |
| } | |
| return Object.freeze(tool); | |
| } | |