mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-04 02:31:27 +00:00
fix: write overhead to dict-typed responses via key assignment
TypedDict responses (e.g. AnthropicMessagesResponse) are plain dicts at runtime, so hasattr(response, "_hidden_params") returns False. Also assign via response["_hidden_params"] for dict types.
This commit is contained in:
parent
321e98147f
commit
faf9133ea3
1 changed files with 2 additions and 0 deletions
|
|
@ -1448,6 +1448,8 @@ class ProxyBaseLLMRequestProcessing:
|
|||
_overhead_hidden_params["litellm_overhead_time_ms"] = overhead_ms
|
||||
if hasattr(response, "_hidden_params"):
|
||||
response._hidden_params = _overhead_hidden_params
|
||||
elif isinstance(response, dict):
|
||||
response["_hidden_params"] = _overhead_hidden_params
|
||||
|
||||
_exception_raised = False
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue