mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 20:50:09 +01:00
move OpenAI to AiProvider folder in preparation for new AI provider support
This commit is contained in:
parent
8929d96ed0
commit
9bea7739ed
@ -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");
|
||||||
|
@ -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, {
|
||||||
|
@ -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: `${
|
||||||
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user