Skip to content

Commit c6e59e9

Browse files
committed
chore(code): local changes before merge
1 parent 142dbfa commit c6e59e9

3 files changed

Lines changed: 21 additions & 17 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/prompts/intent_classify_system.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ Examples:
2929
- "帮我实现这个功能" → GeneralPurpose
3030
- "帮我找一下用户模型的代码在哪里" → Explore
3131
- "帮我检查一下这个 bug" → Verification
32+
- "这个函数报错了,帮我看看" → Verification
33+
- "用户模块的代码在哪个文件" → Explore
34+
- "帮我实现一个缓存机制" → GeneralPurpose
35+
- "帮我完成这个剩下的部分" → GeneralPurpose
36+
- "帮我写一个测试用例" → GeneralPurpose
37+
- "帮我写一个 API 接口" → GeneralPurpose
38+
- "帮我做一个用户登录功能" → GeneralPurpose
39+
- "这个配置在哪" → Explore
40+
- "数据库连接字符串在哪里" → Explore
41+
- "这个变量怎么找" → Explore
42+
- "为什么这个接口报 500 错误" → Verification
43+
- "帮我修一下这个 bug" → Verification
44+
- "帮我解决登录失败的问题" → Verification

core/src/prompts.rs

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ impl AgentStyle {
308308
/// consider using [`detect_with_llm`](AgentStyle::detect_with_llm) for
309309
/// more accurate classification.
310310
pub fn detect_with_confidence(message: &str) -> (Self, DetectionConfidence) {
311+
// Chinese text has high ambiguity in intent classification due to
312+
// compound verb structures and context-dependent meaning.
313+
// Bypass keyword matching entirely and route to LLM classification.
314+
if message.chars().any(|c| c >= '\u{4e00}' && c <= '\u{9fff}') {
315+
return (AgentStyle::GeneralPurpose, DetectionConfidence::Low);
316+
}
317+
311318
let lower = message.to_lowercase();
312319

313320
// === HIGH CONFIDENCE: Very specific patterns ===
@@ -327,10 +334,6 @@ impl AgentStyle {
327334
|| lower.contains("create a plan")
328335
|| lower.contains("implementation plan")
329336
|| lower.contains("step-by-step plan")
330-
|| lower.contains("帮我规划")
331-
|| lower.contains("帮我设计")
332-
|| lower.contains("架构设计")
333-
|| lower.contains("系统设计")
334337
{
335338
return (AgentStyle::Plan, DetectionConfidence::High);
336339
}
@@ -361,10 +364,6 @@ impl AgentStyle {
361364
|| lower.contains("design")
362365
|| lower.contains("architecture")
363366
|| lower.contains("approach")
364-
|| lower.contains("规划")
365-
|| lower.contains("设计")
366-
|| lower.contains("架构")
367-
|| lower.contains("方案")
368367
{
369368
return (AgentStyle::Plan, DetectionConfidence::Medium);
370369
}
@@ -910,14 +909,6 @@ mod tests {
910909
AgentStyle::detect_from_message("What's the implementation approach?"),
911910
AgentStyle::Plan
912911
);
913-
assert_eq!(
914-
AgentStyle::detect_from_message("帮我设计一个Agent as a Service 平台"),
915-
AgentStyle::Plan
916-
);
917-
assert_eq!(
918-
AgentStyle::detect_from_message("请给我一个系统设计方案"),
919-
AgentStyle::Plan
920-
);
921912
}
922913

923914
#[test]

0 commit comments

Comments
 (0)