Correction bug lorsque body json dans requête GET

Cela fait planter l'autentification litellm
This commit is contained in:
Sylvain Philip 2025-04-01 21:26:09 +02:00
parent 9345b44d0d
commit 6bfa38d7ae

View File

@ -67,16 +67,19 @@ class AssistantController extends \Piko\Controller
$apiKey = getenv('PROXY_MASTER_KEY');
$headers = [
'Authorization' => 'Bearer ' . $apiKey,
'Content-Type' => 'application/json',
$requestParams = [
'headers' => [
'Authorization' => 'Bearer ' . $apiKey,
'Content-Type' => 'application/json',
]
];
if (!empty($params)) {
$requestParams['json'] = $params;
}
try {
$response = $client->request($method, $endPoint, [
'headers' => $headers,
'json' => $params
]);
$response = $client->request($method, $endPoint, $requestParams);
} catch (RequestException $e) {
$response = $e->getResponse();
$responseBody = (string) $response->getBody();