diff options
| author | bobzel <zzzman@gmail.com> | 2024-09-30 12:19:22 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-09-30 12:19:22 -0400 |
| commit | 139a3cb0b3b081c270187e9b4ca281d04ca923bf (patch) | |
| tree | dd952f65f1bb53c29059fa22c2a38db8e0c47c47 /src/client/views/nodes/chatbot/tools/WikipediaTool.ts | |
| parent | 04f1047d81bba00f9258543a8171683bce5272bb (diff) | |
upate AJ assistant from master and fix some lint errors
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/WikipediaTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/WikipediaTool.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/client/views/nodes/chatbot/tools/WikipediaTool.ts b/src/client/views/nodes/chatbot/tools/WikipediaTool.ts index 143d91d80..692dff749 100644 --- a/src/client/views/nodes/chatbot/tools/WikipediaTool.ts +++ b/src/client/views/nodes/chatbot/tools/WikipediaTool.ts @@ -1,8 +1,6 @@ -import { title } from 'process'; +import { v4 as uuidv4 } from 'uuid'; import { Networking } from '../../../../Network'; import { BaseTool } from './BaseTool'; -import axios from 'axios'; -import { v4 as uuidv4 } from 'uuid'; export class WikipediaTool extends BaseTool<{ title: string }> { private _addLinkedUrlDoc: (url: string, id: string) => void; @@ -23,7 +21,7 @@ export class WikipediaTool extends BaseTool<{ title: string }> { this._addLinkedUrlDoc = addLinkedUrlDoc; } - async execute(args: { title: string }): Promise<any> { + async execute(args: { title: string }): Promise<unknown> { try { const { text } = await Networking.PostToServer('/getWikipediaSummary', { title: args.title }); const id = uuidv4(); @@ -31,6 +29,7 @@ export class WikipediaTool extends BaseTool<{ title: string }> { this._addLinkedUrlDoc(url, id); return [{ type: 'text', text: `<chunk chunk_id=${id} chunk_type=csv}> ${text} </chunk>` }]; } catch (error) { + console.log(error); return [{ type: 'text', text: 'An error occurred while fetching the article.' }]; } } |
