Skip to content

Commit ba24ead

Browse files
authored
fix(client): A2ACardResolver.get_agent_card will auto-populate with agent_card_path when relative_card_path is empty (#508)
- Previously, it would only override with the default path when `relative_card_path` is `None` - Developer Experience Improvement when `urlparse` or similar libraries are used.
1 parent 051ab20 commit ba24ead

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/a2a/client/card_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def get_agent_card(
5353
Args:
5454
relative_card_path: Optional path to the agent card endpoint,
5555
relative to the base URL. If None, uses the default public
56-
agent card path.
56+
agent card path. Use `'/'` for an empty path.
5757
http_kwargs: Optional dictionary of keyword arguments to pass to the
5858
underlying httpx.get request.
5959
@@ -65,7 +65,7 @@ async def get_agent_card(
6565
A2AClientJSONError: If the response body cannot be decoded as JSON
6666
or validated against the AgentCard schema.
6767
"""
68-
if relative_card_path is None:
68+
if not relative_card_path:
6969
# Use the default public agent card path configured during initialization
7070
path_segment = self.agent_card_path
7171
else:

0 commit comments

Comments
 (0)