From cb9bf736c49bde54c273c93756608429d38f6f60 Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Fri, 21 Aug 2026 10:56:46 -0400 Subject: [PATCH] Fix: empty tool sometimes causes problems for some backends Signed-off-by: Lukas Schaefer --- lib/Service/OpenAiAPIService.php | 3 ++- psalm.xml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Service/OpenAiAPIService.php b/lib/Service/OpenAiAPIService.php index ac853808..f8ded2ad 100644 --- a/lib/Service/OpenAiAPIService.php +++ b/lib/Service/OpenAiAPIService.php @@ -842,7 +842,8 @@ private function buildChatCompletionRequestParams( $params['max_tokens'] = $maxTokens; } - if ($tools !== null) { + // IONOS does not like an empty tool array + if ($tools !== null && count($tools) > 0) { $params['tools'] = $tools; } if ($userId !== null && $this->isUsingOpenAi()) { diff --git a/psalm.xml b/psalm.xml index 0e06a050..c434ee52 100644 --- a/psalm.xml +++ b/psalm.xml @@ -8,6 +8,7 @@ errorLevel="4" findUnusedBaselineEntry="true" findUnusedCode="false" + findUnusedIssueHandlerSuppression="false" resolveFromConfigFile="true" ensureOverrideAttribute="false" phpVersion="8.3"