From 3a1d859359b462fc9a9f1c001d6681a8d886f2b6 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Thu, 29 Aug 2024 21:01:29 -0400 Subject: added loop summary and updated type for RAG tool output --- src/client/views/nodes/ChatBox/tools/RAGTool.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/client/views/nodes/ChatBox/tools') 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 { try { const { formattedChunks } = await Networking.PostToServer('/formatChunks', { relevantChunks }); - console.log('Formatted Chunks:', formattedChunks); + if (!formattedChunks) { throw new Error('Failed to format chunks'); } -- cgit v1.2.3-70-g09d2