fix(agent): immediately transfer accidents involving three or more vehicles

This commit is contained in:
Eric Wang
2026-10-28 13:36:31 +08:00
parent 20c5e39e9d
commit 3317d652db
8 changed files with 161 additions and 16 deletions
+6
View File
@@ -11,6 +11,12 @@ The original case comments retain their historical workflow versions.
Add YAML files anywhere under `evals/cases/`:
- `complex_vehicle/`: three-car collisions must immediately return `0003`
with the approved handoff wording in both client modes. Assert the first
explicit three-car turn transfers, extracts count/cause, leaves unknown
injury/time/scene fields absent, and asks no further collection or photo questions.
Semantic probes additionally cover four cars, a known count in an otherwise
empty form, new corrections, uncertain counts, unrelated vehicles, and lower bounds.
- `customer_feedback/`: replay repeated connection checks and the customer's
complete single-car collision description in both client modes. A clearly
described motor vehicle hitting a fixed object, without other vehicle
@@ -0,0 +1,20 @@
name: browser_addon_complex_three_immediate
clientMode: browser_addon
# 用户提供的三车事故反馈:在首次明确三车时立即转人工。
steps:
- input: 新对话
expect: {stageCode: "browser_addon.1001"}
- input: 【继续办理】
expect: {stageCode: "browser_addon.1002"}
- input: 你好你好喂喂喂。
expect:
stageCode: "browser_addon.1002"
formAbsent: [vehicle_count, has_injury]
- input: 在高速上,三辆车子追尾了。
expect:
stageCode: "browser_addon.0003"
form: {vehicle_count: 3, accident_cause: 追尾}
formAbsent: [has_injury, has_non_motor_vehicle_hit, accident_time, is_on_scene]
replyMatches: "收到,您描述的是三辆机动车追尾,属于需要人工处理的复杂事故,我将立即为您转接人工警员。请保持通话。"
replyNotMatches: "(请问|拍照|这个时间对吗|能否)"
@@ -0,0 +1,20 @@
name: direct_complex_three_immediate
clientMode: direct
# 用户提供的三车事故反馈:在首次明确三车时立即转人工。
steps:
- input: 新对话
expect: {stageCode: "1001"}
- input: 【继续办理】
expect: {stageCode: "1002"}
- input: 你好你好喂喂喂。
expect:
stageCode: "1002"
formAbsent: [vehicle_count, has_injury]
- input: 在高速上,三辆车子追尾了。
expect:
stageCode: "0003"
form: {vehicle_count: 3, accident_cause: 追尾}
formAbsent: [has_injury, has_non_motor_vehicle_hit, accident_time, is_on_scene]
replyMatches: "收到,您描述的是三辆机动车追尾,属于需要人工处理的复杂事故,我将立即为您转接人工警员。请保持通话。"
replyNotMatches: "(请问|拍照|这个时间对吗|能否)"
+21
View File
@@ -27,6 +27,27 @@ def probes():
known_form = dict(accident_cause='其他:车辆碰撞', has_injury=False,
has_non_motor_vehicle_hit=False, accident_time=TIME, is_on_scene=True)
return [
dict(name='complex_three_original', user='在高速上,三辆车子追尾了。', history=[],
code='0003', count=3, not_matches='(请问|是否.*[??]|拍照|这个时间对吗)',
matches='三辆机动车追尾.*复杂事故.*立即.*转接人工警员'),
dict(name='complex_four_missing_everything', user='四辆汽车发生连环碰撞。', history=[],
code='0003', count=4, not_matches='(请问|拍照|这个时间对吗)'),
dict(name='complex_form_only_three', user='我不在现场,没法拍照。', history=[],
form={'vehicle_count': 3}, code='0003', count=3,
not_matches='(请问|能否|拍照|这个时间对吗)'),
dict(name='complex_new_count_overrides_form', user='不是两辆,是三辆汽车追尾。', history=[],
form={'vehicle_count': 2}, code='0003', count=3, not_matches='(请问|拍照)'),
dict(name='complex_correction_back_to_two', user='刚才说错了,不是三辆,是两辆汽车追尾。',
history=[], form={'vehicle_count': 3}, code='1002', count=2, contains='受伤'),
dict(name='complex_at_least_three', user='至少三辆机动车发生碰撞,总共多少还不清楚。', history=[],
code='0003', count_absent=True, not_matches='(请问|拍照|这个时间对吗)'),
dict(name='complex_uncertain_three', user='可能是三辆汽车追尾,我没看清。', history=[],
code='1002', count_absent=True),
dict(name='complex_irrelevant_three', user='我倒车撞到护栏,旁边停着三辆车,和事故无关。', history=[],
code='1002', count=1, contains='受伤'),
dict(name='complex_time_pending', user='还有第三辆汽车参与追尾,是三辆。',
history=[{'role':'assistant','content':CONFIRM}], code='0003', count=3,
not_matches='(这个时间对吗|请问|拍照)'),
dict(name='feedback_single_motor_fixed_object', user='我现在还在事故现场。', history=[
{'role':'user','content':'我的车子是自己的小轿车,撞到了路边围栏。'},
{'role':'user','content':'没有人员伤伤就车子撞了。'},