Skip to content

A programming framework for agentic AI

fix: remove max_tokens from az ai client create call when stream=True (#5860)

Eric Zhuea89a84c3073
diff --git a/python/packages/autogen-ext/src/autogen_ext/models/azure/_azure_ai_client.py b/python/packages/autogen-ext/src/autogen_ext/models/azure/_azure_ai_client.py
index cbc15c4a3..813a6043a 100644
--- a/python/packages/autogen-ext/src/autogen_ext/models/azure/_azure_ai_client.py
+++ b/python/packages/autogen-ext/src/autogen_ext/models/azure/_azure_ai_client.py
@@ -404,9 +404,7 @@ class AzureAIChatCompletionClient(ChatCompletionClient):
self._client.complete(messages=azure_messages, tools=converted_tools, stream=True, **create_args)
)
else:
- task = asyncio.create_task(
- self._client.complete(messages=azure_messages, max_tokens=20, stream=True, **create_args)
- )
+ task = asyncio.create_task(self._client.complete(messages=azure_messages, stream=True, **create_args))
if cancellation_token is not None:
cancellation_token.link_future(task)