mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
feature: add logging when passthrough return Result
This commit is contained in:
parent
bf36953dcb
commit
52796fb060
1 changed files with 12 additions and 1 deletions
|
|
@ -1852,6 +1852,11 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
|
||||
logging_result = self.normalize_logging_result(result=result)
|
||||
|
||||
if isinstance(result, Response) and isinstance(
|
||||
logging_result, ModelResponse
|
||||
):
|
||||
result = logging_result
|
||||
|
||||
if (
|
||||
standard_logging_object is None
|
||||
and result is not None
|
||||
|
|
@ -5569,7 +5574,13 @@ def get_standard_logging_object_payload(
|
|||
|
||||
def emit_standard_logging_payload(payload: StandardLoggingPayload):
|
||||
if os.getenv("LITELLM_PRINT_STANDARD_LOGGING_PAYLOAD"):
|
||||
print(json.dumps(payload, indent=4)) # noqa
|
||||
try:
|
||||
print(json.dumps(payload, indent=4, default=str)) # noqa
|
||||
except Exception as e:
|
||||
print(
|
||||
"Error serializing standard logging payload for debug output:",
|
||||
str(e),
|
||||
)
|
||||
|
||||
|
||||
def get_standard_logging_metadata(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue