diff --git a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py index db5fd911302..6f032a3393b 100644 --- a/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py +++ b/python/packages/autogen-ext/src/autogen_ext/models/openai/_openai_client.py @@ -558,8 +558,8 @@ async def create( logprobs=logprobs, ) - _add_usage(self._actual_usage, usage) - _add_usage(self._total_usage, usage) + self._total_usage = _add_usage(self._total_usage, usage) + self._actual_usage = _add_usage(self._actual_usage, usage) # TODO - why is this cast needed? return response @@ -775,8 +775,8 @@ async def create_stream( logprobs=logprobs, ) - _add_usage(self._actual_usage, usage) - _add_usage(self._total_usage, usage) + self._total_usage = _add_usage(self._total_usage, usage) + self._actual_usage = _add_usage(self._actual_usage, usage) yield result