Skip to content

Commit

Permalink
Merge pull request #44 from CNTRLAI/ollama-privder-fix
Browse files Browse the repository at this point in the history
Ollama privder fix
  • Loading branch information
Hairetsucodes authored Feb 23, 2025
2 parents fd683ac + 2ec76ab commit c418cbb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"homepage": "https://github.com/CNTRLAI/notate",
"private": true,
"version": "1.1.3",
"version": "1.1.31",
"type": "module",
"main": "dist-electron/main.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion Frontend/src/context/SysSettingsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ const SysSettingsProvider: React.FC<{ children: React.ReactNode }> = ({
title: "Success",
description: `Started Ollama with model: ${model}`,
});

await window.electron.updateUserSettings({
userId: activeUser.id,
provider: "Ollama",
model: model,
});
setSettings((prev) => ({
...prev,
provider: "Ollama",
Expand Down
11 changes: 11 additions & 0 deletions Frontend/src/electron/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ class DatabaseService {
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS ollama_external (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER,
name TEXT NOT NULL,
endpoint TEXT NOT NULL,
api_key TEXT NOT NULL,
model TEXT NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS account (
id INTEGER PRIMARY KEY AUTOINCREMENT,
type TEXT NOT NULL,
Expand Down Expand Up @@ -467,6 +477,7 @@ class DatabaseService {
"timestamp",
],
retrieved_data: ["id", "message_id", "data_content"],
ollama_external: ["id", "user_id", "name", "endpoint", "api_key", "model"],
} as const;

tables.forEach((table) => {
Expand Down

0 comments on commit c418cbb

Please sign in to comment.