feat(llm_score): 支持多维度独立评分 #27

Merged
solahqb merged 1 commits from feat/llm-score-multi-dimension into main 2026-08-25 06:31:33 +00:00
Owner

Summary

扩展 llm_score 规则,支持通过 dimensions 参数配置多个评分维度(如准确性、相关性、完整性),每个维度独立评分 0-10 分。

Changes

  • RuleResult 新增 details 字段存储结构化多维度分数
  • 向后兼容:原有 criteria 单维度模式继续有效
  • 多维度模式:各维度并行调用 LLM,返回平均分和明细
  • 新增 4 项单元测试(637 tests passed)

Configuration Example

rules:
  - type: llm_score
    params:
      dimensions:
        - name: accuracy
          criteria: "回答是否准确,有无事实错误"
          min_score: 7
        - name: relevance
          criteria: "回答是否与用户问题相关"
          min_score: 7
        - name: completeness
          criteria: "回答是否完整,有无遗漏关键信息"
          min_score: 7

Test plan

  • 单元测试通过(637 tests)
  • 向后兼容验证(单维度模式)
  • 多维度配置解析测试
  • 空对话处理测试
  • RuleResult details 字段测试

Closes #19

## Summary 扩展 `llm_score` 规则,支持通过 `dimensions` 参数配置多个评分维度(如准确性、相关性、完整性),每个维度独立评分 0-10 分。 ## Changes - **RuleResult** 新增 `details` 字段存储结构化多维度分数 - **向后兼容**:原有 `criteria` 单维度模式继续有效 - **多维度模式**:各维度并行调用 LLM,返回平均分和明细 - 新增 4 项单元测试(637 tests passed) ## Configuration Example ```yaml rules: - type: llm_score params: dimensions: - name: accuracy criteria: "回答是否准确,有无事实错误" min_score: 7 - name: relevance criteria: "回答是否与用户问题相关" min_score: 7 - name: completeness criteria: "回答是否完整,有无遗漏关键信息" min_score: 7 ``` ## Test plan - [x] 单元测试通过(637 tests) - [x] 向后兼容验证(单维度模式) - [x] 多维度配置解析测试 - [x] 空对话处理测试 - [x] RuleResult details 字段测试 Closes #19
solahqb added 1 commit 2026-08-25 06:19:12 +00:00
feat(llm_score): 支持多维度独立评分
All checks were successful
CI / test (pull_request) Successful in 4m9s
a29f78ff4b
扩展 llm_score 规则,支持通过 dimensions 参数配置多个评分维度,
每个维度独立评分 0-10 分。

- RuleResult 新增 details 字段存储结构化多维度分数
- 向后兼容:原有 criteria 单维度模式继续有效
- 多维度模式下各维度并行调用 LLM,返回平均分和明细
- 新增 4 项单元测试

Closes #19
solahqb merged commit a894ed7179 into main 2026-08-25 06:31:33 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: solahqb/AgentEvalTool#27
No description provided.