diff options
| author | A.J. Shulman <Shulman.aj@gmail.com> | 2024-12-18 11:46:14 -0500 |
|---|---|---|
| committer | A.J. Shulman <Shulman.aj@gmail.com> | 2024-12-18 11:46:14 -0500 |
| commit | ad1e0cf62187e0f8bbb19b4720b7681585361de9 (patch) | |
| tree | 673dd63ddc1808e6e89dab5021c2136cbbe843c8 /src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts | |
| parent | 9e447814b551c352709296ae562f1f50480320f5 (diff) | |
better
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts | 27 |
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 ce659e344..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 '../types/tool_types'; +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; } |
