mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
feat: 尝试增加一下聊天里面的语音转文字功能
This commit is contained in:
@@ -15,6 +15,7 @@ import { groupAnalyticsService } from './services/groupAnalyticsService'
|
||||
import { annualReportService } from './services/annualReportService'
|
||||
import { exportService, ExportOptions } from './services/exportService'
|
||||
import { KeyService } from './services/keyService'
|
||||
import { voiceTranscribeService } from './services/voiceTranscribeService'
|
||||
|
||||
|
||||
// 配置自动更新
|
||||
@@ -442,6 +443,10 @@ function registerIpcHandlers() {
|
||||
return chatService.getVoiceData(sessionId, msgId)
|
||||
})
|
||||
|
||||
ipcMain.handle('chat:getVoiceTranscript', async (_, sessionId: string, msgId: string) => {
|
||||
return chatService.getVoiceTranscript(sessionId, msgId)
|
||||
})
|
||||
|
||||
ipcMain.handle('chat:getMessageById', async (_, sessionId: string, localId: number) => {
|
||||
return chatService.getMessageById(sessionId, localId)
|
||||
})
|
||||
@@ -516,6 +521,16 @@ function registerIpcHandlers() {
|
||||
return { success: true }
|
||||
})
|
||||
|
||||
ipcMain.handle('whisper:downloadModel', async (event, payload: { modelName: string; downloadDir?: string; source?: string }) => {
|
||||
return voiceTranscribeService.downloadModel(payload, (progress) => {
|
||||
event.sender.send('whisper:downloadProgress', progress)
|
||||
})
|
||||
})
|
||||
|
||||
ipcMain.handle('whisper:getModelStatus', async (_, payload: { modelName: string; downloadDir?: string }) => {
|
||||
return voiceTranscribeService.getModelStatus(payload)
|
||||
})
|
||||
|
||||
// 群聊分析相关
|
||||
ipcMain.handle('groupAnalytics:getGroupChats', async () => {
|
||||
return groupAnalyticsService.getGroupChats()
|
||||
|
||||
Reference in New Issue
Block a user