mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 00:47:15 +08:00
feat(boss): rubric 评分修复 — passThreshold 优先读 rubric 对象,注入 _scoring_note 到 prompt (#4)
- chat-page-processor: passThreshold 从 rubric.passThreshold 读取,不再硬编码 75 - llm-rubric: _scoring_note 存在时追加到 system prompt,确保两步评分法和例外规则对 LLM 可见 Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ee852733b1
commit
2456c5e818
@@ -705,7 +705,8 @@ export default async function startBossChatPageProcess (hooksFromCaller, options
|
|||||||
result = await evaluateResumeByRubric(resumeText, {
|
result = await evaluateResumeByRubric(resumeText, {
|
||||||
knockouts: llmConfig.rubric?.knockouts,
|
knockouts: llmConfig.rubric?.knockouts,
|
||||||
dimensions: llmConfig.rubric?.dimensions,
|
dimensions: llmConfig.rubric?.dimensions,
|
||||||
passThreshold: llmConfig.passThreshold ?? 75
|
passThreshold: llmConfig.rubric?.passThreshold ?? llmConfig.passThreshold ?? 75,
|
||||||
|
_scoring_note: llmConfig.rubric?._scoring_note
|
||||||
})
|
})
|
||||||
pass = result.isPassed
|
pass = result.isPassed
|
||||||
filterReason = result.reason || ''
|
filterReason = result.reason || ''
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export function getEnabledLlmClient (purpose = 'resume_screening', preferModelId
|
|||||||
/**
|
/**
|
||||||
* 根据 Rubric 评估简历。
|
* 根据 Rubric 评估简历。
|
||||||
* @param {string} resumeText - 简历全文
|
* @param {string} resumeText - 简历全文
|
||||||
* @param {{ knockouts?: string[], dimensions?: Array<{ name: string, weight: number, criteria: Record<string, string> }>, passThreshold?: number }} rubricConfig
|
* @param {{ knockouts?: string[], dimensions?: Array<{ name: string, weight: number, criteria: Record<string, string> }>, passThreshold?: number, _scoring_note?: string }} rubricConfig
|
||||||
* @param {{ modelId?: string | null }} [options]
|
* @param {{ modelId?: string | null }} [options]
|
||||||
* @returns {Promise<{ isPassed: boolean, totalScore: number, reason: string }>} 失败时默认通过
|
* @returns {Promise<{ isPassed: boolean, totalScore: number, reason: string }>} 失败时默认通过
|
||||||
*/
|
*/
|
||||||
@@ -100,6 +100,7 @@ export async function evaluateResumeByRubric (resumeText, rubricConfig, options
|
|||||||
const knockouts = Array.isArray(rubricConfig?.knockouts) ? rubricConfig.knockouts : []
|
const knockouts = Array.isArray(rubricConfig?.knockouts) ? rubricConfig.knockouts : []
|
||||||
const dimensions = Array.isArray(rubricConfig?.dimensions) ? rubricConfig.dimensions : []
|
const dimensions = Array.isArray(rubricConfig?.dimensions) ? rubricConfig.dimensions : []
|
||||||
const passThreshold = typeof rubricConfig?.passThreshold === 'number' ? rubricConfig.passThreshold : 75
|
const passThreshold = typeof rubricConfig?.passThreshold === 'number' ? rubricConfig.passThreshold : 75
|
||||||
|
const scoringNote = typeof rubricConfig?._scoring_note === 'string' ? rubricConfig._scoring_note : null
|
||||||
|
|
||||||
if (dimensions.length === 0) {
|
if (dimensions.length === 0) {
|
||||||
return { isPassed: true, totalScore: 100, reason: '无评分维度,默认通过' }
|
return { isPassed: true, totalScore: 100, reason: '无评分维度,默认通过' }
|
||||||
@@ -132,6 +133,10 @@ ${dimensionsDesc}
|
|||||||
"reasoning": "简要判断理由"
|
"reasoning": "简要判断理由"
|
||||||
}`
|
}`
|
||||||
|
|
||||||
|
if (scoringNote) {
|
||||||
|
systemContent += `\n\n【评分说明】\n${scoringNote}`
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logInfo(LOG, 'evaluateResumeByRubric start', {
|
logInfo(LOG, 'evaluateResumeByRubric start', {
|
||||||
model: client.model,
|
model: client.model,
|
||||||
|
|||||||
Reference in New Issue
Block a user