customize model based on step
This commit is contained in:
@@ -42,20 +42,40 @@ export function setScanLastRan(ts: number): void {
|
||||
interface AiConfig {
|
||||
endpoint: string
|
||||
model: string
|
||||
modelTagging: string
|
||||
modelDescribe: string
|
||||
modelExtract: string
|
||||
modelTranslate: string
|
||||
enabled: boolean
|
||||
}
|
||||
|
||||
export function getAiConfig(): AiConfig {
|
||||
const endpoint = getSetting('ai_endpoint') ?? ''
|
||||
const model = getSetting('ai_model') ?? ''
|
||||
const modelTagging = getSetting('ai_model_tagging') ?? ''
|
||||
const modelDescribe = getSetting('ai_model_describe') ?? ''
|
||||
const modelExtract = getSetting('ai_model_extract') ?? ''
|
||||
const modelTranslate = getSetting('ai_model_translate') ?? ''
|
||||
const enabled = getSetting('ai_enabled') === 'true'
|
||||
return { endpoint, model, enabled }
|
||||
return { endpoint, model, modelTagging, modelDescribe, modelExtract, modelTranslate, enabled }
|
||||
}
|
||||
|
||||
export function updateAiConfig(endpoint: string, model: string, enabled: boolean): void {
|
||||
export function updateAiConfig(
|
||||
endpoint: string,
|
||||
model: string,
|
||||
enabled: boolean,
|
||||
modelTagging?: string,
|
||||
modelDescribe?: string,
|
||||
modelExtract?: string,
|
||||
modelTranslate?: string,
|
||||
): void {
|
||||
setSetting('ai_endpoint', endpoint)
|
||||
setSetting('ai_model', model)
|
||||
setSetting('ai_enabled', enabled ? 'true' : 'false')
|
||||
if (modelTagging !== undefined) setSetting('ai_model_tagging', modelTagging)
|
||||
if (modelDescribe !== undefined) setSetting('ai_model_describe', modelDescribe)
|
||||
if (modelExtract !== undefined) setSetting('ai_model_extract', modelExtract)
|
||||
if (modelTranslate !== undefined) setSetting('ai_model_translate', modelTranslate)
|
||||
}
|
||||
|
||||
export function getPreferredLanguage(): string {
|
||||
|
||||
Reference in New Issue
Block a user