mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
feat: 尝试增加一下聊天里面的语音转文字功能
This commit is contained in:
@@ -17,7 +17,10 @@ export const CONFIG_KEYS = {
|
||||
ONBOARDING_DONE: 'onboardingDone',
|
||||
LLM_MODEL_PATH: 'llmModelPath',
|
||||
IMAGE_XOR_KEY: 'imageXorKey',
|
||||
IMAGE_AES_KEY: 'imageAesKey'
|
||||
IMAGE_AES_KEY: 'imageAesKey',
|
||||
WHISPER_MODEL_NAME: 'whisperModelName',
|
||||
WHISPER_MODEL_DIR: 'whisperModelDir',
|
||||
WHISPER_DOWNLOAD_SOURCE: 'whisperDownloadSource'
|
||||
} as const
|
||||
|
||||
// 获取解密密钥
|
||||
@@ -144,6 +147,39 @@ export async function setLlmModelPath(path: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.LLM_MODEL_PATH, path)
|
||||
}
|
||||
|
||||
// 获取 Whisper 模型名称
|
||||
export async function getWhisperModelName(): Promise<string | null> {
|
||||
const value = await config.get(CONFIG_KEYS.WHISPER_MODEL_NAME)
|
||||
return (value as string) || null
|
||||
}
|
||||
|
||||
// 设置 Whisper 模型名称
|
||||
export async function setWhisperModelName(name: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.WHISPER_MODEL_NAME, name)
|
||||
}
|
||||
|
||||
// 获取 Whisper 模型目录
|
||||
export async function getWhisperModelDir(): Promise<string | null> {
|
||||
const value = await config.get(CONFIG_KEYS.WHISPER_MODEL_DIR)
|
||||
return (value as string) || null
|
||||
}
|
||||
|
||||
// 设置 Whisper 模型目录
|
||||
export async function setWhisperModelDir(dir: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.WHISPER_MODEL_DIR, dir)
|
||||
}
|
||||
|
||||
// 获取 Whisper 下载源
|
||||
export async function getWhisperDownloadSource(): Promise<string | null> {
|
||||
const value = await config.get(CONFIG_KEYS.WHISPER_DOWNLOAD_SOURCE)
|
||||
return (value as string) || null
|
||||
}
|
||||
|
||||
// 设置 Whisper 下载源
|
||||
export async function setWhisperDownloadSource(source: string): Promise<void> {
|
||||
await config.set(CONFIG_KEYS.WHISPER_DOWNLOAD_SOURCE, source)
|
||||
}
|
||||
|
||||
// 清除所有配置
|
||||
export async function clearConfig(): Promise<void> {
|
||||
await config.clear()
|
||||
|
||||
Reference in New Issue
Block a user