aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-30 12:19:22 -0400
committerbobzel <zzzman@gmail.com>2024-09-30 12:19:22 -0400
commit139a3cb0b3b081c270187e9b4ca281d04ca923bf (patch)
treedd952f65f1bb53c29059fa22c2a38db8e0c47c47 /src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
parent04f1047d81bba00f9258543a8171683bce5272bb (diff)
upate AJ assistant from master and fix some lint errors
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts')
-rw-r--r--src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
index 2118218f6..1efb389b8 100644
--- a/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
+++ b/src/client/views/nodes/chatbot/tools/WebsiteInfoScraperTool.ts
@@ -1,6 +1,6 @@
+import { v4 as uuidv4 } from 'uuid';
import { Networking } from '../../../../Network';
import { BaseTool } from './BaseTool';
-import { v4 as uuidv4 } from 'uuid';
export class WebsiteInfoScraperTool extends BaseTool<{ url: string | string[] }> {
private _addLinkedUrlDoc: (url: string, id: string) => void;
@@ -63,7 +63,7 @@ export class WebsiteInfoScraperTool extends BaseTool<{ url: string | string[] }>
this._addLinkedUrlDoc = addLinkedUrlDoc;
}
- async execute(args: { url: string | string[] }): Promise<any> {
+ async execute(args: { url: string | string[] }): Promise<unknown> {
const urls = Array.isArray(args.url) ? args.url : [args.url];
const results = [];
@@ -74,6 +74,7 @@ export class WebsiteInfoScraperTool extends BaseTool<{ url: string | string[] }>
this._addLinkedUrlDoc(url, id);
results.push({ type: 'text', text: `<chunk chunk_id=${id} chunk_type=url>\n${website_plain_text}\n</chunk>\n` });
} catch (error) {
+ console.log(error);
results.push({ type: 'text', text: `An error occurred while scraping the website: ${url}` });
}
}