mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-29 04:59:51 +00:00
rework custom tools
This commit is contained in:
parent
5f2945ae71
commit
1ffc8be2b6
5 changed files with 70 additions and 49 deletions
|
|
@ -5,15 +5,15 @@ export const ExamplePlugin: Plugin = async (ctx) => {
|
|||
return {
|
||||
permission: {},
|
||||
tool: {
|
||||
mytool: tool((zod) => ({
|
||||
mytool: tool({
|
||||
description: "This is a custom tool tool",
|
||||
args: {
|
||||
foo: zod.string(),
|
||||
foo: tool.schema.string().describe("foo"),
|
||||
},
|
||||
async execute(args, ctx) {
|
||||
async execute(args) {
|
||||
return `Hello ${args.foo}!`
|
||||
},
|
||||
})),
|
||||
}),
|
||||
},
|
||||
async "chat.params"(_input, output) {
|
||||
output.topP = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue