feat: 放大 AI 规格候选上限 (#284)

This commit is contained in:
chengma
2026-08-21 10:13:43 +08:00
parent 912ba96d12
commit f83f15c6e6
2 changed files with 58 additions and 2 deletions
+4 -2
View File
@@ -17,7 +17,9 @@ import (
const (
AISpecMatchPromptVersion = "spec_prompt_v1"
maxAIModelCandidates = 24
// 单次模型调用最多携带 100 个已过滤的可购买候选。超过这个数量时,
// 候选本身仍会写入审计记录,但不会让模型在过于宽泛的范围里猜测。
maxAIModelCandidates = 100
)
type AIMatchSnapshot struct {
@@ -149,7 +151,7 @@ func MatchSybSpecWithAI(ctx context.Context, db *sql.DB, actor *model.User, snap
}
if len(eligible) > maxAIModelCandidates {
baseDecision.CandidatesJSON = candidateAuditJSON(bindAICandidates(eligible))
return recordAIMatchWithoutSave(db, baseDecision, "rejected", "可购买候选过多,请先人工缩小范围")
return recordAIMatchWithoutSave(db, baseDecision, "rejected", "可购买候选超过 100 条,请先人工核对")
}
bindings := bindAICandidates(eligible)
baseDecision.CandidatesJSON = candidateAuditJSON(bindings)