Skip to content

Commit c74dbf0

Browse files
authored
fix:修复意图识别插件名称格式bug (#885)
* fix:修复使用本地配置时忘记附带提示词 * fix:修复意图识别插件名称格式bug
1 parent 1f836c3 commit c74dbf0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

main/manager-api/src/main/java/xiaozhi/modules/config/service/impl/ConfigServiceImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ private void buildModuleConfig(
267267
if (intentLLMModelId != null && intentLLMModelId.equals(llmModelId)) {
268268
intentLLMModelId = null;
269269
}
270+
} else if ("function_call".equals(map.get("type"))) {
271+
String functionStr = (String) map.get("functions");
272+
if (StringUtils.isNotBlank(functionStr)) {
273+
String[] functions = functionStr.split("\\;");
274+
map.put("functions", functions);
275+
}
270276
}
271277
}
272278
// 如果是LLM类型,且intentLLMModelId不为空,则添加附加模型
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
delete from `ai_model_config` where id = 'Intent_function_call';
2+
INSERT INTO `ai_model_config` VALUES ('Intent_function_call', 'Intent', 'function_call', '函数调用意图识别', 0, 1, '{\"type\": \"function_call\", \"functions\": \"change_role;get_weather;get_news;play_music\"}', NULL, NULL, 3, NULL, NULL, NULL, NULL);

main/manager-api/src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ databaseChangeLog:
5858
- sqlFile:
5959
encoding: utf8
6060
path: classpath:db/changelog/202504151206.sql
61+
- changeSet:
62+
id: 202504181534
63+
author: John
64+
changes:
65+
- sqlFile:
66+
encoding: utf8
67+
path: classpath:db/changelog/202504181534.sql

0 commit comments

Comments
 (0)