aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/RAGTool.ts
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 13:42:00 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 13:42:00 -0400
commita5d7f5c38192b91b7df3bd6ecace5ba7365449a6 (patch)
treec6be94f983b5fcc65424b81d42ddb0718127404c /src/client/views/nodes/chatbot/tools/RAGTool.ts
parent3c28aa3a706869d818bc8a089e8d1a53f7234bc0 (diff)
Made it so chunk Ids are seperately managed and made sure the doc id is sonsistent and not created in python spawn
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/RAGTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/RAGTool.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/chatbot/tools/RAGTool.ts b/src/client/views/nodes/chatbot/tools/RAGTool.ts
index ef374ed22..90b803d21 100644
--- a/src/client/views/nodes/chatbot/tools/RAGTool.ts
+++ b/src/client/views/nodes/chatbot/tools/RAGTool.ts
@@ -3,6 +3,7 @@ import { Observation, RAGChunk } from '../types/types';
import { ParametersType, ToolInfo } from '../types/tool_types';
import { Vectorstore } from '../vectorstore/Vectorstore';
import { BaseTool } from './BaseTool';
+import { DocumentMetadataTool } from './DocumentMetadataTool';
const ragToolParams = [
{
@@ -17,7 +18,7 @@ type RAGToolParamsType = typeof ragToolParams;
const ragToolInfo: ToolInfo<RAGToolParamsType> = {
name: 'rag',
- description: 'Performs a RAG (Retrieval-Augmented Generation) search on user documents and returns a set of document chunks (text or images) to provide a grounded response based on user documents.',
+ description: `Performs a RAG (Retrieval-Augmented Generation) search on user documents (only PDF, audio, and video are supported—for information about other document types, use the ${DocumentMetadataTool.name} tool) and returns a set of document chunks (text or images) to provide a grounded response based on user documents.`,
citationRules: `When using the RAG tool, the structure must adhere to the format described in the ReAct prompt. Below are additional guidelines specifically for RAG-based responses:
1. **Grounded Text Guidelines**:
@@ -75,7 +76,7 @@ export class RAGTool extends BaseTool<RAGToolParamsType> {
async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<Observation[]> {
try {
- const { formattedChunks } = await Networking.PostToServer('/formatChunks', { relevantChunks }) as { formattedChunks: Observation[]}
+ const { formattedChunks } = (await Networking.PostToServer('/formatChunks', { relevantChunks })) as { formattedChunks: Observation[] };
if (!formattedChunks) {
throw new Error('Failed to format chunks');