chore: Force VectorCache to always be on;

update file picker spacing for attributes
This commit is contained in:
timothycarambat 2023-12-20 10:45:03 -08:00
parent 67725e807a
commit 7bee849c65
8 changed files with 16 additions and 18 deletions

View File

@ -1,5 +1,4 @@
SERVER_PORT=3001
CACHE_VECTORS="true"
STORAGE_DIR="/app/server/storage"
UID='1000'
GID='1000'

View File

@ -60,7 +60,7 @@ export default function FileRow({
selected ? "bg-sky-500/20" : ""
} ${expanded ? "bg-sky-500/10" : ""}`}`}
>
<div className="pl-2 col-span-6 flex gap-x-[4px] items-center">
<div className="pl-2 col-span-5 flex gap-x-[4px] items-center">
<div
className="shrink-0 w-3 h-3 rounded border-[1px] border-white flex justify-center items-center cursor-pointer"
role="checkbox"
@ -88,10 +88,12 @@ export default function FileRow({
)}
</div>
</div>
<p className="col-span-2 pl-3.5 whitespace-nowrap">
<p className="col-span-3 pl-3.5 whitespace-nowrap">
{formatDate(item?.published)}
</p>
<p className="col-span-2 pl-2 uppercase">{getFileExtension(item.url)}</p>
<p className="col-span-2 pl-2 uppercase overflow-x-hidden">
{getFileExtension(item.url)}
</p>
<div className="col-span-2 flex justify-end items-center">
{item?.cached && (
<div className="bg-white/10 rounded-3xl">

View File

@ -71,8 +71,8 @@ export default function Directory({
<div className="relative w-[560px] h-[310px] bg-zinc-900 rounded-2xl">
<div className="rounded-t-2xl text-white/80 text-xs grid grid-cols-12 py-2 px-8 border-b border-white/20 shadow-lg bg-zinc-900 sticky top-0 z-10">
<p className="col-span-6">Name</p>
<p className="col-span-2">Date</p>
<p className="col-span-5">Name</p>
<p className="col-span-3">Date</p>
<p className="col-span-2">Kind</p>
<p className="col-span-2">Cached</p>
</div>

View File

@ -54,7 +54,7 @@ export default function WorkspaceFileRow({
className={`items-center transition-all duration-200 text-white/80 text-xs grid grid-cols-12 py-2 pl-3.5 pr-8 border-b border-white/20 hover:bg-sky-500/20 cursor-pointer
${isMovedItem ? "bg-green-800/40" : ""}`}
>
<div className="col-span-6 flex gap-x-[4px] items-center">
<div className="col-span-5 flex gap-x-[4px] items-center">
<File
className="text-base font-bold w-4 h-4 ml-3 mr-[3px]"
weight="fill"
@ -74,10 +74,12 @@ export default function WorkspaceFileRow({
)}
</div>
</div>
<p className="col-span-2 pl-3.5 whitespace-nowrap">
<p className="col-span-3 pl-3.5 whitespace-nowrap">
{formatDate(item?.published)}
</p>
<p className="col-span-2 pl-2 uppercase">{getFileExtension(item.url)}</p>
<p className="col-span-2 pl-2 uppercase overflow-x-hidden">
{getFileExtension(item.url)}
</p>
<div className="col-span-2 flex justify-end items-center">
{item?.cached && (
<div className="bg-white/10 rounded-3xl">

View File

@ -26,8 +26,8 @@ export default function WorkspaceDirectory({
</div>
<div className="relative w-[560px] h-[445px] bg-zinc-900 rounded-2xl mt-5">
<div className="text-white/80 text-xs grid grid-cols-12 py-2 px-8 border-b border-white/20">
<p className="col-span-6">Name</p>
<p className="col-span-2">Date</p>
<p className="col-span-5">Name</p>
<p className="col-span-3">Date</p>
<p className="col-span-2">Kind</p>
<p className="col-span-2">Cached</p>
</div>
@ -55,8 +55,8 @@ export default function WorkspaceDirectory({
}`}
>
<div className="text-white/80 text-xs grid grid-cols-12 py-2 px-8 border-b border-white/20 bg-zinc-900 sticky top-0 z-10">
<p className="col-span-6">Name</p>
<p className="col-span-2">Date</p>
<p className="col-span-5">Name</p>
<p className="col-span-3">Date</p>
<p className="col-span-2">Kind</p>
<p className="col-span-2">Cached</p>
</div>

View File

@ -1,5 +1,4 @@
SERVER_PORT=3001
CACHE_VECTORS="true"
JWT_SECRET="my-random-string-for-seeding" # Please generate random string at least 12 chars long.
###########################################

View File

@ -99,8 +99,6 @@ async function viewLocalFiles() {
// Searches the vector-cache folder for existing information so we dont have to re-embed a
// document and can instead push directly to vector db.
async function cachedVectorInformation(filename = null, checkOnly = false) {
if (!process.env.CACHE_VECTORS)
return checkOnly ? false : { exists: false, chunks: [] };
if (!filename) return checkOnly ? false : { exists: false, chunks: [] };
const digest = uuidv5(filename, uuidv5.URL);
@ -123,7 +121,6 @@ async function cachedVectorInformation(filename = null, checkOnly = false) {
// vectorData: pre-chunked vectorized data for a given file that includes the proper metadata and chunk-size limit so it can be iterated and dumped into Pinecone, etc
// filename is the fullpath to the doc so we can compare by filename to find cached matches.
async function storeVectorResult(vectorData = [], filename = null) {
if (!process.env.CACHE_VECTORS) return;
if (!filename) return;
console.log(
`Caching vectorized results of ${filename} to prevent duplicated embedding.`

View File

@ -314,7 +314,6 @@ async function dumpENV() {
const frozenEnvs = {};
const protectedKeys = [
...Object.values(KEY_MAPPING).map((values) => values.envKey),
"CACHE_VECTORS",
"STORAGE_DIR",
"SERVER_PORT",
// Password Schema Keys if present.