Is the new OpenAI Agents SDK for python supported in Azure OpenAI?

MattSkogmo-5557 5 Reputation points
2025-03-26T14:07:28.2533333+00:00

Open AI recently made agentic development WAY easier with the OpenAI Agents SDK for Python.

I was trying to use this in my Azure OpenAI deployment, but wasnt successful. Is there any intent to support this API?

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform


3 answers

Sort by: Oldest
  1. Saideep Anchuri 9,470 Reputation points Moderator
    2025-03-26T15:14:49.3866667+00:00

    Hi MattSkogmo-5557

    You can use SDK for Azure AI foundry Agent too.

    Here is sample code -  

    agent = project_client.agents.create_agent(
        model="gpt-4o-mini",
        name="my-agent",
        instructions="You are helpful agent",
        tools=code_interpreter.definitions,
        tool_resources=code_interpreter.resources,
    )
    
    # Create a thread with messages
    thread = project_client.agents.create_thread()
    message = project_client.agents.create_message(
        thread_id=thread.id,
        role="user",
        content="Could you please create a bar chart for the operating profit using the following data and provide the file to me? Company A: $1.2 million, Company B: $2.5 million, Company C: $3.0 million, Company D: $1.8 million",
    )
    
    # Ask the agent to perform work on the thread
    run = project_client.agents.create_and_process_run(thread_id=thread.id, agent_id=agent.id)
    
    # Fetch and log all messages to see the agent's response
    messages = project_client.agents.list_messages(thread_id=thread.id)
    print(f"Messages: {messages}")
    
    

    Kindly refer below link: Azure Ai service Agent overview

    Thank You.

    Was this answer helpful?


  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. MattSkogmo-5557 5 Reputation points
    2025-03-31T15:52:08.9633333+00:00

    Answered my own question via another, helpful route:
    Yes, you can use it! @Ryan Little you are correct. Thanks, and here is a link to a more thoroughly worked example: https://github.com/hieumoscow/azure-openai-agents?tab=readme-ov-file

    The agentic part of the example works great -- it will still complain a bit because it appears that tracing requires an openAI api key, but the rest is wonderful.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.