update local models
This commit is contained in:
@@ -129,7 +129,6 @@ const SETTINGS_KEYS = {
|
||||
AUTO_SELECT_TEMPLATE: 'autoSelectTemplate',
|
||||
CONTEXT_OPTIMIZATION: 'contextOptimizationEnabled',
|
||||
EVENT_LOGS: 'isEventLogsEnabled',
|
||||
LOCAL_MODELS: 'isLocalModelsEnabled',
|
||||
PROMPT_ID: 'promptId',
|
||||
DEVELOPER_MODE: 'isDeveloperMode',
|
||||
} as const;
|
||||
@@ -159,7 +158,6 @@ const getInitialSettings = () => {
|
||||
autoSelectTemplate: getStoredBoolean(SETTINGS_KEYS.AUTO_SELECT_TEMPLATE, true),
|
||||
contextOptimization: getStoredBoolean(SETTINGS_KEYS.CONTEXT_OPTIMIZATION, true),
|
||||
eventLogs: getStoredBoolean(SETTINGS_KEYS.EVENT_LOGS, true),
|
||||
localModels: getStoredBoolean(SETTINGS_KEYS.LOCAL_MODELS, false),
|
||||
promptId: isBrowser ? localStorage.getItem(SETTINGS_KEYS.PROMPT_ID) || 'default' : 'default',
|
||||
developerMode: getStoredBoolean(SETTINGS_KEYS.DEVELOPER_MODE, false),
|
||||
};
|
||||
@@ -172,7 +170,6 @@ export const latestBranchStore = atom<boolean>(initialSettings.latestBranch);
|
||||
export const autoSelectStarterTemplate = atom<boolean>(initialSettings.autoSelectTemplate);
|
||||
export const enableContextOptimizationStore = atom<boolean>(initialSettings.contextOptimization);
|
||||
export const isEventLogsEnabled = atom<boolean>(initialSettings.eventLogs);
|
||||
export const isLocalModelsEnabled = atom<boolean>(initialSettings.localModels);
|
||||
export const promptStore = atom<string>(initialSettings.promptId);
|
||||
|
||||
// Helper functions to update settings with persistence
|
||||
@@ -196,11 +193,6 @@ export const updateEventLogs = (enabled: boolean) => {
|
||||
localStorage.setItem(SETTINGS_KEYS.EVENT_LOGS, JSON.stringify(enabled));
|
||||
};
|
||||
|
||||
export const updateLocalModels = (enabled: boolean) => {
|
||||
isLocalModelsEnabled.set(enabled);
|
||||
localStorage.setItem(SETTINGS_KEYS.LOCAL_MODELS, JSON.stringify(enabled));
|
||||
};
|
||||
|
||||
export const updatePromptId = (id: string) => {
|
||||
promptStore.set(id);
|
||||
localStorage.setItem(SETTINGS_KEYS.PROMPT_ID, id);
|
||||
|
||||
Reference in New Issue
Block a user