Skip to content

Commit

Permalink
chore: Force VectorCache to always be on;
Browse files Browse the repository at this point in the history
update file picker spacing for attributes
  • Loading branch information
timothycarambat committed Dec 20, 2023
1 parent 67725e8 commit 7bee849
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
1 change: 0 additions & 1 deletion docker/.env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
SERVER_PORT=3001
CACHE_VECTORS="true"
STORAGE_DIR="/app/server/storage"
UID='1000'
GID='1000'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
@@ -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.

###########################################
Expand Down
3 changes: 0 additions & 3 deletions server/utils/files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.`
Expand Down
1 change: 0 additions & 1 deletion server/utils/helpers/updateENV.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7bee849

Please sign in to comment.