Expose tool prompt guidelines to extensions

closes #4879
This commit is contained in:
Mario Zechner
2026-05-28 11:03:25 +02:00
parent 17d39ccfd4
commit edd26444af
5 changed files with 12 additions and 6 deletions

View File

@@ -1493,7 +1493,8 @@ const all = pi.getAllTools();
// [{
// name: "read",
// description: "Read file contents...",
// parameters: ...,
// parameters: ...,
// promptGuidelines: ["Use read to examine files instead of cat or sed."],
// sourceInfo: { path: "<builtin:read>", source: "builtin", scope: "temporary", origin: "top-level" }
// }, ...]
const names = all.map(t => t.name);
@@ -1502,7 +1503,7 @@ const extensionTools = all.filter((t) => t.sourceInfo.source !== "builtin" && t.
pi.setActiveTools(["read", "bash"]); // Switch to read-only
```
`pi.getAllTools()` returns `name`, `description`, `parameters`, and `sourceInfo`.
`pi.getAllTools()` returns `name`, `description`, `parameters`, `promptGuidelines`, and `sourceInfo`.
Typical `sourceInfo.source` values:
- `builtin` for built-in tools