move OpenAI to AiProvider folder in preparation for new AI provider support

This commit is contained in:
timothycarambat 2023-07-28 12:09:49 -07:00
parent 8929d96ed0
commit 9bea7739ed
5 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
const { v4: uuidv4 } = require("uuid");
const { OpenAi } = require("../openAi");
const { OpenAi } = require("../AiProviders/openAi");
const { WorkspaceChats } = require("../../models/workspaceChats");
const { resetMemory } = require("./commands/reset");
const moment = require("moment");

View File

@ -8,7 +8,7 @@ const { storeVectorResult, cachedVectorInformation } = require("../../files");
const { v4: uuidv4 } = require("uuid");
const { toChunks } = require("../../helpers");
const { chatPrompt } = require("../../chats");
const { OpenAi } = require("../../openAi");
const { OpenAi } = require("../../AiProviders/openAi");
const Chroma = {
name: "Chroma",
@ -324,10 +324,10 @@ const Chroma = {
content: `${chatPrompt(workspace)}
Context:
${contextTexts
.map((text, i) => {
return `[CONTEXT ${i}]:\n${text}\n[END CONTEXT ${i}]\n\n`;
})
.join("")}`,
.map((text, i) => {
return `[CONTEXT ${i}]:\n${text}\n[END CONTEXT ${i}]\n\n`;
})
.join("")}`,
};
const memory = [prompt, ...chatHistory, { role: "user", content: input }];
const responseText = await openAiConnector.getChatCompletion(memory, {

View File

@ -5,7 +5,7 @@ const { RecursiveCharacterTextSplitter } = require("langchain/text_splitter");
const { storeVectorResult, cachedVectorInformation } = require("../../files");
const { v4: uuidv4 } = require("uuid");
const { chatPrompt } = require("../../chats");
const { OpenAi } = require("../../openAi");
const { OpenAi } = require("../../AiProviders/openAi");
const LanceDb = {
uri: `${

View File

@ -8,7 +8,7 @@ const { storeVectorResult, cachedVectorInformation } = require("../../files");
const { v4: uuidv4 } = require("uuid");
const { toChunks } = require("../../helpers");
const { chatPrompt } = require("../../chats");
const { OpenAi } = require("../../openAi");
const { OpenAi } = require("../../AiProviders/openAi");
const Pinecone = {
name: "Pinecone",