Skip to content

fix: improve func_docstring#593

Open
rahulpinto19 wants to merge 2 commits intogoogleapis:mainfrom
rahulpinto19:remove-duplicate-parameters
Open

fix: improve func_docstring#593
rahulpinto19 wants to merge 2 commits intogoogleapis:mainfrom
rahulpinto19:remove-duplicate-parameters

Conversation

@rahulpinto19
Copy link
Member

@rahulpinto19 rahulpinto19 commented Mar 16, 2026

The Problem:
If a tool description has an extra newline at the end, the system creates a "triple newline" gap before the arguments. This breaks the logic that LangChain uses to "clean" the prompt, causing the parameters to be listed twice.

The Fix:
I added .rstrip() to the description. This cleans up the extra spacing and ensures the gap is always exactly two newlines.
fixes: googleapis/genai-toolbox#1327

@rahulpinto19 rahulpinto19 requested a review from a team as a code owner March 16, 2026 18:40
@rahulpinto19 rahulpinto19 marked this pull request as draft March 16, 2026 19:40
@rahulpinto19 rahulpinto19 marked this pull request as ready for review March 17, 2026 03:52
@anubhav756
Copy link
Contributor

Thanks for the PR @rahulpinto19!

QQ: Could you include your verification steps? Specifically, it would be great to see the reproduction scripts and their outputs to confirm the fix works as expected.

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.

why there are duplicate parameters descrption in the tools ?

3 participants