support api profiles
This commit is contained in:
@@ -54,11 +54,20 @@ Produce only the {TARGET_LANG} translation, without any additional explanations
|
||||
|
||||
{TEXT}`;
|
||||
|
||||
export interface ApiProfile {
|
||||
id: string;
|
||||
name: string;
|
||||
apiBaseUrl: string;
|
||||
apiKey: string;
|
||||
modelName: string;
|
||||
}
|
||||
|
||||
export const useSettingsStore = defineStore('settings', () => {
|
||||
const isDark = useLocalStorage('is-dark', false);
|
||||
const apiBaseUrl = useLocalStorage('api-base-url', 'http://localhost:11434/v1');
|
||||
const apiKey = useLocalStorage('api-key', '');
|
||||
const modelName = useLocalStorage('model-name', 'translategemma:12b');
|
||||
const profiles = useLocalStorage<ApiProfile[]>('api-profiles', []);
|
||||
const enableStreaming = useLocalStorage('enable-streaming', true);
|
||||
const systemPromptTemplate = useLocalStorage('system-prompt-template', DEFAULT_TEMPLATE);
|
||||
|
||||
@@ -88,6 +97,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
apiBaseUrl,
|
||||
apiKey,
|
||||
modelName,
|
||||
profiles,
|
||||
enableStreaming,
|
||||
systemPromptTemplate,
|
||||
sourceLang,
|
||||
|
||||
Reference in New Issue
Block a user