fix: req changes by greptile bot

This commit is contained in:
Harshit28j 2026-03-21 00:58:45 +05:30
parent 5abfddf47f
commit 28506f88d9
2 changed files with 2 additions and 2 deletions

View file

@ -109,7 +109,7 @@ def get_litellm_params(
# the request uses "litellm_metadata" (e.g. /v1/messages from Claude Code).
_merged_metadata = metadata
if litellm_metadata and isinstance(litellm_metadata, dict):
if _merged_metadata is None:
if not _merged_metadata:
_merged_metadata = dict(litellm_metadata)
else:
_merged_metadata = dict(_merged_metadata) # don't mutate caller's dict

View file

@ -293,7 +293,7 @@ class TestUpdateFromKwargs:
litellm_params={"metadata": {"from_caller": True}, "litellm_call_id": "x"},
)
assert logging_obj.litellm_params["metadata"]["from_caller"] is True
assert logging_obj.litellm_params["metadata"] == {"from_caller": True}
def test_custom_pricing_detected_via_litellm_metadata(self, logging_obj):
"""Custom pricing in litellm_metadata.model_info should set custom_pricing flag."""