mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 15:13:55 +08:00
update:xunfei asr
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- 添加讯飞流式语音识别服务配置
|
||||
delete from `ai_model_provider` where id = 'SYSTEM_ASR_XunfeiStream';
|
||||
INSERT INTO `ai_model_provider` (`id`, `model_type`, `provider_code`, `name`, `fields`, `sort`, `creator`, `create_date`, `updater`, `update_date`) VALUES
|
||||
('SYSTEM_ASR_XunfeiStream', 'ASR', 'xunfei_stream', '讯飞流式语音识别', '[{"key":"app_id","label":"应用ID","type":"string"},{"key":"api_key","label":"API密钥","type":"password"},{"key":"api_secret","label":"API密钥","type":"password"},{"key":"domain","label":"识别领域","type":"string"},{"key":"language","label":"识别语言","type":"string"},{"key":"accent","label":"方言","type":"string"},{"key":"dwa","label":"动态修正","type":"string"},{"key":"output_dir","label":"输出目录","type":"string"}]', 18, 1, NOW(), 1, NOW());
|
||||
|
||||
delete from `ai_model_config` where id = 'ASR_XunfeiStream';
|
||||
INSERT INTO `ai_model_config` VALUES ('ASR_XunfeiStream', 'ASR', '讯飞流式语音识别', '讯飞流式语音识别服务', 0, 1, '{"type": "xunfei_stream", "app_id": "", "api_key": "", "api_secret": "", "domain": "slm", "language": "zh_cn", "accent": "mandarin", "dwa": "wpgs", "output_dir": "tmp/"}', 'https://www.xfyun.cn/doc/spark/spark_zh_iat.html', '支持实时流式语音识别,适用于中文普通话及多种方言识别', 21, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 更新讯飞流式语音识别模型配置的说明文档
|
||||
UPDATE `ai_model_config` SET
|
||||
`doc_link` = 'https://www.xfyun.cn/doc/spark/spark_zh_iat.html',
|
||||
`remark` = '讯飞流式语音识别配置说明:
|
||||
1. 登录讯飞开放平台 https://www.xfyun.cn/
|
||||
2. 创建语音识别应用获取APPID、APISecret、APIKey
|
||||
3. 参数说明:
|
||||
- app_id: 应用ID,在讯飞开放平台创建应用后获得
|
||||
- api_key: API密钥,用于接口鉴权
|
||||
- api_secret: API密钥,用于生成签名
|
||||
- domain: 识别领域,默认slm(智能化语音转写)
|
||||
- language: 识别语言,默认zh_cn(中文)
|
||||
- accent: 方言类型,默认mandarin(普通话),支持cantonese(粤语)等
|
||||
- dwa: 动态修正,默认wpgs(开启动态修正)
|
||||
- output_dir: 音频文件输出目录,默认tmp/
|
||||
4. 支持实时流式识别,适用于实时语音交互场景
|
||||
5. 支持多种方言和语言识别
|
||||
' WHERE `id` = 'ASR_XunfeiStream';
|
||||
@@ -0,0 +1,20 @@
|
||||
delete from `ai_model_config` where id = 'LLM_XunfeiSparkLLM';
|
||||
INSERT INTO `ai_model_config` VALUES ('LLM_XunfeiSparkLLM', 'LLM', '讯飞星火认知大模型', '讯飞星火认知大模型', 0, 1, '{"type": "openai", "model_name": "generalv3.5", "base_url": "https://spark-api-open.xf-yun.com/v1", "api_key": "你的api_key", "temperature": 0.5, "max_tokens": 2048, "top_p": 1.0, "frequency_penalty": 0.0}', 'https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html', '讯飞星火认知大模型,支持多轮对话、文本生成等功能', 14, NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 更新讯飞星火认知大模型配置的说明文档
|
||||
UPDATE `ai_model_config` SET
|
||||
`doc_link` = 'https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html',
|
||||
`remark` = '讯飞星火认知大模型配置说明:
|
||||
1. 登录讯飞开放平台 https://www.xfyun.cn/
|
||||
2. 创建星火认知大模型应用获取API Key
|
||||
3. 参数说明:
|
||||
- api_key: API密钥,在讯飞开放平台创建应用后获得
|
||||
- model_name: 模型名称,支持generalv3.5、generalv3等版本
|
||||
- base_url: API地址,默认https://spark-api-open.xf-yun.com/v1
|
||||
- temperature: 温度参数,控制生成随机性,范围0-1,默认0.5
|
||||
- max_tokens: 最大输出token数,默认2048
|
||||
- top_p: 核心采样参数,控制词汇多样性,默认1.0
|
||||
- frequency_penalty: 频率惩罚,降低重复内容,默认0.0
|
||||
4. 支持多轮对话、文本生成、知识问答等功能
|
||||
5. 兼容OpenAI接口格式,可直接使用现有的OpenAI Provider
|
||||
' WHERE `id` = 'LLM_XunfeiSparkLLM';
|
||||
@@ -366,3 +366,18 @@ databaseChangeLog:
|
||||
- sqlFile:
|
||||
encoding: utf8
|
||||
path: classpath:db/changelog/202509191545.sql
|
||||
- changeSet:
|
||||
id: 202509191732
|
||||
author: fyb
|
||||
changes:
|
||||
- sqlFile:
|
||||
encoding: utf8
|
||||
path: classpath:db/changelog/202509191732.sql
|
||||
|
||||
- changeSet:
|
||||
id: 202509191739
|
||||
author: fyb
|
||||
changes:
|
||||
- sqlFile:
|
||||
encoding: utf8
|
||||
path: classpath:db/changelog/202509191739.sql
|
||||
|
||||
Reference in New Issue
Block a user