已覆盖只允许正确或错误,未覆盖可待确认,缺引用不再阻止正确结论。 复用统一事务写入与不可变审计重评旧待确认,保留原问答和人工结论。 验证:全仓 make verify、真实隔离 PostgreSQL 全包与 race 回归通过。
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
const DictionaryVersion = "qa-approved-labels-v1"
|
||||
const EvaluationPromptVersion = "qa-evaluate-evidence-v1"
|
||||
const EvaluationPromptVersion = "qa-evaluate-question-answer-v2"
|
||||
const TranslationPromptVersion = "qa-question-zh-v1"
|
||||
|
||||
var Taxonomy = qaopsfields.ClassificationTaxonomy
|
||||
@@ -63,6 +63,7 @@ type Assessment struct {
|
||||
}
|
||||
type AssessmentInput struct {
|
||||
Question string `json:"question"`
|
||||
Coverage string `json:"coverage"`
|
||||
Answer string `json:"answer"`
|
||||
References []Reference `json:"references"`
|
||||
NeededFields []string `json:"needed_fields"`
|
||||
@@ -92,6 +93,9 @@ func DecodeAssessment(raw string, input AssessmentInput) (Assessment, error) {
|
||||
if value.Basis != "semantic_only" && value.Basis != "reference_evidence" && value.Basis != "insufficient_evidence" {
|
||||
return out, ErrInvalid
|
||||
}
|
||||
if field == "is_correct" && value.Value == "待确认" && input.Coverage != "uncovered" {
|
||||
return out, ErrInvalid
|
||||
}
|
||||
if field == "root_cause" && correctness == "是" && value.Value != "" {
|
||||
return out, ErrInvalid
|
||||
}
|
||||
@@ -119,9 +123,6 @@ func DecodeAssessment(raw string, input AssessmentInput) (Assessment, error) {
|
||||
if value.Basis == "reference_evidence" && !referenceEvidence {
|
||||
return out, ErrInvalid
|
||||
}
|
||||
if field == "is_correct" && value.Value == "是" && value.Basis != "reference_evidence" {
|
||||
return out, ErrInvalid
|
||||
}
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user