-
Notifications
You must be signed in to change notification settings - Fork 488
Add Dotnet Samples #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dotnet Samples #341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @iremyux, 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 a comprehensive suite of .NET samples designed to illustrate various Agent-to-Agent (A2A) communication patterns and use cases. The samples range from foundational demonstrations of basic agent interactions, such as echo and calculator functionalities, to more advanced scenarios involving command-line execution and AI-powered agents leveraging Microsoft Semantic Kernel. The primary goal is to provide clear, runnable examples that showcase the versatility and capabilities of A2A communication within the .NET ecosystem, enabling developers to quickly understand and implement agent-based solutions.
Highlights
- Basic A2A Communication Patterns: Introduces fundamental A2A concepts with an Echo Server, a Calculator Server, and a Simple Client, demonstrating basic message and task-based communication.
- Secure CLI Agent Integration: Demonstrates how to build an A2A agent that can safely execute command-line tools, featuring a server with whitelisted commands and an interactive client for system-level operations.
- AI-Powered Agent with Semantic Kernel: Showcases integration with Microsoft Semantic Kernel for AI capabilities like text summarization, sentiment analysis, idea generation, and translation, providing both a server and client for AI interactions.
- Consistent Prerelease Dependency Management: All new projects explicitly specify the
A2Apackage version to0.1.0-preview.2, ensuring consistent dependency resolution for prerelease packages across the samples. - Comprehensive Documentation and Quick Start Scripts: Each sample includes a
README.mdwith detailed setup instructions, key features, and usage examples, along withrun-demo.batscripts for quick starts on Windows, enhancing usability and ease of adoption.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| 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 issue 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
-
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. ↩
There was a problem hiding this 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 adds a comprehensive set of .NET samples for A2A communication, which is a great addition. The samples cover basic, CLI, and AI-powered agents, providing excellent examples for users. My review focuses on improving security, maintainability, and correctness. I've identified a critical security vulnerability in the CLI agent related to command injection that must be addressed. Other comments include suggestions for refactoring duplicated code, fixing fragile logic, and ensuring proper context propagation in conversations. Overall, this is a solid contribution that will be even better with these improvements.
…commands hardcoded on Server
|
Hey @holtskinner , I saw that you gave a review to other PRs contributing to the |
rokonec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, however, since we meanwhile upgrade a2a-dotnet package, I will create new PR after this one is merged and migrate it to 0.3
This PR adds a collection of .NET samples demonstrating various A2A communication patterns and use cases, from basic echo agents to AI-powered intelligent agents using Microsoft Semantic Kernel.
What's Added
Folder Structure
samples/dotnet/
├── README.md # Overview and getting started guide
├── BasicA2ADemo/ # Foundation A2A patterns
│ ├── EchoServer/ # Simple echo agent
│ ├── CalculatorServer/ # Math operations agent
│ ├── SimpleClient/ # Basic A2A client
│ └── A2ADotnetSample.sln # Visual Studio solution
├── A2ACliDemo/ # CLI-focused samples
│ ├── CLIServer/ # Command-line agent
│ └── CLIClient/ # Interactive CLI client
└── A2ASemanticKernelDemo/ # AI-powered agents
├── AIServer/ # Semantic Kernel agent
└── AIClient/ # AI interaction client
Note on the Prerelease A2A dependency: All project files explicitly specify [Version="0.1.0-preview.2"] for A2A packages, preventing NuGet from failing to find prereleased package.
Fixes a2aproject/a2a-dotnet#84