aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ChatBox/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/ChatBox/tools')
-rw-r--r--src/client/views/nodes/ChatBox/tools/RAGTool.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/nodes/ChatBox/tools/RAGTool.ts b/src/client/views/nodes/ChatBox/tools/RAGTool.ts
index fcd0ea43f..fe8deae6b 100644
--- a/src/client/views/nodes/ChatBox/tools/RAGTool.ts
+++ b/src/client/views/nodes/ChatBox/tools/RAGTool.ts
@@ -4,6 +4,7 @@ import { RAGChunk } from '../types';
import * as fs from 'fs';
import { Networking } from '../../../../Network';
import { file } from 'jszip';
+import { ChatCompletion, ChatCompletionContentPart, ChatCompletionMessageParam } from 'openai/resources';
export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> {
constructor(private vectorstore: Vectorstore) {
@@ -118,10 +119,10 @@ export class RAGTool extends BaseTool<{ hypothetical_document_chunk: string }> {
return formatted_chunks;
}
- async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<{ type: string; text?: string; image_url?: { url: string } }[]> {
+ async getFormattedChunks(relevantChunks: RAGChunk[]): Promise<ChatCompletionContentPart[]> {
try {
const { formattedChunks } = await Networking.PostToServer('/formatChunks', { relevantChunks });
- console.log('Formatted Chunks:', formattedChunks);
+
if (!formattedChunks) {
throw new Error('Failed to format chunks');
}