Skip to content

fix: use Optional[List[str]] in cleanup_unused_files to fix automatic function calling parse error - #6517

Open
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3591-2237
Open

fix: use Optional[List[str]] in cleanup_unused_files to fix automatic function calling parse error#6517
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3591-2237

Conversation

@guptaishaan

Copy link
Copy Markdown

The cleanup_unused_files tool function declared its optional list parameters using
PEP 604 union syntax (list[str] | None), which the ADK automatic function calling
parameter parser does not support, causing a Failed to parse the parameter file_patterns: List[str] | None = None error whenever the agent builder assistant
was used in adk web.

The fix replaces the two affected parameter annotations with the equivalent
Optional[List[str]] form (from typing), which the parser handles correctly.
This matches the pattern already used in other built-in agent tools such as
search_adk_source.py.

Fixes #3591.

… function calling parse error

The `cleanup_unused_files` tool function declared its optional list parameters using

Signed-off-by: Ishaan <ishaangupta0408@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

3 participants