Update request body method to return JSON

When you try to copy-paste the curl command from log directly into a shell, single quotes in `-d` param will make an `INVALID_ARGUMENT` 400 error
This commit is contained in:
rodriciru 2026-03-31 14:44:54 +02:00 committed by GitHub
parent 08be1e52ae
commit 4e7566c7a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1150,7 +1150,7 @@ class Logging(LiteLLMLoggingBaseClass):
verbose_logger.debug(f"\033[92m{curl_command}\033[0m\n")
def _get_request_body(self, data: dict) -> str:
return str(data)
return json.dumps(data)
def _get_request_curl_command(
self, api_base: str, headers: Optional[dict], additional_args: dict, data: dict