Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 27f4af9

Browse files
authored
Merge pull request #451 from reorproject/settings-fixes
make settings dialog and join text gen settings to llm
2 parents 40e7226 + 6273877 commit 27f4af9

37 files changed

+953
-1225
lines changed

electron/main/electron-store/storeConfig.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,15 @@ export type EmbeddingModelConfig = EmbeddingModelWithRepo | EmbeddingModelWithLo
2525
export interface EmbeddingModelWithRepo {
2626
type: 'repo'
2727
repoName: string
28+
description?: string
29+
readableName?: string
2830
}
2931

3032
export interface EmbeddingModelWithLocalPath {
3133
type: 'local'
3234
localPath: string
33-
}
34-
35-
export type Tab = {
36-
id: string // Unique ID for the tab, useful for operations
37-
path: string // Path to the content open in the tab
38-
title: string // Title of the tab
39-
lastAccessed: boolean
40-
// timeOpened: Date; // Timestamp to preserve order
41-
// isDirty: boolean; // Flag to indicate unsaved changes
35+
description?: string
36+
readableName?: string
4237
}
4338

4439
export interface StoreSchema {
@@ -65,7 +60,6 @@ export interface StoreSchema {
6560
isSBCompact: boolean
6661
spellCheck: string
6762
EditorFlexCenter: boolean
68-
OpenTabs: Tab[]
6963
showDocumentStats: boolean
7064
}
7165

@@ -87,6 +81,5 @@ export enum StoreKeys {
8781
IsSBCompact = 'isSBCompact',
8882
SpellCheck = 'spellCheck',
8983
EditorFlexCenter = 'editorFlexCenter',
90-
OpenTabs = 'OpenTabs',
9184
showDocumentStats = 'showDocumentStats',
9285
}

electron/main/vector-database/embeddings.ts

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,36 @@ import { splitDirectoryPathIntoBaseAndRepo } from '../filesystem/filesystem'
1515
import DownloadModelFilesFromHFRepo from './downloadModelsFromHF'
1616
import { DBEntry } from './schema'
1717

18-
export const defaultEmbeddingModelRepos = {
19-
'Xenova/UAE-Large-V1': { type: 'repo', repoName: 'Xenova/UAE-Large-V1' },
20-
'Xenova/bge-base-en-v1.5': {
18+
export const defaultEmbeddingModelRepos: Record<string, EmbeddingModelConfig> = {
19+
'Xenova/UAE-Large-V1': {
2120
type: 'repo',
22-
repoName: 'Xenova/bge-base-en-v1.5',
21+
repoName: 'Xenova/UAE-Large-V1',
22+
readableName: 'UAE-Large-V1',
23+
description: 'Recommended for English content',
2324
},
2425
'Xenova/bge-small-en-v1.5': {
2526
type: 'repo',
2627
repoName: 'Xenova/bge-small-en-v1.5',
28+
readableName: 'bge-small-en-v1.5',
29+
description: 'Recommended for low-power devices',
30+
},
31+
'Xenova/multilingual-e5-large': {
32+
type: 'repo',
33+
repoName: 'Xenova/multilingual-e5-large',
34+
readableName: 'multilingual-e5-large',
35+
description: 'Recommended for non-English content',
36+
},
37+
'Xenova/jina-embeddings-v2-base-zh': {
38+
type: 'repo',
39+
repoName: 'Xenova/jina-embeddings-v2-base-zh',
40+
readableName: 'jina-embeddings-v2-base-zh',
41+
description: 'Recommended for Chinese content',
42+
},
43+
'Xenova/jina-embeddings-v2-base-de': {
44+
type: 'repo',
45+
repoName: 'Xenova/jina-embeddings-v2-base-de',
46+
readableName: 'jina-embeddings-v2-base-de',
47+
description: 'Recommended for German content',
2748
},
2849
}
2950

package-lock.json

Lines changed: 93 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "reor-project",
3-
"version": "0.2.21",
3+
"version": "0.2.23",
44
"productName": "Reor",
55
"main": "dist-electron/main/index.js",
66
"description": "An AI note-taking app that runs models locally.",
@@ -51,11 +51,13 @@
5151
"@radix-ui/react-icons": "^1.3.0",
5252
"@radix-ui/react-label": "^2.1.0",
5353
"@radix-ui/react-popover": "^1.1.1",
54+
"@radix-ui/react-progress": "^1.1.0",
5455
"@radix-ui/react-scroll-area": "^1.2.0",
5556
"@radix-ui/react-select": "^2.1.1",
5657
"@radix-ui/react-slider": "^1.2.0",
5758
"@radix-ui/react-slot": "^1.1.0",
5859
"@radix-ui/react-switch": "^1.1.0",
60+
"@radix-ui/react-tabs": "^1.1.1",
5961
"@radix-ui/react-tooltip": "^1.1.3",
6062
"@sentry/electron": "^5.3.0",
6163
"@tailwindcss/typography": "^0.5.10",

src/components/Chat/ChatConfigComponents/PromptEditor.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ const PromptEditor: React.FC<{
3333
return (
3434
<div className="w-[32rem] text-foreground">
3535
<h3 className="text-foreground">Edit System Prompt</h3>
36-
<p className="text-muted-foreground">Customize the system prompt for your AI assistant.</p>
36+
<p className="text-muted-foreground">
37+
Customize the system prompt for your AI assistant. Use <code>{'{TODAY}'}</code> to feed the model today&apos;s
38+
date.
39+
</p>
3740
<div className="grid gap-6 py-4">
3841
<div className="flex items-start gap-4">
3942
<Textarea

src/components/Chat/StartChat.tsx

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { PiPaperPlaneRight } from 'react-icons/pi'
33
import { FiSettings } from 'react-icons/fi'
44
import { LLMConfig } from 'electron/main/electron-store/storeConfig'
55
import { AgentConfig, ToolDefinition, DatabaseSearchFilters } from '../../lib/llm/types'
6-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
76
import { Button } from '@/components/ui/button'
87
import DbSearchFilters from './ChatConfigComponents/DBSearchFilters'
98
import PromptEditor from './ChatConfigComponents/PromptEditor'
@@ -24,6 +23,7 @@ import exampleAgents from './ChatConfigComponents/exampleAgents'
2423
import { allAvailableToolDefinitions } from '@/lib/llm/tools/tool-definitions'
2524
import ToolSelector from './ChatConfigComponents/ToolSelector'
2625
import SuggestionCard from '../ui/suggestion-card'
26+
import LLMSelectOrButton from '../Settings/LLMSettings/LLMSelectOrButton'
2727

2828
interface StartChatProps {
2929
defaultModelName: string
@@ -36,9 +36,9 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
3636
const [userTextFieldInput, setUserTextFieldInput] = useState<string>('')
3737
const [agentConfig, setAgentConfig] = useState<AgentConfig>()
3838
const [promptSuggestions] = useState([
39-
"What's the latest update on my project?",
39+
'Generate a list of all the thoughts I have written on the topic of AGI',
4040
'Summarize my recent notes on machine learning',
41-
'Create a to-do list for today based on my calendar',
41+
'Based on what I wrote last week, which tasks should I focus on this week?',
4242
])
4343

4444
useEffect(() => {
@@ -71,10 +71,6 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
7171
handleNewChatMessage(userTextFieldInput, { ...agentConfig })
7272
}
7373

74-
const handleLLMChange = (value: string) => {
75-
setSelectedLLM(value)
76-
}
77-
7874
const handleToolsChange = (tools: ToolDefinition[]) => {
7975
setAgentConfig((prevConfig) => {
8076
if (!prevConfig) throw new Error('Agent config must be initialized before setting tools')
@@ -114,9 +110,10 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
114110
<div className="flex w-full justify-center">
115111
<img src="icon.png" className="size-16" alt="ReorImage" />
116112
</div>
117-
<h1 className="mb-10 text-[28px] text-foreground">
118-
Welcome to your AI-powered assistant! Start a conversation with your second brain!
119-
</h1>
113+
<h1 className="mb-0 text-[28px] text-foreground">Welcome to your AI second brain.</h1>
114+
<p className="mb-10 mt-1 text-muted-foreground">
115+
Start a chat below. You can provide tools for the LLM to use and customize the system prompt below.{' '}
116+
</p>
120117
<div className="flex w-full">
121118
<div className="mr-4">
122119
<ToolSelector
@@ -144,18 +141,12 @@ const StartChat: React.FC<StartChatProps> = ({ defaultModelName, handleNewChatMe
144141
<div className="mx-auto h-px w-[96%] bg-background/20" />
145142
<div className="flex h-10 flex-col items-center justify-between gap-2 py-2 md:flex-row md:gap-4">
146143
<div className="flex flex-col items-center justify-between rounded-md border-0 py-2 md:flex-row">
147-
<Select value={selectedLLM} onValueChange={handleLLMChange}>
148-
<SelectTrigger className="m-2 w-32 border border-solid border-muted-foreground bg-transparent">
149-
<SelectValue placeholder="Select LLM" />
150-
</SelectTrigger>
151-
<SelectContent>
152-
{llmConfigs.map((llm) => (
153-
<SelectItem key={llm.modelName} value={llm.modelName}>
154-
{llm.modelName}
155-
</SelectItem>
156-
))}
157-
</SelectContent>
158-
</Select>
144+
<LLMSelectOrButton
145+
llmConfigs={llmConfigs}
146+
selectedLLM={selectedLLM}
147+
setSelectedLLM={setSelectedLLM}
148+
setLLMConfigs={setLLMConfigs}
149+
/>
159150
</div>
160151
<div className="flex items-center">
161152
<Button

src/components/Chat/index.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,17 @@ const ChatComponent: React.FC = () => {
115115
if (error instanceof Error && error.name === 'AI_APICallError' && error.message.includes('Bad Request')) {
116116
if (agentConfig && agentConfig?.toolDefinitions.length > 0 && outputChat) {
117117
toast.info(
118-
'Disabling tools as this model does not support them. If you want to use tools, please select a different model. If you want to retrieve from your knowledge base, select "make initial search" option.',
118+
<div>
119+
This model does not support tool calling. To use tool calling, please download a model from this page:{' '}
120+
<a href="https://ollama.com/search?c=tools" target="_blank" rel="noopener noreferrer">
121+
https://ollama.com/search?c=tools
122+
</a>{' '}
123+
or use a cloud LLM like GPT-4o or Claude.
124+
</div>,
125+
{
126+
autoClose: false,
127+
closeOnClick: false,
128+
},
119129
)
120130
const agentWithoutTools = { ...agentConfig, toolDefinitions: [] }
121131
outputChat.toolDefinitions = []

src/components/Common/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const ReorModal: React.FC<ModalProps> = ({
3636

3737
const modalContent = (
3838
<div
39-
className={`fixed inset-0 z-[9999] flex h-screen w-screen items-center justify-center bg-black/40 ${tailwindStylesOnBackground}`}
39+
className={`fixed inset-0 flex h-screen w-screen items-center justify-center bg-black/40 ${tailwindStylesOnBackground}`}
4040
>
4141
<div
4242
ref={modalRef}

src/components/Settings/AnalyticsSettings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ const AnalyticsSettings: React.FC<AnalyticsSettingsProps> = () => {
3434
<div className="w-full rounded bg-dark-gray-c-three pb-7 ">
3535
<h2 className="mb-0 text-2xl font-semibold text-white">Analytics</h2>{' '}
3636
<p className="mb-2 mt-5 text-sm text-gray-200">
37-
Reor tracks anonymous usage data to help improve the app. We never share this personal data. This is solely to
38-
track which features are popular. You can disable this at any time:
37+
Reor tracks anonymous usage data to help us understand how the app is used and which features are popular. You
38+
can disable this at any time:
3939
</p>
4040
<Switch
4141
checked={isAnalyticsEnabled}

0 commit comments

Comments
 (0)