Is there any particular reason we globally registe...
# proj-sdk
q
Is there any particular reason we globally register tools even though we also pass them directly into the agent? https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/02_custom_tools.py#L183-L191
c
mainly because we need to make tool serializable
q
OK, so registering it means it knows what type to deserialize it into later
nod 1
@chilly-france-44439 hmm, but if we passed in the actual instances of the tools, rather than the names of them, wouldn’t that be serializable? I’m thinking about this again because I want to interact with the planner tool from other code and I realize that i don’t have a reference to it
c
if we passed in the actual instances of the tools, rather than the names of them, wouldn’t that be serializable?
yeah that will be very tricky because it is not guaranteed that remote server will have the same set of dependency -- and i'm not super sure if pickle the python object and send over would be a safe/reliable thing to do, hence we go with the current implementation for an API
> I want to interact with the planner tool from other code . What type of interaction? Would it make it easier for you if we had a few native ways to interact with these tools via public API?
q
> What type of interaction Seeing what the currently planned items are basically. Maybe editing them.
that will be very tricky because it is not guaranteed that remote server will have the same set of dependency
Ah I see, I was only thinking of local mode. I'm thinking of tools as things that can be configured beyond just the names...
c
If you just want a hacky way that just works... you can do:
Copy code
conversation.agent.tool_maps["planning"]
and then you will have access to that instance
but it is not working over remote agent server yet
q
Ah thanks that'll get me going in the meantime. And it helps to understand that the remote mode gives us limitations on how we setup tools. I wonder what the right way to "Add a task" would be, or otherwise pass info directly too and from a tool - I'm not sure if it's even the right question to ask. The "Hook" concept could also related to this.
c
i imagine we can figure a general way to implement the "hook" by allow some sort of tool-callback 🤔