diff --git a/python/semantic_kernel/connectors/ai/mistral_ai/services/mistral_ai_chat_completion.py b/python/semantic_kernel/connectors/ai/mistral_ai/services/mistral_ai_chat_completion.py index ddfc718653ef..26e474d12e37 100644 --- a/python/semantic_kernel/connectors/ai/mistral_ai/services/mistral_ai_chat_completion.py +++ b/python/semantic_kernel/connectors/ai/mistral_ai/services/mistral_ai_chat_completion.py @@ -251,11 +251,9 @@ def _get_metadata_from_response(self, response: ChatCompletionResponse | Complet } # Check if usage exists and has a value, then add it to the metadata if hasattr(response, "usage") and response.usage is not None: - metadata["usage"] = ( - CompletionUsage( - prompt_tokens=response.usage.prompt_tokens, - completion_tokens=response.usage.completion_tokens, - ), + metadata["usage"] = CompletionUsage( + prompt_tokens=response.usage.prompt_tokens, + completion_tokens=response.usage.completion_tokens, ) return metadata