Skip to content

fix: Use correct AzureOpenAIChatClient.as_agent() API#279

Open
ericchansen wants to merge 1 commit intoAzure-Samples:mainfrom
ericchansen:fix/azure-chat-client-as-agent
Open

fix: Use correct AzureOpenAIChatClient.as_agent() API#279
ericchansen wants to merge 1 commit intoAzure-Samples:mainfrom
ericchansen:fix/azure-chat-client-as-agent

Conversation

@ericchansen
Copy link

Purpose

The MCP notebook example used create_agent() which does not exist on AzureOpenAIChatClient, causing runtime failures:

AttributeError: 'AzureOpenAIChatClient' object has no attribute 'create_agent'

Replace create_agent() with as_agent() per the Microsoft Agent Framework API. The as_agent() method also requires a name parameter, which has been added.

The create_agent -> as_agent rename was a breaking change introduced in:

  • Python: v1.0.0b260116 (Jan 16, 2026) - PR #3249
  • .NET: v1.0.0-preview.260121.1 (Jan 21, 2026) - PR #3222

Ref: https://github.com/microsoft/agent-framework/releases

Does this introduce a breaking change?

[ ] Yes
[ x ] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ x ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

The MCP notebook example used create_agent() which does not exist on
AzureOpenAIChatClient, causing runtime failures:

    AttributeError: 'AzureOpenAIChatClient' object has no attribute 'create_agent'

Replace create_agent() with as_agent() per the Microsoft Agent Framework
API. The as_agent() method also requires a name parameter, which has
been added.

The create_agent -> as_agent rename was a breaking change introduced in:
- Python: v1.0.0b260116 (Jan 16, 2026) - PR #3249
- .NET: v1.0.0-preview.260121.1 (Jan 21, 2026) - PR #3222

Ref: https://github.com/microsoft/agent-framework/releases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant