Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guides/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ You can add authentication to your A2A agents to protect them from unauthorized
@app.before_request
def authenticate():
# Skip authentication for agent card
if request.path in ["/", "/a2a", "/agent.json", "/a2a/agent.json"]:
if request.path in ["/", "/a2a", "/.well-known/agent.json", "/a2a/agent.json"]:
return None

# Check for Authorization header
Expand Down
4 changes: 2 additions & 2 deletions examples/developer_tools/interactive_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def generate_html_template():
<h3>Agent Information</h3>
<div class="endpoint">
<span class="http-method">GET</span>
<span class="url-path">{{agent_url}}/agent.json</span>
<span class="url-path">{{agent_url}}/.well-known/agent.json</span>
</div>
<p>Returns information about the agent, including its capabilities and available skills.</p>

Expand Down Expand Up @@ -664,7 +664,7 @@ def main():
}
],
"paths": {
"/agent.json": {
"/.well-known/agent.json": {
"get": {
"summary": "Get agent information",
"description": "Returns information about the agent, including its capabilities and skills",
Expand Down
2 changes: 1 addition & 1 deletion python_a2a/client/a2a_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _fetch_agent_card(self):
"""Fetch the agent card from the well-known URL"""
# Try standard A2A endpoint first
try:
card_url = f"{self.url}/agent.json"
card_url = f"{self.url}/.well-known/agent.json"
response = requests.get(card_url, headers=self.headers)
response.raise_for_status()
card_data = response.json()
Expand Down
2 changes: 1 addition & 1 deletion python_a2a/client/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _fetch_agent_card(self):
"""Fetch the agent card from the well-known URL"""
# Try standard A2A endpoint first
try:
card_url = f"{self.endpoint_url}/agent.json"
card_url = f"{self.endpoint_url}/.well-known/agent.json"
response = requests.get(card_url, headers=self.headers, timeout=self.timeout)
response.raise_for_status()
card_data = response.json()
Expand Down
2 changes: 1 addition & 1 deletion python_a2a/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def generate_a2a_docs(agent_card, output_dir=None):
"description": agent_card.description
},
"paths": {
"/agent.json": {
"/.well-known/agent.json": {
"get": {
"summary": "Get agent card",
"responses": {
Expand Down
2 changes: 1 addition & 1 deletion python_a2a/docs/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def generate_a2a_docs(agent_card, output_dir=None):
"description": agent_card.description
},
"paths": {
"/agent.json": {
"/.well-known/agent.json": {
"get": {
"summary": "Get agent card",
"responses": {
Expand Down
4 changes: 2 additions & 2 deletions python_a2a/server/a2a_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def a2a_root_get():
return jsonify({
"name": self.agent_card.name,
"description": self.agent_card.description,
"agent_card_url": "/agent.json",
"agent_card_url": "/.well-known/agent.json",
"protocol": "a2a"
})

Expand Down Expand Up @@ -215,7 +215,7 @@ def a2a_agent_card():
return jsonify(self.agent_card.to_dict())

# Also support the standard agent.json at the root
@app.route("/agent.json", methods=["GET"])
@app.route("/.well-known/agent.json", methods=["GET"])
def agent_card():
"""Return the agent card as JSON (standard location)"""
return jsonify(self.agent_card.to_dict())
Expand Down
2 changes: 1 addition & 1 deletion python_a2a/server/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def enhanced_a2a_agent_json():
response.headers['Content-Type'] = 'text/html; charset=utf-8'
return response

@app.route("/agent.json", methods=["GET"])
@app.route("/.well-known/agent.json", methods=["GET"])
def enhanced_root_agent_json():
"""Root agent.json endpoint"""
return enhanced_a2a_agent_json()
Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_send_message(self, text_message):
# Mock all possible agent card and task endpoints
responses.add(
responses.GET,
"https://example.com/agent.json",
"https://example.com/.well-known/agent.json",
json={"error": "Not found"},
status=404
)
Expand Down Expand Up @@ -84,7 +84,7 @@ def test_send_conversation(self, conversation):
# Mock the agent card endpoints to prevent additional calls
responses.add(
responses.GET,
"https://example.com/agent.json",
"https://example.com/.well-known/agent.json",
json={"error": "Not found"},
status=404
)
Expand Down