From 65179e8b0519aa4ccf28afc4c429262ecf7a62f3 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Tue, 16 Jul 2024 11:11:53 -0400 Subject: attempting annotations for image chunks --- src/client/views/nodes/ChatBox/tools/RAGTool.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/client/views/nodes/ChatBox/tools/RAGTool.ts') diff --git a/src/client/views/nodes/ChatBox/tools/RAGTool.ts b/src/client/views/nodes/ChatBox/tools/RAGTool.ts index 36e4bc3ce..90f7bebfe 100644 --- a/src/client/views/nodes/ChatBox/tools/RAGTool.ts +++ b/src/client/views/nodes/ChatBox/tools/RAGTool.ts @@ -6,7 +6,7 @@ import * as fs from 'fs'; export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { constructor( private vectorstore: Vectorstore, - summaries: string + summaries: () => string ) { super( 'rag', @@ -46,18 +46,10 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> { !!!IMPORTANT Use the RAG tool ANYTIME the question may potentially (even if you are not sure) relate to one of the user's documents. Here are the summaries of the user's documents: - ${summaries}` + ${summaries()}` ); } - changeSummaries(summaries: string) { - this.briefSummary = `Performs a RAG (Retrieval-Augmented Generation) search on user documents and returns a set of document chunks (either images or text) that can be used to provide a grounded response based on user documents. - -!!!IMPORTANT Use the RAG tool ANYTIME the question may potentially (even if you are not sure) relate to one of the user's documents. -Here are the summaries of the user's documents: -${summaries}`; - } - async execute(args: { hypothetical_document_chunk: string }): Promise { const relevantChunks = await this.vectorstore.retrieve(args.hypothetical_document_chunk); return this.getFormattedChunks(relevantChunks); -- cgit v1.2.3-70-g09d2