fix: docker rag bug

This commit is contained in:
Hk-Gosuto
2024-04-08 12:42:10 +08:00
parent b00e9f0c79
commit dc4137505e
11 changed files with 20 additions and 16 deletions

View File

@@ -60,7 +60,7 @@ export class NodeJSTool {
wolframAlphaTool,
pdfBrowserTool,
];
if (!!process.env.NEXT_PUBLIC_ENABLE_RAG) {
if (!!process.env.ENABLE_RAG) {
tools.push(new RAGSearch(this.sessionId, this.model, this.ragEmbeddings));
}
return tools;

View File

@@ -37,6 +37,8 @@ export class RAGSearch extends Tool {
/** @ignore */
async _call(inputs: string, runManager?: CallbackManagerForToolRun) {
const serverConfig = getServerSideConfig();
if (!serverConfig.isEnableRAG)
throw new Error("env ENABLE_RAG not configured");
// const pinecone = new Pinecone();
// const pineconeIndex = pinecone.Index(serverConfig.pineconeIndex!);
// const vectorStore = await PineconeStore.fromExistingIndex(this.embeddings, {