Skip to content

Commit f90a54f

Browse files
committed
feat: add type to tool maps
1 parent a2839e4 commit f90a54f

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/action.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const actions: Record<string, Tool> = {
126126
},
127127
},
128128
},
129+
type: "action",
129130
implementation: replaceSelectedText,
130131
},
131132
appendTextToDocument: {
@@ -147,6 +148,7 @@ export const actions: Record<string, Tool> = {
147148
},
148149
},
149150
},
151+
type: "action",
150152
implementation: appendTextToDocument,
151153
},
152154
createCalendarEvent: {
@@ -173,6 +175,7 @@ export const actions: Record<string, Tool> = {
173175
},
174176
},
175177
},
178+
type: "action",
176179
implementation: createCalendarEvent,
177180
},
178181
};

src/retriever.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export const retrievers: Record<string, Tool> = {
6363
parameters: { type: "object", properties: {}, required: [] },
6464
},
6565
},
66+
type: "retriever",
6667
implementation: getSelectedText,
6768
},
6869
getCalendarEvents: {
@@ -83,6 +84,7 @@ export const retrievers: Record<string, Tool> = {
8384
},
8485
},
8586
},
87+
type: "retriever",
8688
implementation: getCalendarEvents,
8789
},
8890
};

src/tool.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ export interface Tool {
2828
};
2929
};
3030
};
31+
type: "retriever" | "action";
3132
implementation: (state: State, parameters: any) => void;
3233
}

0 commit comments

Comments
 (0)