rigging icon indicating copy to clipboard operation
rigging copied to clipboard

[Feature Request] Support for passing `rg.Tool` objects to parse methods?

Open SJCaldwell opened this issue 10 months ago • 1 comments

This is a matter of taste, but wondering if you'd be interested in a pr to parse rg.Tool calls from messages.

In continued chats with multiple tool calls, I usually provide a tool like

class FinalAnswer(rg.Tool):
    @property
    def name(self) -> str:
        return "final_answer"
    
    @property
    def description(self) -> str:
        return "A tool that ends the session with your final true or false answer to the question: 'blah blah"

And then continue chats until this tool call is used, breaking at that point. So it'd be nice to do something like

while True and not chat.last.parse(FinalAnswer):
     # keep doing stuff

Though that might require a new property for chat.last_user or chat.last_tool or something.

Also willing to believe there is a straightforward way of doing this that I'm just missing. Anyway, lemme know!

SJCaldwell avatar Apr 12 '24 15:04 SJCaldwell