专刊 作者修回检测是否按照审稿人意见进行修改

This commit is contained in:
wyn
2026-08-03 11:01:33 +08:00
parent 48fdb3bf72
commit be1c0f359a
6 changed files with 200 additions and 23 deletions

View File

@@ -27,4 +27,10 @@ class RabbitMqConfig
$cfg = self::get('ai_writing_risk', []);
return is_array($cfg) ? $cfg : [];
}
public static function revisionComment()
{
$cfg = self::get('revision_comment', []);
return is_array($cfg) ? $cfg : [];
}
}

View File

@@ -119,9 +119,10 @@ class LLMService
*
* @param array $messages OpenAI messages
* @param float $temperature
* @param int|null $timeoutSec 可选覆盖超时秒数
* @return string|null 助手回复正文
*/
public function requestChat(array $messages, $temperature = 0)
public function requestChat(array $messages, $temperature = 0, $timeoutSec = null)
{
if ($this->url === '' || $this->model === '') {
\think\Log::warning('LLM requestChat: url or model not configured');
@@ -132,7 +133,15 @@ class LLMService
'temperature' => $temperature,
'messages' => $messages,
];
return $this->postChat($payload);
$oldTimeout = $this->timeout;
if ($timeoutSec !== null && intval($timeoutSec) > 0) {
$this->timeout = max(30, intval($timeoutSec));
}
try {
return $this->postChat($payload);
} finally {
$this->timeout = $oldTimeout;
}
}
/**