aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/RAGTool.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-10-15 14:18:44 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-10-15 14:18:44 -0400
commit596502c232ea6b6b88c3c58486e139074ea056ff (patch)
treecbdabc8375ae91415b5243648e87c097b440b00c /src/client/views/nodes/chatbot/tools/RAGTool.ts
parentfc06a98deec3fa2b173f8ea30a4f4b1781447b19 (diff)
tried something for typechecking but way too overcomplicated
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/RAGTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/RAGTool.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/views/nodes/chatbot/tools/RAGTool.ts b/src/client/views/nodes/chatbot/tools/RAGTool.ts
index 4cc2f26ff..4babf540a 100644
--- a/src/client/views/nodes/chatbot/tools/RAGTool.ts
+++ b/src/client/views/nodes/chatbot/tools/RAGTool.ts
@@ -1,5 +1,6 @@
+import { O } from '@fullcalendar/core/internal-common';
import { Networking } from '../../../../Network';
-import { RAGChunk } from '../types/types';
+import { Observation, RAGChunk } from '../types/types';
import { Vectorstore } from '../vectorstore/Vectorstore';
import { BaseTool } from './BaseTool';
@@ -56,13 +57,13 @@ export class RAGTool extends BaseTool {
);
}
- async execute(args: { hypothetical_document_chunk: string }): Promise<unknown> {
+ async execute(args: { hypothetical_document_chunk: string }): Promise<Observation[]> {
const relevantChunks = await this.vectorstore.retrieve(args.hypothetical_document_chunk);
const formatted_chunks = await this.getFormattedChunks(relevantChunks);
return formatted_chunks;
}
- async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<unknown> {
+ async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<Observation[]> {
try {
const { formattedChunks } = await Networking.PostToServer('/formatChunks', { relevantChunks });