fix: Update AgentTool to use Agent's description when input_schema is provided in FunctionDeclaration

Co-authored-by: Xuan Yang <xygoogle@google.com>
PiperOrigin-RevId: 835379243
This commit is contained in:
Xuan Yang
2025-11-21 15:25:27 -08:00
committed by Copybara-Service
parent 777dba3033
commit 52674e7fac
2 changed files with 25 additions and 0 deletions
+2
View File
@@ -79,6 +79,8 @@ class AgentTool(BaseTool):
result = _automatic_function_calling_util.build_function_declaration(
func=self.agent.input_schema, variant=self._api_variant
)
# Override the description with the agent's description
result.description = self.agent.description
else:
result = types.FunctionDeclaration(
parameters=types.Schema(