fix: remove developer note from transfer_to_agent tool description#4654
fix: remove developer note from transfer_to_agent tool description#4654giulio-leone wants to merge 1 commit intogoogle:mainfrom
Conversation
Summary of ChangesHello, 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 refines the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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
|
|
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. |
|
Response from ADK Triaging Agent Hello @giulio-leone, thank you for your contribution! Before we can merge this pull request, you'll need to sign a Contributor License Agreement (CLA). You can find more information in the "checks" section at the bottom of the pull request. Thanks! |
There was a problem hiding this comment.
Code Review
This pull request correctly moves a developer-facing note from the transfer_to_agent function's docstring to an inline comment, preventing it from being sent to the LLM. This is a good change that saves tokens and removes irrelevant context for the model. I have added one suggestion to reformat the new comment to align with PEP 8 style guidelines for line length.
| # Developer note: For most use cases, prefer TransferToAgentTool over | ||
| # calling this function directly. TransferToAgentTool adds enum | ||
| # constraints that prevent LLMs from hallucinating invalid agent names. |
There was a problem hiding this comment.
According to the PEP 8 style guide, lines in a block comment should be limited to 72 characters for readability. The first line of this comment exceeds this limit. Please re-wrap the comment to adhere to this guideline.
| # Developer note: For most use cases, prefer TransferToAgentTool over | |
| # calling this function directly. TransferToAgentTool adds enum | |
| # constraints that prevent LLMs from hallucinating invalid agent names. | |
| # Developer note: For most use cases, prefer TransferToAgentTool | |
| # over calling this function directly. TransferToAgentTool adds enum | |
| # constraints that prevent LLMs from hallucinating invalid agent names. |
References
- PEP 8 recommends limiting lines of block comments to 72 characters to improve readability. (link)
bda119b to
8010c56
Compare
The docstring of transfer_to_agent() included a 'Note:' section with developer-facing advice about preferring TransferToAgentTool. Since FunctionTool uses the full docstring as the tool description sent to the model on every invocation, this note was consuming input tokens and adding irrelevant information to the model context. Move the note to an inline comment in the function body so it remains visible to developers but is not included in the tool description. Fixes google#4615
8010c56 to
a457fb7
Compare
|
Closing — CLA not yet signed. Will resubmit when ready. |
Summary
Fixes #4615
The
transfer_to_agent()function docstring included aNote:section with developer-facing guidance about preferringTransferToAgentTool. SinceFunctionToolextracts the full docstring viainspect.cleandoc()and uses it as the tool description sent to the model on every invocation, this developer note was:Changes
Before (sent to model)
After (sent to model)
Testing
TransferToAgentTool.descriptionno longer contains the Note section