Symptom
LISA's AI log analyzer fails when attempting to use Azure OpenAI chat clients due to an invalid API parameter being passed to the Azure OpenAI service.
Root Cause
The agent-framework library incorrectly translates the max_tokens parameter to max_output_tokens when calling the Azure OpenAI Chat Completions API. The parameter max_output_tokens is not supported by Azure OpenAI's AsyncCompletions.create() method, which expects either max_tokens or max_completion_tokens.
This is a known bug in the agent-framework library:
Error Message
[INFO] ala [Magentic] Attempt 1 failed: <class 'agent_framework.azure._chat_client.AzureOpenAIChatClient'> service failed to complete the prompt: AsyncCompletions.create() got an unexpected keyword argument 'max_output_tokens'
Affected Versions
- agent-framework-core:
1.0.0b251223
- agent-framework-azure-ai:
1.0.0b251223
- openai:
2.8.1
Workaround
Instead of passing max_tokens directly to ChatAgent, the issue comment suggests using:
additional_properties={"max_completion_tokens": 8000}
to bypass the buggy translation in the framework and uses the correct Azure OpenAI API parameter.
Once agent-framework releases a fix, update to the fixed version and remove the workaround.
Symptom
LISA's AI log analyzer fails when attempting to use Azure OpenAI chat clients due to an invalid API parameter being passed to the Azure OpenAI service.
Root Cause
The
agent-frameworklibrary incorrectly translates themax_tokensparameter tomax_output_tokenswhen calling the Azure OpenAI Chat Completions API. The parametermax_output_tokensis not supported by Azure OpenAI'sAsyncCompletions.create()method, which expects eithermax_tokensormax_completion_tokens.This is a known bug in the agent-framework library:
Error Message
Affected Versions
1.0.0b2512231.0.0b2512232.8.1Workaround
Instead of passing
max_tokensdirectly toChatAgent, the issue comment suggests using:to bypass the buggy translation in the framework and uses the correct Azure OpenAI API parameter.
Once agent-framework releases a fix, update to the fixed version and remove the workaround.