专刊 作者修回检测是否按照审稿人意见进行修改
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user