ki Backend fix - Answer Size
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-09-07 12:45:50 +02:00
parent 709ea88c2a
commit 835cccadec
7 changed files with 71 additions and 3 deletions
+8 -1
View File
@@ -37,7 +37,11 @@ class AnthropicProvider implements ProviderInterface
],
'messages' => [['role' => 'user', 'content' => $userContent]],
]),
CURLOPT_TIMEOUT => 90,
// Umfangreiche Einheitenplanungen können bei großen Antworten länger dauern. Der
// Desktop-Client wartet etwas länger (210 s), damit immer dieser Server mit einer
// verständlichen Fehlermeldung antworten kann, statt dass zuerst der Client abbricht.
CURLOPT_CONNECTTIMEOUT => 15,
CURLOPT_TIMEOUT => 180,
]);
$raw = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
@@ -68,6 +72,9 @@ class AnthropicProvider implements ProviderInterface
return [
'content' => $text,
// Insbesondere "max_tokens" darf nicht verloren gehen: Dann ist der Text zwar eine
// technisch erfolgreiche API-Antwort, das JSON aber zwangsläufig am Ende abgeschnitten.
'stopReason' => $data['stop_reason'] ?? null,
'inputTokens' => (int) ($data['usage']['input_tokens'] ?? 0),
'outputTokens' => (int) ($data['usage']['output_tokens'] ?? 0),
'cacheCreationInputTokens' => (int) ($data['usage']['cache_creation_input_tokens'] ?? 0),