Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/google/adk/tools/base_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,19 @@ class BaseTool(ABC):
def __init__(
self,
*,
name,
description,
name: str, # Added type hint for clarity
description: str,
is_long_running: bool = False,
custom_metadata: Optional[dict[str, Any]] = None,
):
# -CONTRIBUTION START ---
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls remove these comments

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

if " " in name:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a regex to include all prohibited naming conventions.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok Rohit I will look into it Thanks

raise ValueError(
f"Invalid tool name: '{name}'. Tool names cannot contain spaces. "
"Please use underscores instead (e.g., 'my_tool_name')."
)
# CONTRIBUTION END ---

self.name = name
self.description = description
self.is_long_running = is_long_running
Expand Down
Loading