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-11 12:06:04 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2024-07-11 12:06:04 -0400
commitf1cdfc1d02488c4a513fbf67f729f702526a345d (patch)
tree1f1145e4ecc7d00c77c66198003318f0fcc568b3 /src/client/views/nodes/ChatBox/tools/RAGTool.ts
parente0e4871224e626240dc899c653cd0eb9f54c3693 (diff)
not working well (files don't get filename immediately_
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools/RAGTool.ts')
-rw-r--r--src/client/views/nodes/ChatBox/tools/RAGTool.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/client/views/nodes/ChatBox/tools/RAGTool.ts b/src/client/views/nodes/ChatBox/tools/RAGTool.ts
index 185efa0ba..36e4bc3ce 100644
--- a/src/client/views/nodes/ChatBox/tools/RAGTool.ts
+++ b/src/client/views/nodes/ChatBox/tools/RAGTool.ts
@@ -39,6 +39,7 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> {
!!!IMPORTANT Before you close the tag with </answer>, within the answer tags provide a set of 3 follow-up questions inside a <follow_up_questions> tag and individually within <question> tags. These should relate to the document, the current query, and the chat_history and should aim to help the user better understand whatever they are looking for.
Also, ensure that the answer tags are wrapped with the correct step tags as well.`,
+
`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
@@ -49,6 +50,14 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> {
);
}
+ 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);