Skip to content

Commit e1881c1

Browse files
committed
fix(LLMAppService): handle InvalidArgumentException in model call failure logging
1 parent 844d05b commit e1881c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/magic-service/app/Application/ModelGateway/Service/LLMAppService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
use Hyperf\Odin\Tool\Definition\ToolDefinition;
5252
use Hyperf\Odin\Utils\MessageUtil;
5353
use Hyperf\Odin\Utils\ToolUtil;
54+
use InvalidArgumentException;
5455
use Throwable;
5556

5657
use function Hyperf\Coroutine\defer;
@@ -326,7 +327,7 @@ protected function processRequest(ProxyModelRequestInterface $proxyModelRequest,
326327
);
327328

328329
$message = '';
329-
if ($throwable instanceof LLMException) {
330+
if ($throwable instanceof LLMException || $throwable instanceof InvalidArgumentException) {
330331
$message = $throwable->getMessage();
331332
}
332333
$this->logModelCallFailure($proxyModelRequest->getModel(), $throwable);

0 commit comments

Comments
 (0)