mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-25 20:32:11 +03:00
6ff9309082
* feat(axios): add global manager * feat: add config page * feat(axios): add backendUrl overwrite * feat(brainConfig): add supabase url overwrite * feat(chat): change model config logic + add more model * feat: add openai and anthropic api key overwrite * feat(config): save config in local storage * feat(config): add reset button * feat: move vertexai to config page * ui: add brain config icon
18 lines
544 B
TypeScript
18 lines
544 B
TypeScript
import { BrainConfig } from "../types";
|
|
|
|
const BRAIN_CONFIG_LOCAL_STORAGE_KEY = "userBrainConfig";
|
|
|
|
export const saveBrainConfigInLocalStorage = (updatedConfig: BrainConfig) => {
|
|
localStorage.setItem(
|
|
BRAIN_CONFIG_LOCAL_STORAGE_KEY,
|
|
JSON.stringify(updatedConfig)
|
|
);
|
|
};
|
|
export const getBrainConfigFromLocalStorage = (): BrainConfig | undefined => {
|
|
const persistedBrainConfig = localStorage.getItem(
|
|
BRAIN_CONFIG_LOCAL_STORAGE_KEY
|
|
);
|
|
if (persistedBrainConfig === null) return;
|
|
return JSON.parse(persistedBrainConfig);
|
|
};
|