Skip to content

Commit 94fb9f8

Browse files
committed
Update ADK doc according to issue #61
1 parent 7773037 commit 94fb9f8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/a2a/quickstart-exposing.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,32 @@ a2a_app = to_a2a(root_agent, port=8001)
6363

6464
The `to_a2a()` function will even auto-generate an agent card in-memory behind-the-scenes by [extracting skills, capabilities, and metadata from the ADK agent](https://github.com/google/adk-python/blob/main/src/google/adk/a2a/utils/agent_card_builder.py), so that the well-known agent card is made available when the agent endpoint is served using `uvicorn`.
6565

66+
Alternatively, you can provide your own agent card using the `agent_card` parameter. This parameter accepts either a pre-built `AgentCard` object or a path to an agent card JSON file. This is useful when you want to have more control over the agent card.
67+
68+
Here is an example of how to use `to_a2a` with a path to a JSON file:
69+
```python
70+
from google.adk.a2a.utils.agent_to_a2a import to_a2a
71+
72+
# Make your agent A2A-compatible
73+
a2a_app = to_a2a(root_agent, port=8001, agent_card='path/to/your/agent_card.json')
74+
```
75+
76+
And here is an example with a pre-built `AgentCard` object:
77+
```python
78+
from google.adk.a2a.utils.agent_to_a2a import to_a2a
79+
from a2a.types import AgentCard
80+
81+
# Create your own agent card
82+
my_agent_card = AgentCard(
83+
name='my_custom_agent',
84+
description='A custom agent with a specific purpose.',
85+
# other agent card fields
86+
)
87+
88+
# Make your agent A2A-compatible
89+
a2a_app = to_a2a(root_agent, port=8001, agent_card=my_agent_card)
90+
```
91+
6692
Now let's dive into the sample code.
6793

6894
### 1. Getting the Sample Code { #getting-the-sample-code }

0 commit comments

Comments
 (0)