커맨드 활성화 기능: 클릭하면 다음 녹음에 적용
- CommandsPage: 명령어 카드 클릭 → 활성 명령어 설정 (앰버 하이라이트)
- 상단에 ACTIVE COMMAND 표시
- 같은 카드 다시 클릭하면 해제
- 활성화 시 defaultLLMAction='custom' + activeInstructionId 저장
- VoiceModeService: action='custom'일 때 활성 명령어 프롬프트로 LLM 처리
- {{text}}를 전사 텍스트로 치환
This commit is contained in:
parent
8bd9d11ecd
commit
fea923d302
2 changed files with 118 additions and 73 deletions
|
|
@ -468,9 +468,27 @@ class VoiceModeService extends EventEmitter {
|
|||
const llm = getLocalLLMService()
|
||||
const action = configGet('defaultLLMAction')
|
||||
|
||||
logger.info(`Processing with LLM (action: ${action})`)
|
||||
let processedText: string
|
||||
|
||||
const processedText = await llm.processText(transcribedText, action)
|
||||
if (action === 'custom') {
|
||||
// 활성 명령어의 프롬프트를 사용
|
||||
const activeId = configGet('activeInstructionId' as keyof import('@shared/types').AppConfig) as unknown as string
|
||||
let customPrompt = transcribedText
|
||||
|
||||
if (activeId) {
|
||||
const { getCustomInstructionService } = await import('./CustomInstructionService')
|
||||
const instruction = getCustomInstructionService().getById(activeId)
|
||||
if (instruction) {
|
||||
customPrompt = instruction.prompt.replace(/\{\{text\}\}/g, transcribedText)
|
||||
logger.info(`Using custom instruction: "${instruction.name}"`)
|
||||
}
|
||||
}
|
||||
|
||||
processedText = await llm.processText(customPrompt, 'custom')
|
||||
} else {
|
||||
logger.info(`Processing with LLM (action: ${action})`)
|
||||
processedText = await llm.processText(transcribedText, action)
|
||||
}
|
||||
|
||||
if (this._isInTerminalState()) return
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue