feat: 설정에 LLM 모델 선택 드롭다운 추가
Ollama에서 사용 가능한 모델 목록을 자동 로드하고 설정 > LLM 탭에서 선택할 수 있게 추가. 기존 404 에러(qwen3:4b 미설치) 해결.
This commit is contained in:
parent
55774b64e0
commit
8c10ba1844
3 changed files with 33 additions and 0 deletions
|
|
@ -203,6 +203,9 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac
|
|||
const [hotkeyModalOpen, setHotkeyModalOpen] = useState(false)
|
||||
const [hotkeyModalTarget, setHotkeyModalTarget] = useState<'dictation' | 'handsFree' | 'caption'>('dictation')
|
||||
|
||||
// LLM 모델 목록
|
||||
const [llmModels, setLlmModels] = useState<Array<{ id: string; name: string; parameterSize: string }>>([])
|
||||
|
||||
// 오디오 디바이스
|
||||
const [audioDevices, setAudioDevices] = useState<AudioDevice[]>([])
|
||||
const [selectedDeviceId, setSelectedDeviceId] = useState<string>('default')
|
||||
|
|
@ -240,6 +243,11 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac
|
|||
if (devicesResult.success) setAudioDevices(devicesResult.data)
|
||||
if (selectedResult.success && selectedResult.data) setSelectedDeviceId(selectedResult.data)
|
||||
})
|
||||
|
||||
// LLM 모델 목록 로드
|
||||
window.electronAPI.llm.getModels().then((resp) => {
|
||||
if (resp.success) setLlmModels(resp.data)
|
||||
})
|
||||
}, [open])
|
||||
|
||||
const updateConfig = useCallback((key: keyof AppConfig, value: AppConfig[keyof AppConfig]) => {
|
||||
|
|
@ -657,6 +665,29 @@ export function SettingsModal({ open, onClose }: SettingsModalProps): React.Reac
|
|||
|
||||
<Divider sx={{ borderColor: d3roPalette.border.subtle }} />
|
||||
|
||||
<Typography variant="overline" sx={{ color: d3roPalette.text.label, letterSpacing: '1.5px' }}>
|
||||
{t('settings.llmModel')}
|
||||
</Typography>
|
||||
|
||||
<FormControl size="small">
|
||||
<InputLabel>{t('settings.llmModel')}</InputLabel>
|
||||
<Select
|
||||
label={t('settings.llmModel')}
|
||||
value={(config as Record<string, unknown>)['llmModelId'] as string ?? ''}
|
||||
onChange={(e) => {
|
||||
updateConfig('llmModelId' as keyof AppConfig, e.target.value as never)
|
||||
}}
|
||||
>
|
||||
{llmModels.map((model) => (
|
||||
<MenuItem key={model.id} value={model.id}>
|
||||
{model.name} ({model.parameterSize})
|
||||
</MenuItem>
|
||||
))}
|
||||
</Select>
|
||||
</FormControl>
|
||||
|
||||
<Divider sx={{ borderColor: d3roPalette.border.subtle }} />
|
||||
|
||||
<Typography variant="overline" sx={{ color: d3roPalette.text.label, letterSpacing: '1.5px' }}>
|
||||
{t('settings.postProcess')}
|
||||
</Typography>
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@
|
|||
"settings.ollamaServer": "Ollama Server",
|
||||
"settings.ollamaUrl": "Ollama Server URL",
|
||||
"settings.ollamaHint": "Connects automatically when Ollama is running. Pull models directly in Ollama (e.g. ollama pull qwen3:4b).",
|
||||
"settings.llmModel": "LLM Model",
|
||||
"settings.postProcess": "Voice Post-Processing",
|
||||
"settings.defaultAction": "Default Post-Processing Command",
|
||||
"settings.action.none": "None (raw transcription)",
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@
|
|||
"settings.ollamaServer": "Ollama 서버",
|
||||
"settings.ollamaUrl": "Ollama 서버 URL",
|
||||
"settings.ollamaHint": "Ollama가 실행 중이면 자동으로 연결됩니다. 모델은 Ollama에서 직접 pull하세요 (예: ollama pull qwen3:4b).",
|
||||
"settings.llmModel": "LLM 모델",
|
||||
"settings.postProcess": "음성 후처리",
|
||||
"settings.defaultAction": "기본 후처리 명령어",
|
||||
"settings.action.none": "없음 (원본 텍스트 그대로)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue