aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/agentsystem
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/chatbot/agentsystem')
-rw-r--r--src/client/views/nodes/chatbot/agentsystem/Agent.ts9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/views/nodes/chatbot/agentsystem/Agent.ts b/src/client/views/nodes/chatbot/agentsystem/Agent.ts
index 24471bf5b..86d40864e 100644
--- a/src/client/views/nodes/chatbot/agentsystem/Agent.ts
+++ b/src/client/views/nodes/chatbot/agentsystem/Agent.ts
@@ -63,10 +63,8 @@ export class Agent {
*/
constructor(
_vectorstore: Vectorstore,
- summaries: () => string,
history: () => string,
csvData: () => { filename: string; id: string; text: string }[],
- getLinkedUrlDocId: (url: string) => string[],
createImage: (result: Upload.FileInformation & Upload.InspectionResults, options: DocumentOptions) => void,
createCSVInDash: (url: string, title: string, id: string, data: string) => void,
docManager: AgentDocumentManager
@@ -83,7 +81,7 @@ export class Agent {
calculate: new CalculateTool(),
rag: new RAGTool(this.vectorstore),
dataAnalysis: new DataAnalysisTool(csvData),
- websiteInfoScraper: new WebsiteInfoScraperTool(getLinkedUrlDocId),
+ websiteInfoScraper: new WebsiteInfoScraperTool(this._docManager),
searchTool: new SearchTool(this._docManager),
noTool: new NoTool(),
//imageCreationTool: new ImageCreationTool(createImage),
@@ -125,11 +123,8 @@ export class Agent {
// Retrieve chat history and generate system prompt
const chatHistory = this._history();
// Get document summaries directly from document manager
- const documentSummaries = this._docManager.getAllDocumentSummaries();
- // Create a function that returns document summaries for the prompt
- const getSummaries = () => documentSummaries;
// Generate the system prompt with the summaries
- const systemPrompt = getReactPrompt(Object.values(this.tools), getSummaries, chatHistory);
+ const systemPrompt = getReactPrompt(Object.values(this.tools), () => JSON.stringify(this._docManager.listDocs), chatHistory);
// Initialize intermediate messages
this.interMessages = [{ role: 'system', content: systemPrompt }];