Skip to content

Commit 8aff612

Browse files
authored
chore: Update CrewAI Agent to 0.2.16 (#265)
* chore: Update CrewAI Agent to 0.2.16 * Update python version
1 parent 255fb15 commit 8aff612

File tree

6 files changed

+53
-35
lines changed

6 files changed

+53
-35
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.13

‎samples/python/agents/crewai/README.md‎

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## CrewAI Agent with A2A Protocol
1+
# CrewAI Agent with A2A Protocol
22

33
This sample demonstrates a simple image generation agent built with [CrewAI](https://www.crewai.com/open-source) and exposed through the A2A protocol.
44

@@ -52,7 +52,7 @@ sequenceDiagram
5252
3. Set up the Python environment:
5353

5454
```bash
55-
uv python pin 3.12
55+
uv python pin 3.13
5656
uv venv
5757
source .venv/bin/activate
5858
```
@@ -73,15 +73,13 @@ sequenceDiagram
7373

7474
```bash
7575
# Connect to the agent (specify the agent URL with correct port and host)
76-
cd samples/python/hosts/cli
76+
cd samples/python/hosts/cli
7777
uv run . --agent http://localhost:10001
7878

7979
# If you changed the port when starting the agent, use that port instead
8080
# uv run . --agent http://localhost:YOUR_PORT
8181
```
8282

83-
Or run the [demo app](/A2A/A2A/demo/README.md)
84-
8583
## Build Container Image
8684

8785
Agent can also be built using a container file.
@@ -98,10 +96,10 @@ Agent can also be built using a container file.
9896
podman build -f agents/crewai/Containerfile . -t crewai-a2a-server
9997
```
10098

101-
> [!Tip]
102-
> Podman is a drop-in replacement for `docker` which can also be used in these commands.
99+
> [!Tip]
100+
> Podman is a drop-in replacement for `docker` which can also be used in these commands.
103101

104-
3. Run you container
102+
3. Run your container
105103

106104
```bash
107105
podman run -p 10001:10001 -e GOOGLE_API_KEY=your_api_key_here crewai-a2a-server
@@ -110,8 +108,9 @@ Agent can also be built using a container file.
110108
4. Run A2A client (follow step 5 from the section above)
111109

112110
> [!Important]
113-
> * **Access URL:** You must access the A2A client through the URL `0.0.0.0:10001`. Using `localhost` will not work.
114-
> * **Hostname Override:** If you're deploying to an environment where the hostname is defined differently outside the container, use the `HOST_OVERRIDE` environment variable to set the expected hostname on the Agent Card. This ensures proper communication with your client application.
111+
>
112+
> - **Access URL:** You must access the A2A client through the URL `0.0.0.0:10001`. Using `localhost` will not work.
113+
> - **Hostname Override:** If you're deploying to an environment where the hostname is defined differently outside the container, use the `HOST_OVERRIDE` environment variable to set the expected hostname on the Agent Card. This ensures proper communication with your client application.
115114
116115
## Features & Improvements
117116
@@ -130,14 +129,6 @@ Agent can also be built using a container file.
130129

131130
## Learn More
132131

133-
- [A2A Protocol Documentation](https://google.github.io/A2A/#/documentation)
132+
- [A2A Protocol Documentation](https://a2a-protocol.org)
134133
- [CrewAI Documentation](https://docs.crewai.com/introduction)
135134
- [Google Gemini API](https://ai.google.dev/gemini-api)
136-
137-
138-
## Disclaimer
139-
Important: The sample code provided is for demonstration purposes and illustrates the mechanics of the Agent-to-Agent (A2A) protocol. When building production applications, it is critical to treat any agent operating outside of your direct control as a potentially untrusted entity.
140-
141-
All data received from an external agent—including but not limited to its AgentCard, messages, artifacts, and task statuses—should be handled as untrusted input. For example, a malicious agent could provide an AgentCard containing crafted data in its fields (e.g., description, name, skills.description). If this data is used without sanitization to construct prompts for a Large Language Model (LLM), it could expose your application to prompt injection attacks. Failure to properly validate and sanitize this data before use can introduce security vulnerabilities into your application.
142-
143-
Developers are responsible for implementing appropriate security measures, such as input validation and secure handling of credentials to protect their systems and users.

‎samples/python/agents/crewai/__main__.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def main(host, port):
7272
),
7373
url=agent_host_url,
7474
version='1.0.0',
75-
defaultInputModes=ImageGenerationAgent.SUPPORTED_CONTENT_TYPES,
76-
defaultOutputModes=ImageGenerationAgent.SUPPORTED_CONTENT_TYPES,
75+
default_input_modes=ImageGenerationAgent.SUPPORTED_CONTENT_TYPES,
76+
default_output_modes=ImageGenerationAgent.SUPPORTED_CONTENT_TYPES,
7777
capabilities=capabilities,
7878
skills=[skill],
7979
)

‎samples/python/agents/crewai/agent_executor.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def execute(
5050
FilePart(
5151
file=FileWithBytes(
5252
bytes=data.bytes,
53-
mimeType=data.mime_type,
53+
mime_type=data.mime_type,
5454
name=data.id,
5555
)
5656
)

‎samples/python/agents/crewai/pyproject.toml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@ requires-python = ">=3.12"
77
dependencies = [
88
"crewai[tools]>=0.95.0",
99
"google-genai>=1.9.0",
10-
"a2a-samples",
10+
"a2a-sdk>=0.2.16",
1111
]
12-
13-
[tool.uv.sources]
14-
a2a-samples = { workspace = true }

‎samples/python/uv.lock‎

Lines changed: 38 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)