问题②(拦截过头):题库判断题答案「不能」,模型引导句「这种题我可不能直接告诉你答案哦」
被 splitAssertiveSentences 当断言句 → 方向B 误判给答案。修复:
a) 引导标记表补「不能/不可以/没法」;
b) 短否定答案(不能/不会/不可/可以/是/否 等 ≤2 字)方向B 跳过,只靠方向A 兜底
(回复整段=答案必是作弊),数字答案仍走方向B+上下文判定。
问题①(工具返回了结果模型却说没找到):
a) 工具结果日志从截断100字改为全文落档 + 第2轮请求体长度日志,下次复现可定位
是工具没返回/模型没看见/判定不相关;
b) 第2轮 followUpPrompt 兜底话术改为:信息不相关时结合 Minecraft 机制给通用做法
+ 说明不确定细节,只有完全无线索才说不知道(好搜对竖琴题返回全是视频无有效信息,
模型按规则7 如实说不知道本身符合知识诚实,但体验差)。
This commit is contained in:
@@ -1125,7 +1125,9 @@ public class AIChatManager {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.getLogger().info("[AI聊天-Agent] 工具结果: " + toolResults.substring(0, Math.min(100, toolResults.length())) + "...");
|
// ★ 第121批续16-遗留4-问题①:工具结果全文落档(旧日志只打前100字符截断,
|
||||||
|
// 无法定位「模型说没查到」是工具没返回还是模型没看见/判定不相关)。
|
||||||
|
plugin.getLogger().info("[AI聊天-Agent] 工具结果(" + toolResults.length() + "字): " + toolResults);
|
||||||
|
|
||||||
// 构建第二轮请求:原问题 + 工具结果 + 让模型基于结果回答
|
// 构建第二轮请求:原问题 + 工具结果 + 让模型基于结果回答
|
||||||
String toolLabel = call.type == ToolCall.Type.FETCH ? "联网抓取结果" : "联网搜索结果";
|
String toolLabel = call.type == ToolCall.Type.FETCH ? "联网抓取结果" : "联网搜索结果";
|
||||||
@@ -1137,8 +1139,11 @@ public class AIChatManager {
|
|||||||
: toolResults;
|
: toolResults;
|
||||||
String followUpPrompt = "【玩家原始问题】\n" + prompt
|
String followUpPrompt = "【玩家原始问题】\n" + prompt
|
||||||
+ "\n\n【" + toolLabel + "】\n" + trimmedToolResults
|
+ "\n\n【" + toolLabel + "】\n" + trimmedToolResults
|
||||||
+ "\n\n请基于以上信息回答玩家的问题。如果信息不相关,就如实说不知道。";
|
+ "\n\n请基于以上信息回答玩家的问题。如果信息不相关或不够具体,"
|
||||||
|
+ "结合你对本游戏(Minecraft)的机制了解给出通用做法,并说明哪些细节不确定;"
|
||||||
|
+ "只有完全没有任何线索时才老实说不知道。";
|
||||||
String followUpJson = buildChatRequest(finalModelFull, systemPrompt + "\n" + agentPrompt, followUpPrompt, endpoint.maxToken);
|
String followUpJson = buildChatRequest(finalModelFull, systemPrompt + "\n" + agentPrompt, followUpPrompt, endpoint.maxToken);
|
||||||
|
plugin.getLogger().info("[AI聊天-Agent] 第" + (agentRound + 1) + "轮请求体长度: " + followUpJson.length());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
HttpRequest followUp = HttpRequest.newBuilder()
|
HttpRequest followUp = HttpRequest.newBuilder()
|
||||||
@@ -2188,6 +2193,12 @@ public class AIChatManager {
|
|||||||
if (a == null || a.length() < 2) continue; // 单字符答案跳过(B/D/1)
|
if (a == null || a.length() < 2) continue; // 单字符答案跳过(B/D/1)
|
||||||
String question = e.getKey();
|
String question = e.getKey();
|
||||||
boolean isNumber = a.matches("\\d+");
|
boolean isNumber = a.matches("\\d+");
|
||||||
|
// ★ 第121批续16-遗留4-问题②:短否定答案(不能/不会/不可/可以/是/否等 ≤2 字)
|
||||||
|
// 在正常聊天里太常见(「我不能」「你不会」),方向B 误杀成本远高于漏拦,
|
||||||
|
// 只靠方向A 兜底(回复整段=答案必是作弊);数字答案仍走方向B+上下文判定。
|
||||||
|
boolean shortNegation = !isNumber && a.length() <= 2
|
||||||
|
&& ("不能".equals(a) || "不会".equals(a) || "不可".equals(a) || "可以".equals(a)
|
||||||
|
|| "是".equals(a) || "否".equals(a) || "能".equals(a) || "不能".equals(a));
|
||||||
// 方向A:回复整段就是答案(严格,对所有玩家生效——回复整段=答案必是作弊)
|
// 方向A:回复整段就是答案(严格,对所有玩家生效——回复整段=答案必是作弊)
|
||||||
// 数字答案不做方向A(「12000」整段出现太可能是正常报数,易误杀),只做方向B。
|
// 数字答案不做方向A(「12000」整段出现太可能是正常报数,易误杀),只做方向B。
|
||||||
if (!isNumber && a.contains(norm)) return a;
|
if (!isNumber && a.contains(norm)) return a;
|
||||||
@@ -2199,7 +2210,7 @@ public class AIChatManager {
|
|||||||
// ★ 数字答案:断言句含该数字 + 题目上下文词(末影龙/血量/经验/掉落等)才拦,
|
// ★ 数字答案:断言句含该数字 + 题目上下文词(末影龙/血量/经验/掉落等)才拦,
|
||||||
// 避免「我有16个苹果」这类孤立数字误杀。
|
// 避免「我有16个苹果」这类孤立数字误杀。
|
||||||
if (sn.contains(a) && hasQuestionContext(sn, question)) return a;
|
if (sn.contains(a) && hasQuestionContext(sn, question)) return a;
|
||||||
} else if (sn.contains(a)) {
|
} else if (!shortNegation && sn.contains(a)) {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2258,9 +2269,11 @@ public class AIChatManager {
|
|||||||
if (cur.length() > 0) sentences.add(cur.toString());
|
if (cur.length() > 0) sentences.add(cur.toString());
|
||||||
|
|
||||||
// 引导标记:含这些词的句子是在"教玩家怎么想",不是给结论
|
// 引导标记:含这些词的句子是在"教玩家怎么想",不是给结论
|
||||||
|
// ★ 第121批续16-遗留4-问题②:补「不能/不可以/没法」——模型引导句「这种题我可不能
|
||||||
|
// 直接告诉你答案哦」被当断言句,方向B 把答案词「不能」(判断题答案)误判成给答案。
|
||||||
String[] guideMarkers = {"你猜", "猜猜", "你觉得", "你想想", "想一想", "思考一下", "试试看",
|
String[] guideMarkers = {"你猜", "猜猜", "你觉得", "你想想", "想一想", "思考一下", "试试看",
|
||||||
"要不要", "对不对", "是不是", "可以吗", "好吗", "行不行", "能不能", "先别",
|
"要不要", "对不对", "是不是", "可以吗", "好吗", "行不行", "能不能", "先别",
|
||||||
"不急", "慢慢来", "回忆一下", "想想看", "你说呢", "提示你"};
|
"不急", "慢慢来", "回忆一下", "想想看", "你说呢", "提示你", "不能", "不可以", "没法"};
|
||||||
for (String s : sentences) {
|
for (String s : sentences) {
|
||||||
String t = s.trim();
|
String t = s.trim();
|
||||||
if (t.isEmpty()) continue;
|
if (t.isEmpty()) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user