Skip to content

chore: add sample client and server#848

Merged
ishymko merged 5 commits into1.0-devfrom
ishymko/samples
Mar 17, 2026
Merged

chore: add sample client and server#848
ishymko merged 5 commits into1.0-devfrom
ishymko/samples

Conversation

@ishymko
Copy link
Member

@ishymko ishymko commented Mar 17, 2026

There is a dedicated repo for samples (a2a-samples), however having something runnable in the repository is useful for manual testing and ad-hoc experimentation. Add trivial hello-world/echo agent and a simple client CLI to connect to it.

It exposes all transports and both 1.0 and 0.3 version.

  1. Run server
$ uv run samples/hello_world_agent.py
  1. (separate terminal) Run client (supports --transport as well)
$ uv run samples/cli.py
Connecting to http://127.0.0.1:41241 (preferred transport: Any)

✓ Agent Card Found:
  Name: Sample Agent
  Picked Transport: JsonRpcTransport

Connected! Send a message or type /quit to exit.
You: test
TaskStatusUpdate [TASK_STATE_WORKING]: Processing your question... 
TaskArtifactUpdate [response]: Hello World! You said: 'test'. Thanks for your message! 
TaskStatusUpdate [TASK_STATE_COMPLETED]: 
--- Task Completed ---
You: 

@ishymko ishymko requested a review from a team as a code owner March 17, 2026 11:51
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces runnable sample client and server applications directly into the repository. The primary goal is to provide readily available tools for manual testing and ad-hoc experimentation with the A2A framework, complementing the existing dedicated samples repository. These additions allow developers to quickly set up and interact with a basic agent, verifying connectivity and message flow across different protocols and transport layers.

Highlights

  • Sample Client CLI Added: A new command-line interface client (samples/cli.py) has been introduced, allowing users to connect to A2A agents and send messages via various transports.
  • Sample Hello-World Agent Added: A trivial 'hello-world/echo' agent (samples/hello_world_agent.py) has been added, demonstrating basic agent functionality and message processing.
  • Comprehensive Transport and Protocol Support: The new sample agent exposes all supported transports (JSONRPC, HTTP+JSON, GRPC) and both v1.0 and v0.3 protocol versions, facilitating thorough testing and experimentation.
Changelog
  • samples/cli.py
    • Added a new Python script that acts as a command-line interface client for A2A agents.
    • Implemented argument parsing for agent URL and preferred transport.
    • Included logic for connecting to an agent, sending messages, and processing streaming responses (status updates, artifact updates).
  • samples/hello_world_agent.py
    • Added a new Python script defining a 'Sample Agent' that responds to user input.
    • Implemented SampleAgentExecutor to handle task execution, including starting work, adding artifacts, and completing tasks.
    • Configured the agent to expose interfaces for GRPC (v1.0 and v0.3), JSONRPC (v1.0 and v0.3), and HTTP+JSON (v1.0 and v0.3) transports.
    • Integrated FastAPI and uvicorn for serving HTTP-based transports and gRPC for gRPC transports.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Mar 17, 2026

🧪 Code Coverage (vs 1.0-dev)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a sample client and server, which is a valuable addition for manual testing and experimentation. The code is generally well-written and demonstrates the usage of the A2A protocol. I have a few suggestions to enhance the sample code, primarily focusing on improving the asynchronous nature of the client, simplifying some repetitive code, and refining type hints for better clarity and adherence to the style guide.

@ishymko ishymko force-pushed the ishymko/samples branch 2 times, most recently from 9084d61 to b8351f1 Compare March 17, 2026 12:12
@ishymko ishymko enabled auto-merge (squash) March 17, 2026 13:41
@ishymko ishymko merged commit 20353e6 into 1.0-dev Mar 17, 2026
9 checks passed
@ishymko ishymko deleted the ishymko/samples branch March 17, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants