Azure / Azure/azure-sdk-for-python

Sample agent_to_agent code does not work

Open
#47,419 9 comments 0 reactions 1 assignee Assigned to @lindazqli View on GitHub
AI Projects customer-reported needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: azure-ai-projects
- **Package Version**: 2.2.0
- **Operating System**: Windows
- **Python Version**: 3.12

**Describe the bug**
The [agent_to_agent.py code sample](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_to_agent.py) results in the following error:
`openai.APIError: Agent card path must target the same host, project, and agent as the server URL.`

**To Reproduce**
The same error occurs whether you create the A2A agent and connections in the Foundry Portal or using Powershell scripts:

1. In an existing Foundry project, create an A2A agent either in the Foundry Portal or by configuring it [using the doc instructions](https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/enable-agent-to-agent-endpoint?tabs=python%2Cverify-bash%2Cconnection-powershell#enable-incoming-a2a)
2. Create an A2A Tool either in the Foundry Portal or by using the powershell script referenced in the docs.
3. Connect to the project, attach the A2APreviewTool to an agent and run a prompt

**Expected behavior**
The agent should be able to invoke the A2A tool. Instead, the error occurs:
`openai.APIError: Agent card path must target the same host, project, and agent as the server URL.`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.