diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index e2875d01..b217e4c1 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -6640,6 +6640,10 @@ class Article extends Base return jsonError($e->getMessage()); } } + public function checkOne(){ + $svc = new ReferenceCheckService(); + $svc->checkOne(); + } public function referenceCheckEnqueueArticleMain(){ $amId = 127448; $svc = new ReferenceCheckService(); diff --git a/application/api/job/ReferenceCheck.php b/application/api/job/ReferenceCheck.php index 5058bdc1..0c15c4f5 100644 --- a/application/api/job/ReferenceCheck.php +++ b/application/api/job/ReferenceCheck.php @@ -82,10 +82,15 @@ 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' => !empty($llmResult['is_match']) ? 1 : 0, - 'confidence' => $llmResult['confidence'], + 'is_match' => $isMatch ? 1 : 0, + 'confidence' => $confidence, 'reason' => $llmResult['reason'], 'status' => 1, 'error_msg' => '', diff --git a/application/common/ReferenceCheckService.php b/application/common/ReferenceCheckService.php index d56c0af0..f1903ca4 100644 --- a/application/common/ReferenceCheckService.php +++ b/application/common/ReferenceCheckService.php @@ -131,6 +131,9 @@ class ReferenceCheckService $this->setAmRefCheckStatus($amId, self::AM_STATUS_RUNNING); } + public function checkOne(){ + $this->pushJob(intval(722), 0); + } public function enqueueByArticle($articleId){ if ($articleId <= 0) { throw new \InvalidArgumentException('article_id is required');