This commit is contained in:
wyn
2026-05-21 17:28:36 +08:00
parent f118a799c2
commit 44f3383887
3 changed files with 37 additions and 60 deletions

View File

@@ -61,7 +61,11 @@ class ReferenceCheck
}
try {
$contentA = trim((string)(isset($row['origin_text']) ? $row['origin_text'] : ''));
$mainInfo = Db::name('article_main')->where('am_id', $row['am_id'])->find();
$contentA = trim($mainInfo['content']);//trim((string)(isset($row['origin_text']) ? $row['origin_text'] : ''));
if ($contentA === '' && !empty($row['content_a'])) {
$contentA = trim((string)$row['content_a']);
}
$contentB = trim((string)(isset($row['refer_text']) ? $row['refer_text'] : ''));
if ($contentB === '' && intval($row['p_refer_id']) > 0) {
@@ -83,15 +87,10 @@ class ReferenceCheck
$llm = new LLMService();
$llmResult = $llm->checkReference($contentA, $contentB);
$isMatch = !empty($llmResult['is_match']);
$confidence = $llm->enforceReferenceCheckConfidence(
isset($llmResult['confidence']) ? $llmResult['confidence'] : 0,
$isMatch
);
Db::name('article_reference_check_result')->where('id', $checkId)->update([
'is_match' => $isMatch ? 1 : 0,
'confidence' => $confidence,
'confidence' => $llmResult['confidence'],
'reason' => $llmResult['reason'],
'status' => 1,
'error_msg' => '',
@@ -106,7 +105,7 @@ class ReferenceCheck
$job->delete();
$this->oQueueJob->log("任务执行成功 | 日志ID: {$sRedisKey}");
} catch (\Exception $e) {
var_dump($e->getMessage());
$this->oQueueJob->log('ReferenceCheck error: ' . $e->getMessage());
if ($job->attempts() >= 3) {
$this->markFailed($checkId, $e->getMessage());
$job->delete();