Skip to content

fix: use Optional[] instead of X | None in cleanup_unused_files signature - #6552

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

fix: use Optional[] instead of X | None in cleanup_unused_files signature#6552
guptaishaan wants to merge 1 commit into
google:mainfrom
guptaishaan:fix/issue-3591-1438

Conversation

@guptaishaan

Copy link
Copy Markdown

The cleanup_unused_files tool used the X | None union syntax (PEP 604) for its file_patterns and exclude_patterns parameters. ADK's automatic function calling schema parser does not support this syntax and raises a "Failed to parse the parameter" error at runtime, breaking the builder assistant chat.

The fix replaces list[str] | None with Optional[list[str]] from the typing module for both parameters. This is semantically equivalent and is correctly handled by the schema generator.

Fixes #3591.

…ture

The `cleanup_unused_files` tool used the `X | None` union syntax (PEP 604) for its `file_patterns` and `exclude_patterns` parameters. ADK's automatic function calling schema parser does not support this syntax and raises a "Failed to parse the parameter" error at runtime, breaking the builder assistant chat.

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