mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix: preserve falsy ID values and remove redundant comments
- Fix ID extraction to preserve falsy values (0, empty string, False) from response_obj - Only fallback to litellm_call_id when id is None (attribute doesn't exist) - Remove redundant comments that duplicate function names and obvious logic - Clean up code for better readability
This commit is contained in:
parent
5969824089
commit
5401e6d97b
1 changed files with 4 additions and 1 deletions
|
|
@ -5102,7 +5102,10 @@ def get_standard_logging_object_payload(
|
|||
),
|
||||
)
|
||||
|
||||
id = _safe_get_attribute(response_obj, "id", None) or kwargs.get("litellm_call_id")
|
||||
# Preserve falsy values (0, "", False) if they exist in response_obj
|
||||
id = _safe_get_attribute(response_obj, "id", None)
|
||||
if id is None:
|
||||
id = kwargs.get("litellm_call_id")
|
||||
|
||||
_model_id = metadata.get("model_info", {}).get("id", "")
|
||||
_model_group = metadata.get("model_group", "")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue