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/RAGTool.ts | |
| parent | 04f1047d81bba00f9258543a8171683bce5272bb (diff) | |
upate AJ assistant from master and fix some lint errors
Diffstat (limited to 'src/client/views/nodes/chatbot/tools/RAGTool.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/tools/RAGTool.ts | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/client/views/nodes/chatbot/tools/RAGTool.ts b/src/client/views/nodes/chatbot/tools/RAGTool.ts index f4b7b42ea..4cc2f26ff 100644 --- a/src/client/views/nodes/chatbot/tools/RAGTool.ts +++ b/src/client/views/nodes/chatbot/tools/RAGTool.ts @@ -1,10 +1,7 @@ -import { BaseTool } from './BaseTool'; -import { Vectorstore } from '../vectorstore/Vectorstore'; -import { RAGChunk } from '../types/types'; -import * as fs from 'fs'; import { Networking } from '../../../../Network'; -import { file } from 'jszip'; -import { ChatCompletion, ChatCompletionContentPart, ChatCompletionMessageParam } from 'openai/resources'; +import { RAGChunk } from '../types/types'; +import { Vectorstore } from '../vectorstore/Vectorstore'; +import { BaseTool } from './BaseTool'; export class RAGTool extends BaseTool { constructor(private vectorstore: Vectorstore) { @@ -59,13 +56,13 @@ export class RAGTool extends BaseTool { ); } - async execute(args: { hypothetical_document_chunk: string }): Promise<any> { + async execute(args: { hypothetical_document_chunk: string }): Promise<unknown> { const relevantChunks = await this.vectorstore.retrieve(args.hypothetical_document_chunk); const formatted_chunks = await this.getFormattedChunks(relevantChunks); return formatted_chunks; } - async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<any> { + async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<unknown> { try { const { formattedChunks } = await Networking.PostToServer('/formatChunks', { relevantChunks }); |
