aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/tools/RAGTool.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2024-07-16 11:11:53 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-07-16 11:11:53 -0400
commit65179e8b0519aa4ccf28afc4c429262ecf7a62f3 (patch)
tree016f43f1ad9170adecb3ea939abc28c74a451382 /src/client/views/nodes/ChatBox/tools/RAGTool.ts
parent5a3d5b23c927c5fb05c7eeef1e3bb91479ef896a (diff)
attempting annotations for image chunks
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools/RAGTool.ts')
-rw-r--r--src/client/views/nodes/ChatBox/tools/RAGTool.ts12
1 files changed, 2 insertions, 10 deletions
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<any> {
const relevantChunks = await this.vectorstore.retrieve(args.hypothetical_document_chunk);
return this.getFormattedChunks(relevantChunks);