aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/agentsystem
diff options
context:
space:
mode:
authorA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 17:18:18 -0400
committerA.J. Shulman <Shulman.aj@gmail.com>2025-05-11 17:18:18 -0400
commite141307dbd9b951f76c908610e7b89e296ad92b8 (patch)
treea48d7cae7a7702519d2099dfff5a503fcfc7875f /src/client/views/nodes/chatbot/agentsystem
parente5cb67b92d9b3c84dc90b1e64cc7128621523801 (diff)
chanegd everything to be more consistent
- made both web related tools use doc manager and chunk Ids
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 }];