Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollama privder fix #44

Merged
merged 3 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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