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 f90a54f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const actions: Record<string, Tool> = {
},
},
},
type: "action",
implementation: replaceSelectedText,
},
appendTextToDocument: {
Expand All @@ -147,6 +148,7 @@ export const actions: Record<string, Tool> = {
},
},
},
type: "action",
implementation: appendTextToDocument,
},
createCalendarEvent: {
Expand All @@ -173,6 +175,7 @@ export const actions: Record<string, Tool> = {
},
},
},
type: "action",
implementation: createCalendarEvent,
},
};
2 changes: 2 additions & 0 deletions src/retriever.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export const retrievers: Record<string, Tool> = {
parameters: { type: "object", properties: {}, required: [] },
},
},
type: "retriever",
implementation: getSelectedText,
},
getCalendarEvents: {
Expand All @@ -83,6 +84,7 @@ export const retrievers: Record<string, Tool> = {
},
},
},
type: "retriever",
implementation: getCalendarEvents,
},
};
1 change: 1 addition & 0 deletions src/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ export interface Tool {
};
};
};
type: "retriever" | "action";
implementation: (state: State, parameters: any) => void;
}

0 comments on commit f90a54f

Please sign in to comment.