feat(genai): add ToolFunctionCallingConfigWithText sample and standarize ToolFunctionDescriptionWithText sample - #10314
Conversation
…ctionDescriptionWithText test case
There was a problem hiding this comment.
Code Review
This pull request introduces a new code sample, ToolFunctionCallingConfigWithText.java, to demonstrate forcing a specific function call using ToolConfig. It also updates ToolFunctionDescriptionWithText.java to use a simpler weather-based function calling example instead of the album sales example, and updates the integration tests accordingly. The feedback suggests improving the schema definition in the new sample by explicitly marking fields as required to ensure consistent structured output from the model.
ToolFunctionCallingConfigWithText sample and standarize ToolFunctionDescriptionWithText sample
|
Here is the summary of changes. You are about to add 1 region tag.
This comment is generated by snippet-bot.
|
Description
Fixes #
b/530303154
ToolFunctionDescriptionWithText.javato use theget_current_weatherfunction declaration for consistency across SDK samples.ToolFunctionCallingConfigWithText.javato demonstrate usingFunctionCallingConfig(modeANYwithallowedFunctionNames) for forced function calling with the Google Gen AI SDK (google-genai).ToolsIT.javato include unit test coverage for the new and updated samples.Checklist
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only