-
Notifications
You must be signed in to change notification settings - Fork 2k
Feat/a2a request metadata #3099
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
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @ufJmacca, 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 implements a crucial feature to propagate metadata from Agent-to-Agent (A2A) requests directly into the 'InvocationContext'. This ensures that valuable request-specific metadata, previously lost, is now preserved and accessible throughout an agent's execution. This enhancement significantly improves end-to-end traceability and enables developers to build more sophisticated, context-aware logic within their distributed multi-agent systems. Highlights
Using Gemini Code AssistThe 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
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 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
|
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 effectively introduces a new feature to propagate metadata from an incoming Agent-to-Agent (A2A) request into the InvocationContext
. The changes are logical and correctly implemented across the necessary components: request_converter
, RunConfig
, InvocationContext
, and runners
. This enhancement will improve traceability in a multi-agent system. My review includes one suggestion to make the code slightly more concise and Pythonic.
Response from ADK Triaging Agent Hello @ufJmacca, thank you for creating this PR! Before we can merge this PR, you need to sign our Contributor License Agreement (CLA). You can do so by following the instructions at https://cla.developers.google.com/. Once you have signed the CLA, the "cla/google" check will pass, and we can proceed with the review. Thanks! |
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
feat: Propagate A2A request metadata to InvocationContext
Fixes #3098
Description
This pull request introduces a new feature to propagate the
metadata
from an incoming Agent-to-Agent (A2A) request into theInvocationContext
. This enhancement enables end-to-end traceability and allows developers to build more advanced logic within their agents based on request-specific metadata in a distributed multi-agent system.Currently, any
metadata
sent as part of an A2AMessageSendParams
is dropped during the conversion process and is not accessible within the agent's execution context. This change ensures that this valuable information is preserved and made available.Key Changes:
RunConfig
Update: A new optionalmetadata
field has been added to theRunConfig
class to serve as a carrier for the metadata during the invocation setup.convert_a2a_request_to_adk_run_args
function in the A2A converter has been updated to correctly extract themetadata
from theRequestContext
'srequest
property.InvocationContext
Update: A newa2a_metadata
field has been added to theInvocationContext
to store the metadata, making it accessible throughout the agent's execution._new_invocation_context
method in theRunner
now transfers the metadata from theRunConfig
to theInvocationContext
upon its creation.Manual End-to-End Testing
Manual end-to-end testing was completed to verify the functionality in a real-world scenario. The details of the manual testing, including the setup, requests, and validation steps, can be found in the following repository:
https://github.com/ufJmacca/manual-A2A-request-metadata-propagation-to-InvocationContext
This change provides a critical enhancement for building robust and traceable distributed agent systems with the ADK.