aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2025-03-10 16:13:04 -0400
committerbobzel <zzzman@gmail.com>2025-03-10 16:13:04 -0400
commitb7989dded8bb001876de6cbca59bf77935f0daf7 (patch)
tree0dba0665674db7bb84770833df0a4100d0520701 /src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
parent4979415d4604d280e81a162bf9a9d39c731d3738 (diff)
parent5bf944035c0ba94ad15245416f51ca0329a51bde (diff)
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
index f2e3863a6..19ccd0b36 100644
--- a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
+++ b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
@@ -2,7 +2,7 @@ import { v4 as uuidv4 } from 'uuid';
import { Networking } from '../../../../Network';
import { BaseTool } from './BaseTool';
import { Observation } from '../types/types';
-import { ParametersType } from './ToolTypes';
+import { ParametersType, ToolInfo } from '../types/tool_types';
const websiteInfoScraperToolParams = [
{
@@ -16,15 +16,10 @@ const websiteInfoScraperToolParams = [
type WebsiteInfoScraperToolParamsType = typeof websiteInfoScraperToolParams;
-export class WebsiteInfoScraperTool extends BaseTool<WebsiteInfoScraperToolParamsType> {
- private _addLinkedUrlDoc: (url: string, id: string) => void;
-
- constructor(addLinkedUrlDoc: (url: string, id: string) => void) {
- super(
- 'websiteInfoScraper',
- 'Scrape detailed information from specific websites relevant to the user query',
- websiteInfoScraperToolParams,
- `
+const websiteInfoScraperToolInfo: ToolInfo<WebsiteInfoScraperToolParamsType> = {
+ name: 'websiteInfoScraper',
+ description: 'Scrape detailed information from specific websites relevant to the user query. Returns the text content of the webpages for further analysis and grounding.',
+ citationRules: `
Your task is to provide a comprehensive response to the user's prompt using the content scraped from relevant websites. Ensure you follow these guidelines for structuring your response:
1. Grounded Text Tag Structure:
@@ -64,9 +59,17 @@ export class WebsiteInfoScraperTool extends BaseTool<WebsiteInfoScraperToolParam
<question>Are there additional factors that could influence economic growth beyond investments and inflation?</question>
</follow_up_questions>
</answer>
+
+ ***NOTE***: Ensure that the response is structured correctly and adheres to the guidelines provided. Also, if needed/possible, cite multiple websites to provide a comprehensive response.
`,
- 'Returns the text content of the webpages for further analysis and grounding.'
- );
+ parameterRules: websiteInfoScraperToolParams,
+};
+
+export class WebsiteInfoScraperTool extends BaseTool<WebsiteInfoScraperToolParamsType> {
+ private _addLinkedUrlDoc: (url: string, id: string) => void;
+
+ constructor(addLinkedUrlDoc: (url: string, id: string) => void) {
+ super(websiteInfoScraperToolInfo);
this._addLinkedUrlDoc = addLinkedUrlDoc;
}