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 { v4: uuidv4 } = require("uuid");
const { OpenAi } = require("../openAi"); const { OpenAi } = require("../AiProviders/openAi");
const { WorkspaceChats } = require("../../models/workspaceChats"); const { WorkspaceChats } = require("../../models/workspaceChats");
const { resetMemory } = require("./commands/reset"); const { resetMemory } = require("./commands/reset");
const moment = require("moment"); const moment = require("moment");

View File

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

View File

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

View File

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