From a283410cce242acd54213398ba8fdd788134fbb0 Mon Sep 17 00:00:00 2001 From: samlhuillier Date: Wed, 13 Dec 2023 05:08:35 +0530 Subject: [PATCH] add ai model manager to initial settings page --- electron/main/index.ts | 16 ++++++++-------- .../Settings/InitialSettingsPage.tsx | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/electron/main/index.ts b/electron/main/index.ts index af525edb..44fa707b 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -29,17 +29,17 @@ import { validateAIModelConfig } from "./llm/llmConfig"; import { registerStoreHandlers } from "./Store/storeHandlers"; const store = new Store(); -// const user = store.get("user"); +const user = store.get("user"); // store.clear(); -// // Check if 'user' and 'directory' exist before attempting to delete -// if (user && typeof user === "object" && "directory" in user) { -// // Delete the 'directory' property -// delete user.directory; +// Check if 'user' and 'directory' exist before attempting to delete +if (user && typeof user === "object" && "directory" in user) { + // Delete the 'directory' property + delete user.directory; -// // Save the updated 'user' object back to the store -// store.set("user", user); -// } + // Save the updated 'user' object back to the store + store.set("user", user); +} process.env.DIST_ELECTRON = join(__dirname, "../"); process.env.DIST = join(process.env.DIST_ELECTRON, "../dist"); diff --git a/src/components/Settings/InitialSettingsPage.tsx b/src/components/Settings/InitialSettingsPage.tsx index 613f2054..0444a7c8 100644 --- a/src/components/Settings/InitialSettingsPage.tsx +++ b/src/components/Settings/InitialSettingsPage.tsx @@ -3,6 +3,7 @@ import { useEffect, useState } from "react"; import Modal from "../Generic/Modal"; import { Button } from "@material-tailwind/react"; +import AIModelManager from "./LLMSettings"; interface Props { onDirectorySelected: (path: string) => void; @@ -63,8 +64,8 @@ const DirectoryPicker: React.FC = ({ onDirectorySelected }) => { onClose={() => console.log("Not allowing a close for now")} hideCloseButton={true} > -
-
+
+

Welcome to the Reor Project.

@@ -89,23 +90,24 @@ const DirectoryPicker: React.FC = ({ onDirectorySelected }) => {

Embedding Model

-

LLM

+ + {/*

LLM

+ /> */}

Open AI Key

setOpenAIKey(e.target.value)} onKeyDown={handleKeyPress} @@ -113,7 +115,7 @@ const DirectoryPicker: React.FC = ({ onDirectorySelected }) => { />