We use the term “handler” interchangeably with “tool calling.” While “tool calling” is sometimes used to refer to the invocation of a single function. It contains the logic for managing particular operations, playing a key role in organizing and carrying out tasks.

With the BaseHandler from superagentx.handler.base, you can create your own custom handlers.

Additionally, we also provide pre-build handlers for various other services and libraries.

Tool:

A tool is a method or function that performs a specific action within a larger system. In this context, tools are asynchronous functions that handle specific tasks, like fetching data from external APIs or performing calculations. The @tool decorator marks these methods as tools that can be invoked by the system.

from superagentx.handler.decorators import tool

class ExaHandler(BaseHandler):

    @tool
    async def search_contents(
            self,
            *,
            query: str,
            use_autoprompt: bool,
            num_results: int = 10,
            search_type: str | None = None
    ):