ai: relocate user option to avoid confusion

sidebar.ai.extraGptModels -> ai.extraGptModels
This commit is contained in:
end-4
2025-04-06 01:55:22 +02:00
parent ca73b05c70
commit a7cd64a88b
3 changed files with 73 additions and 28 deletions
@@ -9,7 +9,20 @@
"useHistory": false, "useHistory": false,
"safety": true, "safety": true,
"writingCursor": " ...", // Warning: Using weird characters can mess up Markdown rendering "writingCursor": " ...", // Warning: Using weird characters can mess up Markdown rendering
"proxyUrl": null // Can be "socks5://127.0.0.1:9050" or "http://127.0.0.1:8080" for example. Leave it blank if you don't need it. "proxyUrl": null, // Can be "socks5://127.0.0.1:9050" or "http://127.0.0.1:8080" for example. Leave it blank if you don't need it.
"extraGptModels": {
// Below is an example. Copy to user_options.jsonc and edit it
// The base url is conveniently ollama's btw
// "model_id": {
// "name": "User-added model",
// "logo_name": "ollama-symbolic",
// "description": "A model added by the user",
// "base_url": "http://localhost:11434/v1/chat/completions",
// "key_get_url": "",
// "key_file": "api_key_file.txt",
// "model": "model-name"
// },
}
}, },
"animations": { "animations": {
"choreographyDelay": 35, "choreographyDelay": 35,
@@ -40,9 +53,21 @@
"battery": { "battery": {
"low": 20, "low": 20,
"critical": 10, "critical": 10,
"warnLevels": [20, 15, 5], "warnLevels": [
"warnTitles": ["Low battery", "Very low battery", "Critical Battery"], 20,
"warnMessages": ["Plug in the charger", "You there?", "PLUG THE CHARGER ALREADY"], 15,
5
],
"warnTitles": [
"Low battery",
"Very low battery",
"Critical Battery"
],
"warnMessages": [
"Plug in the charger",
"You there?",
"PLUG THE CHARGER ALREADY"
],
"suspendThreshold": 3 "suspendThreshold": 3
}, },
"brightness": { "brightness": {
@@ -87,34 +112,34 @@
"wsNumMarginScale": 0.07 "wsNumMarginScale": 0.07
}, },
"sidebar": { "sidebar": {
"ai": {
"extraGptModels": {
// Below is an example. Copy to user_options.jsonc and edit it
// The base url is conveniently ollama's btw
// "model_id": {
// "name": "User-added model",
// "logo_name": "ollama-symbolic",
// "description": "A model added by the user",
// "base_url": "http://localhost:11434/v1/chat/completions",
// "key_get_url": "",
// "key_file": "api_key_file.txt",
// "model": "model-name"
// },
}
},
"image": { "image": {
"columns": 2, "columns": 2,
"batchCount": 20, "batchCount": 20,
"allowNsfw": false "allowNsfw": false
}, },
"pages": { "pages": {
"order": ["apis", "tools"], "order": [
"apis",
"tools"
],
"apis": { "apis": {
"order": ["gemini", "gpt", "waifu", "booru"] "order": [
"gemini",
"gpt",
"waifu",
"booru"
]
} }
}, },
"quickToggles": { "quickToggles": {
"order": ["wifi", "bluetooth", "nightlight", "gamemode", "idleinhibitor", "cloudflarewarp"] "order": [
"wifi",
"bluetooth",
"nightlight",
"gamemode",
"idleinhibitor",
"cloudflarewarp"
]
}, },
"calendar": { "calendar": {
"expandByDefault": true "expandByDefault": true
@@ -130,7 +155,9 @@
"webSearch": true "webSearch": true
}, },
"engineBaseUrl": "https://www.google.com/search?q=", "engineBaseUrl": "https://www.google.com/search?q=",
"excludedSites": ["quora.com"] "excludedSites": [
"quora.com"
]
}, },
"time": { "time": {
// See https://docs.gtk.org/glib/method.DateTime.format.html // See https://docs.gtk.org/glib/method.DateTime.format.html
@@ -153,11 +180,17 @@
"dock": { "dock": {
"enabled": false, "enabled": false,
"hiddenThickness": 5, "hiddenThickness": 5,
"pinnedApps": ["firefox", "org.gnome.Nautilus"], "pinnedApps": [
"firefox",
"org.gnome.Nautilus"
],
"layer": "top", "layer": "top",
"monitorExclusivity": true, // Dock will move to other monitor along with focus if enabled "monitorExclusivity": true, // Dock will move to other monitor along with focus if enabled
"searchPinnedAppIcons": false, // Try to search for the correct icon if the app class isn't an icon name "searchPinnedAppIcons": false, // Try to search for the correct icon if the app class isn't an icon name
"trigger": ["client-added", "client-removed"], // client_added, client_move, workspace_active, client_active "trigger": [
"client-added",
"client-removed"
], // client_added, client_move, workspace_active, client_active
// Automatically hide dock after `interval` ms since trigger // Automatically hide dock after `interval` ms since trigger
"autoHide": [ "autoHide": [
{ {
@@ -176,7 +209,9 @@
// The file names are processed at startup, so if there // The file names are processed at startup, so if there
// are too many files in the search path it'll affect performance // are too many files in the search path it'll affect performance
// Example: ["/usr/share/icons/Tela-nord/scalable/apps"] // Example: ["/usr/share/icons/Tela-nord/scalable/apps"]
"searchPaths": [""], "searchPaths": [
""
],
"symbolicIconTheme": { "symbolicIconTheme": {
"dark": "Adwaita", "dark": "Adwaita",
"light": "Adwaita" "light": "Adwaita"
@@ -240,6 +275,8 @@
// Array of bar modes for each monitor. Hit Ctrl+Alt+Slash to cycle. // Array of bar modes for each monitor. Hit Ctrl+Alt+Slash to cycle.
// Modes: "normal", "focus" (workspace indicator only), "nothing" // Modes: "normal", "focus" (workspace indicator only), "nothing"
// Example for four monitors: ["normal", "focus", "normal", "nothing"] // Example for four monitors: ["normal", "focus", "normal", "nothing"]
"modes": ["normal"] "modes": [
"normal"
]
} }
} }
@@ -11,6 +11,8 @@ import { markdownTest } from '../../.miscutils/md2pango.js';
import { MarginRevealer } from '../../.widgethacks/advancedrevealers.js'; import { MarginRevealer } from '../../.widgethacks/advancedrevealers.js';
import { MaterialIcon } from '../../.commonwidgets/materialicon.js'; import { MaterialIcon } from '../../.commonwidgets/materialicon.js';
const AGS_CONFIG_FILE = `${App.configDir}/user_options.jsonc`;
export const chatGPTTabIcon = Icon({ export const chatGPTTabIcon = Icon({
hpack: 'center', hpack: 'center',
icon: `openai-symbolic`, icon: `openai-symbolic`,
@@ -29,6 +31,12 @@ const ProviderSwitcher = () => {
GPTService.providerID = id; GPTService.providerID = id;
providerList.revealChild = false; providerList.revealChild = false;
indicatorChevron.label = 'expand_more'; indicatorChevron.label = 'expand_more';
// Save provider to config
Utils.execAsync(['bash', '-c', `${App.configDir}/scripts/ags/agsconfigurator.py \
--key ai.defaultGPTProvider \
--value ${id} \
--file ${AGS_CONFIG_FILE}`
]).catch(print);
}, },
child: Box({ child: Box({
className: 'spacing-h-10 txt', className: 'spacing-h-10 txt',
+1 -1
View File
@@ -52,7 +52,7 @@ const PROVIDERS = Object.assign({
"key_file": "openrouter_key.txt", "key_file": "openrouter_key.txt",
"model": "meta-llama/llama-3-70b-instruct", "model": "meta-llama/llama-3-70b-instruct",
}, },
}, userOptions.sidebar.ai.extraGptModels) }, userOptions.ai.extraGptModels)
// Custom prompt // Custom prompt
const initMessages = const initMessages =