Skip to content

Commit

Permalink
feat(agent): simplify tools' schema that is passing to prompt
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Dvorak <[email protected]>
  • Loading branch information
Tomas2D committed Oct 4, 2024
1 parent 699e45f commit c927201
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/agents/bee/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class BeeAgentRunner {
},
},
});

await memory.addMany([
BaseMessage.of({
role: Role.SYSTEM,
Expand All @@ -127,7 +128,13 @@ export class BeeAgentRunner {
input.tools.map(async (tool) => ({
name: tool.name,
description: tool.description.replaceAll("\n", ".").replace(/\.$/, "").concat("."),
schema: JSON.stringify(await tool.getInputJsonSchema()),
schema: JSON.stringify(
await tool.getInputJsonSchema(),
(() => {
const ignoredKeys = new Set(["minLength", "maxLength", "$schema"]);
return (key, value) => (ignoredKeys.has(key) ? undefined : value);
})(),
),
})),
),
instructions: undefined,
Expand Down

0 comments on commit c927201

Please sign in to comment.