From be9d8b039771740e39c83ddc5ff2585a8adedafa Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Mon, 6 Nov 2023 13:13:53 -0800 Subject: [PATCH] Infinite prompt input and compression implementation (#332) * WIP on continuous prompt window summary * wip * Move chat out of VDB simplify chat interface normalize LLM model interface have compression abstraction Cleanup compressor TODO: Anthropic stuff * Implement compression for Anythropic Fix lancedb sources * cleanup vectorDBs and check that lance, chroma, and pinecone are returning valid metadata sources * Resolve Weaviate citation sources not working with schema * comment cleanup --- .../LLMSelection/AnthropicAiOptions/index.jsx | 4 +- .../LLMSelection/AzureAiOptions/index.jsx | 17 + .../Modals/MangeWorkspace/Settings/index.jsx | 1 - .../ChatContainer/PromptInput/index.jsx | 1 - server/endpoints/chat.js | 1 + server/models/cacheData.js | 69 ++++ server/models/systemSettings.js | 1 + server/package.json | 1 + .../20231101195421_init/migration.sql | 11 + server/prisma/schema.prisma | 11 + server/utils/AiProviders/anthropic/index.js | 63 +++- server/utils/AiProviders/azureOpenAi/index.js | 60 ++-- server/utils/AiProviders/openAi/index.js | 48 ++- server/utils/chats/index.js | 206 +++++++---- server/utils/helpers/chat/index.js | 325 ++++++++++++++++++ server/utils/helpers/tiktoken.js | 57 +++ server/utils/helpers/updateENV.js | 14 +- .../utils/vectorDbProviders/chroma/index.js | 76 +--- server/utils/vectorDbProviders/lance/index.js | 82 +---- .../utils/vectorDbProviders/pinecone/index.js | 74 +--- .../utils/vectorDbProviders/qdrant/index.js | 79 +---- .../utils/vectorDbProviders/weaviate/index.js | 79 +---- server/yarn.lock | 2 +- 23 files changed, 837 insertions(+), 445 deletions(-) create mode 100644 server/models/cacheData.js create mode 100644 server/prisma/migrations/20231101195421_init/migration.sql create mode 100644 server/utils/helpers/chat/index.js create mode 100644 server/utils/helpers/tiktoken.js diff --git a/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx b/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx index c2b29468..52094105 100644 --- a/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx +++ b/frontend/src/components/LLMSelection/AnthropicAiOptions/index.jsx @@ -24,7 +24,7 @@ export default function AnthropicAiOptions({ settings, showAlert = false }) {
- {["claude-2"].map((model) => { + {["claude-2", "claude-instant-1"].map((model) => { return (
+
+ + +
+