aboutsummaryrefslogtreecommitdiff
path: root/src/client/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views')
-rw-r--r--src/client/views/nodes/ChatBox/tools/WebsiteInfoScraperTool.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/views/nodes/ChatBox/tools/WebsiteInfoScraperTool.ts b/src/client/views/nodes/ChatBox/tools/WebsiteInfoScraperTool.ts
index 59fd47b7a..c59afefbd 100644
--- a/src/client/views/nodes/ChatBox/tools/WebsiteInfoScraperTool.ts
+++ b/src/client/views/nodes/ChatBox/tools/WebsiteInfoScraperTool.ts
@@ -24,10 +24,19 @@ export class WebsiteInfoScraperTool extends BaseTool<{ url: string }> {
async execute(args: { url: string }): Promise<any> {
try {
- const { html } = await Networking.PostToServer('/scrapeWebsite', { url: args.url });
+ const { website_image_base64 } = await Networking.PostToServer('/scrapeWebsite', { url: args.url });
const id = uuidv4();
this._addLinkedUrlDoc(args.url, id);
- return [{ type: 'text', text: `<chunk chunk_id=${id} chunk_type=text> ${html} </chunk>` }];
+ return [
+ { type: 'text', text: `<chunk chunk_id=${id} chunk_type=url> ` },
+ {
+ type: 'image_url',
+ image_url: {
+ url: `data:image/jpeg;base64,${website_image_base64}`,
+ },
+ },
+ { type: 'text', text: `</chunk>\n` },
+ ];
} catch (error) {
return [{ type: 'text', text: 'An error occurred while scraping the website.' }];
}