From f90a54f67ecb24c4c30a5308dc8183d24533df50 Mon Sep 17 00:00:00 2001 From: Nestor Qin Date: Mon, 21 Oct 2024 23:10:48 -0400 Subject: [PATCH] feat: add `type` to tool maps --- src/action.ts | 3 +++ src/retriever.ts | 2 ++ src/tool.ts | 1 + 3 files changed, 6 insertions(+) diff --git a/src/action.ts b/src/action.ts index 9c1679b..9df1fb2 100644 --- a/src/action.ts +++ b/src/action.ts @@ -126,6 +126,7 @@ export const actions: Record = { }, }, }, + type: "action", implementation: replaceSelectedText, }, appendTextToDocument: { @@ -147,6 +148,7 @@ export const actions: Record = { }, }, }, + type: "action", implementation: appendTextToDocument, }, createCalendarEvent: { @@ -173,6 +175,7 @@ export const actions: Record = { }, }, }, + type: "action", implementation: createCalendarEvent, }, }; diff --git a/src/retriever.ts b/src/retriever.ts index 574640b..0fa45f3 100644 --- a/src/retriever.ts +++ b/src/retriever.ts @@ -63,6 +63,7 @@ export const retrievers: Record = { parameters: { type: "object", properties: {}, required: [] }, }, }, + type: "retriever", implementation: getSelectedText, }, getCalendarEvents: { @@ -83,6 +84,7 @@ export const retrievers: Record = { }, }, }, + type: "retriever", implementation: getCalendarEvents, }, }; diff --git a/src/tool.ts b/src/tool.ts index 2053a3b..54d2164 100644 --- a/src/tool.ts +++ b/src/tool.ts @@ -28,5 +28,6 @@ export interface Tool { }; }; }; + type: "retriever" | "action"; implementation: (state: State, parameters: any) => void; }