Refactor various services and models for improved type handling and configuration management
This commit is contained in:
@@ -67,7 +67,7 @@ class LmStudioClient implements LlmClientInterface
|
||||
->throw()
|
||||
->json();
|
||||
} catch (RequestException $e) {
|
||||
$body = (string) ($e->response?->body() ?? '');
|
||||
$body = (string) $e->response->body();
|
||||
$isResponseFormatError = str_contains($body, 'response_format.type')
|
||||
|| str_contains($body, 'json_schema');
|
||||
|
||||
@@ -131,7 +131,7 @@ class LmStudioClient implements LlmClientInterface
|
||||
private function mapException(Throwable $e, string $operation): OllamaUnavailableException
|
||||
{
|
||||
if ($e instanceof RequestException) {
|
||||
$body = $e->response?->body();
|
||||
$body = $e->response->body();
|
||||
$snippet = $body ? mb_substr($body, 0, 280) : null;
|
||||
|
||||
return new OllamaUnavailableException('lmstudio', $operation, $e->getMessage(), $e, $snippet);
|
||||
|
||||
Reference in New Issue
Block a user