Skip to content
Snippets Groups Projects
Commit 032c9d27 authored by timothycarambat's avatar timothycarambat
Browse files

UI updates and linting

parent 98d72662
No related branches found
No related tags found
No related merge requests found
...@@ -150,13 +150,11 @@ export default function WorkspaceSettings({ workspace }) { ...@@ -150,13 +150,11 @@ export default function WorkspaceSettings({ workspace }) {
Chat History Chat History
</label> </label>
<p className="text-xs text-gray-600 dark:text-stone-400"> <p className="text-xs text-gray-600 dark:text-stone-400">
Chat history: The number of previous chats that The number of previous chats that will be included in the
will be included in the response's short-term memory. response's short-term memory.
<br /> <br />
Recommend 20. Anything more than 45 is likely to lead to Recommend 20. Anything more than 45 is likely to lead to
continuous chat failures depending on message size. continuous chat failures depending on message size.
<br />
Recommended: 20
</p> </p>
</div> </div>
<input <input
......
...@@ -113,7 +113,7 @@ const Workspace = { ...@@ -113,7 +113,7 @@ const Workspace = {
const values = Object.values(data); const values = Object.values(data);
if (validKeys.length === 0 || validKeys.length !== values.length) if (validKeys.length === 0 || validKeys.length !== values.length)
return { workspace: { id }, message: "No valid fields to update!" }; return { workspace: { id }, message: "No valid fields to update!" };
const template = `UPDATE ${this.tablename} SET ${validKeys.map((key) => { const template = `UPDATE ${this.tablename} SET ${validKeys.map((key) => {
return `${key}=?`; return `${key}=?`;
})} WHERE id = ?`; })} WHERE id = ?`;
...@@ -127,7 +127,7 @@ const Workspace = { ...@@ -127,7 +127,7 @@ const Workspace = {
return { success: false, message: error.message }; return { success: false, message: error.message };
}); });
db.close(); db.close();
if (!success) { if (!success) {
return { workspace: null, message }; return { workspace: null, message };
} }
......
...@@ -105,8 +105,11 @@ async function chatWithWorkspace(workspace, message, chatMode = "chat") { ...@@ -105,8 +105,11 @@ async function chatWithWorkspace(workspace, message, chatMode = "chat") {
}; };
} else { } else {
var messageLimit = workspace?.openAiHistory; var messageLimit = workspace?.openAiHistory;
const rawHistory = await WorkspaceChats.forWorkspace(workspace.id, messageLimit); const rawHistory = await WorkspaceChats.forWorkspace(
workspace.id,
messageLimit
);
const chatHistory = convertToPromptHistory(rawHistory); const chatHistory = convertToPromptHistory(rawHistory);
const { const {
response, response,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment