mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
Convert custom tool examples to subdirectory/index.ts structure
- hello.ts → hello/index.ts - question.ts → question/index.ts - todo.ts → todo/index.ts - subagent/subagent.ts → subagent/index.ts
This commit is contained in:
parent
320556dbf5
commit
a930eb8489
4 changed files with 0 additions and 0 deletions
20
packages/coding-agent/examples/custom-tools/hello/index.ts
Normal file
20
packages/coding-agent/examples/custom-tools/hello/index.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { Type } from "@sinclair/typebox";
|
||||
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
const factory: CustomToolFactory = (pi) => ({
|
||||
name: "hello",
|
||||
label: "Hello",
|
||||
description: "A simple greeting tool",
|
||||
parameters: Type.Object({
|
||||
name: Type.String({ description: "Name to greet" }),
|
||||
}),
|
||||
|
||||
async execute(toolCallId, params) {
|
||||
return {
|
||||
content: [{ type: "text", text: `Hello, ${params.name}!` }],
|
||||
details: { greeted: params.name },
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
export default factory;
|
||||
Loading…
Add table
Add a link
Reference in a new issue