Skip to content

fix: Some tools in LLM requests are missing the description#552

Closed
efunneko wants to merge 11 commits intogoogle:mainfrom
efunneko:efunneko/122/copy_doc_string_for_tool
Closed

fix: Some tools in LLM requests are missing the description#552
efunneko wants to merge 11 commits intogoogle:mainfrom
efunneko:efunneko/122/copy_doc_string_for_tool

Conversation

@efunneko
Copy link
Contributor

@efunneko efunneko commented May 4, 2025

See issue #551

This fix will copy over the original function's doc string for functions that have ignored parameters.

@hangfei
Copy link
Collaborator

hangfei commented May 8, 2025

@efunneko thanks for the fix.

Could you provide before vs after fix logs/screenshots?

@hangfei hangfei self-requested a review May 8, 2025 03:35
@efunneko efunneko changed the title Issue 122: Fix missing tool description Issue 551: Fix missing tool description May 8, 2025
@gregmeldrum
Copy link

I'm seeing this issue as well using claude 3.7 sonnet in Bedrock through litellm. Without the fix, I get Bedrock exceptions stating that the description field is missing. When I apply the fix, the exceptions go away.

Here is an example exception:

litellm.exceptions.BadRequestError: litellm.BadRequestError: OpenAIException - litellm.BadRequestError: BedrockException 
{"message":"7 validation errors detected: Value '' at 'toolConfig.tools.1.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1;
Value '' at 'toolConfig.tools.3.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1;
Value '' at 'toolConfig.tools.4.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1; 
Value '' at 'toolConfig.tools.6.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1; 
Value '' at 'toolConfig.tools.7.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1; 
Value '' at 'toolConfig.tools.8.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1; 
Value '' at 'toolConfig.tools.9.member.toolSpec.description' failed to satisfy constraint: Member must have length greater than or equal to 1"}.

@efunneko efunneko changed the title Issue 551: Fix missing tool description fix: Some tools in LLM requests are missing the description May 14, 2025
@efunneko
Copy link
Contributor Author

@hangfei - I saw the exact same logs as what @gregmeldrum posted in his comment above. The logs went away after the fix was made. Please let me know if you would still like screen shots from a debug session or if this is enough

@efunneko
Copy link
Contributor Author

@hangfei Please let me know if you still need more from me on this. The fix is very straightforward and makes a big difference to system performance.

@seanzhou1023 seanzhou1023 added the ready to pull [Status] This PR is ready to be importing back to Google label May 31, 2025
copybara-service bot pushed a commit that referenced this pull request May 31, 2025
Copybara import of the project:

--
8540f26 by Edward Funnekotter (aider) <efunneko@gmail.com>:

fix: ensure function description is copied when ignoring parameters

--
b9fb591 by Edward Funnekotter <efunneko@gmail.com>:

Fix annoying comments

COPYBARA_INTEGRATE_REVIEW=#552 from efunneko:efunneko/122/copy_doc_string_for_tool d9bc243
PiperOrigin-RevId: 765470363
@seanzhou1023
Copy link
Collaborator

merged in 7fdc6b4

whhlct pushed a commit to whhlct/adk-python that referenced this pull request Jun 6, 2025
Copybara import of the project:

--
8540f26 by Edward Funnekotter (aider) <efunneko@gmail.com>:

fix: ensure function description is copied when ignoring parameters

--
b9fb591 by Edward Funnekotter <efunneko@gmail.com>:

Fix annoying comments

COPYBARA_INTEGRATE_REVIEW=google#552 from efunneko:efunneko/122/copy_doc_string_for_tool d9bc243
PiperOrigin-RevId: 765470363
coder-aditi pushed a commit to coder-aditi/adk-python that referenced this pull request Jul 2, 2025
Copybara import of the project:

--
8540f26 by Edward Funnekotter (aider) <efunneko@gmail.com>:

fix: ensure function description is copied when ignoring parameters

--
b9fb591 by Edward Funnekotter <efunneko@gmail.com>:

Fix annoying comments

COPYBARA_INTEGRATE_REVIEW=google#552 from efunneko:efunneko/122/copy_doc_string_for_tool d9bc243
PiperOrigin-RevId: 765470363
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to pull [Status] This PR is ready to be importing back to Google

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants