Skip to content

Commit

Permalink
feat: add type to tool maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor committed Oct 22, 2024
1 parent a2839e4 commit 4e78dbe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { retrievers } from "./retriever";
import { State } from "./state";

export const tool: Record<string, Tool> = {
...retrievers,
...actions,
...Object.fromEntries(Object.entries(retrievers).map(([key, value]) => [key, { ...value, type: "retriever" }])),
...Object.fromEntries(Object.entries(actions).map(([key, value]) => [key, { ...value, type: "action" }])),
};

export const toolName = Object.keys(tool);
Expand All @@ -28,5 +28,6 @@ export interface Tool {
};
};
};
type: 'retriever' | 'action';
implementation: (state: State, parameters: any) => void;
}

0 comments on commit 4e78dbe

Please sign in to comment.