Skip to content

Python: [Bug]: Documentation seems to be ahead of the latest SDK version #4510

@annalopata

Description

@annalopata

Description

I'm trying to use AzureAIAgentClient along with the create_agent method (like it was specified in the documentation :
https://learn.microsoft.com/en-us/python/api/agent-framework-core/agent_framework.azure.azureaiagentclient?view=agent-framework-python-latest)

and it appears that such method is not existent. Note that I'm using latest release - agent-framework 1.0.0rc3.

Code Sample

from agent_framework_azure_ai import AzureAIAgentClient
from azure.identity.aio import DefaultAzureCredential

credential = DefaultAzureCredential()

async with AzureAIAgentClient(
    project_endpoint=os.getenv("AZURE_AI_PROJECT_ENDPOINT"),
    model_deployment_name=os.getenv("AZURE_AI_MODEL_DEPLOYMENT_NAME", "gpt-4o"),
    credential=credential,
) as client:

    agent = client.create_agent(
        name="financial-analyst",
        instructions="You are a helpful financial analyst assistant.",
        temperature=0.7,
        max_tokens=500,
    )

    response = await agent.run("What is the current P/E ratio of AAPL?")

    print("Response:", response.text[:300])
    if hasattr(response, "usage_details") and response.usage_details:
        print("Usage:", response.usage_details)

Error Messages / Stack Traces

AttributeError                            Traceback (most recent call last)
Cell In[16], line 14
      2 credential = DefaultAzureCredential()
      4 async with AzureAIAgentClient(
      5     project_endpoint=os.getenv("AZURE_AI_PROJECT_ENDPOINT"),
      6     model_deployment_name=os.getenv("AZURE_AI_MODEL_DEPLOYMENT_NAME", "gpt-4o"),
   (...)     10     # create_agent() is a convenience method that returns a ChatAgent
     11     # with this client already configured
---> 14     agent = client.create_agent(
     15         name="financial-analyst",
     16         instructions="You are a helpful financial analyst assistant.",
     17         temperature=0.7,
     18         max_tokens=500,
     19     )
     21     # Run the agent (async)
     22     response = await agent.run("What is the current P/E ratio of AAPL?")

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

Package Versions

agent-framework:1.0.0rc3, agent-framework-azure-ai:1.0.0rc3

Python Version

Python 3.13.12

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions