#[Solved ✅] Local tools not working

1 messages · Page 1 of 1 (latest)

hot stump
#

I was going through the guide for creating local tools but it looks like the examples are broken. Following the Readme doesn't work (terminal hangs up when running the examples)

#

I tried the sql_agent

finite sedge
peak night
#

Hey, yes the docs have not been updated. Doing it today.

#

Thanks for reporting.

hot stump
hot stump
hot stump
peak night
#

Hey @hot stump , if I may ask what kind of tool are you working on?

hot stump
#

sql tool for postgres

peak night
#

can you give me 2 hours, we have made this really really easy and revamped the whole thing. I will update the docs.

hot stump
#

sure

#

appreciate the fast replies 👍

peak night
#

Thanks a lot. Basically, it's going to be a literal python function. Something pretty cool.

#

Thanks.

hot stump
#

Sounds dope

hot stump
#

@peak night The docs are still the same, have you published your changes yet?

peak night
peak night
hot stump
#

oh didn't see this one

peak night
#

Just published. 😅

hot stump
#

🙂

#

k, thx

hot stump
#

I'm still not sure how to intgerate the tool into any example 😦

finite sedge
#

Just import the action from your custom tool:

from composio import action
from custom_tools import say

composio_toolset = ComposioToolSet()

# Get required tools
tools = [
  *composio_toolset.get_actions(
      actions=[
          say,  # This is an example of a custom tool
      ]
  ),
]

And add tools in your preferred framework (if taking crewAI as an example):

crewai_agent = Agent(
    role="Github Agent",
    goal="""You take action on Github using Github APIs""",
    backstory=(
        "You are AI agent that is responsible for taking actions on Github "
        "on users behalf. You need to take action on Github using Github APIs"
    ),
    verbose=True,
    tools=tools, # add here
    llm=llm,
)
#

@hot stump

hot stump
#

In this, the say() action takes a string param called message, can I pass any params to this action or does it have to be just message?

finite sedge
hot stump
#

I think the docstring is required, that's giving me an exception

finite sedge
hot stump
#

I'm getting this validation error when trying to create an agent using crewAI

  Value error, 1 validation error for CrewAgentExecutor
tools -> 0
  Can't instantiate abstract class BaseTool with abstract method _run (type=type_error) [type=value_error, input_value={'role': 'Query Executor ...***'), openai_proxy='')}, input_type=dict]```
#

looks like the custom tools have some implementation issue?

#

or am I missing something?

peak night
#

Just checking.

#

Yes doc string is required because agent uses the docstring information to decide if the tool should be called or not. You basically need to add description around the tool using the doc string. I will add it to the doc.

peak night
#

Confirming the bug does exist. Thanks for pointing out.

hot stump
#

This is the longest I've spent on an assignment 🫠

peak night
#

Please just submit your code even if it's not working. I had no idea you were on assignment. We have been refactoring the local tools recently.

hot stump
#

oh lol

#

ok

peak night
#

Hey, this has been corrected btw. Please use the latest version of the SDK.

hot stump
#

Oh, I have already submitted the application. 🥲