diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 291d3548c8a..0200d1a0831 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -1672,6 +1672,9 @@ class Usage(SafeAttributeModel, CompletionUsage): prompt_tokens_details=_prompt_tokens_details or None, ) + if isinstance(server_tool_use, dict): + server_tool_use = ServerToolUse(**server_tool_use) + if server_tool_use is not None: self.server_tool_use = server_tool_use else: # maintain openai compatibility in usage object if possible