Skip to content

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

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

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

Conversation

@guptaishaan

Copy link
Copy Markdown

The cleanup_unused_files tool was declared with list[str] | None union-type annotations (PEP 604 / Python 3.10+ syntax). ADK's automatic function calling schema parser does not support this syntax, causing the error "Failed to parse the parameter file_patterns: List[str] | None = None" whenever the agent builder assistant was invoked.

The fix replaces the two affected parameters (file_patterns and used_files) with Optional[List[str]] and List[str] from the typing module, which is the style already used throughout the other tool files in the same package (e.g. delete_files.py). No behaviour change — only the type annotation form is updated.

Fixes #3591.

…tomatic function calling parse error

The `cleanup_unused_files` tool was declared with `list[str] | None` union-type annotations (PEP 604 / Python 3.10+ syntax). ADK's automatic function calling schema parser does not support this syntax, causing the error "Failed to parse the parameter file_patterns: List[str] | None = None" whenever the agent builder assistant was invoked.

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