Skip to content

Simplify tool registration #861

@malhotra5

Description

@malhotra5

Today tool registration looks like the following

from openhands.tools.execute_bash import BashTool
from openhands.sdk import register_tool

register_tool('BashTool', BashTool)

agent = Agent(tools=[BashTool])

This is cumbersome, ideally importing the tool should automatically register it. Which means

from openhands.tools.execute_bash import BashTool # Both imports and registers tool

agent = Agent(tools=[BashTool])

The simplest solution would be to import register_tool wherever the tool is defined. This way the registration logic is automatically invoked upon import

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions