Correction bug lorsque body json dans requête GET
Cela fait planter l'autentification litellm
This commit is contained in:
parent
9345b44d0d
commit
6bfa38d7ae
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user