mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08:00
Adds support for custom tools - user-defined functions that the LLM can call during conversations. Custom tools work alongside opencode's built-in tools and are configured through the new `tools` option. The configuration follows the same pattern as other opencode settings like `agents` and `commands`, supporting: - Inline TypeScript content - Individual file paths - Bulk directory imports
13 lines
349 B
TypeScript
13 lines
349 B
TypeScript
import { tool } from "@opencode-ai/plugin"
|
|
|
|
export default tool({
|
|
description: "Make API requests to external services",
|
|
args: {
|
|
endpoint: tool.schema.string().describe("API endpoint to call"),
|
|
method: tool.schema.string().describe("HTTP method"),
|
|
},
|
|
async execute(args) {
|
|
return `Called ${args.method} ${args.endpoint}`
|
|
},
|
|
})
|