Find answers from the community

Updated last year

also is there a way to have somekind of

At a glance
also is there a way to have somekind of middleware before and after the tool call made by the agent ? I want to publish what the bot is doing, what tool they chose
L
2 comments
You can create your own custom tool, and add whatever you need πŸ™‚
Plain Text
from llama_index.tools import FunctionTool

def my_tool(input_str: str) -> str:
  """My tool description."""
  return "Goodbye"

# the function name and docstring are used as name and description
# or, you can pass those params into from_defaults
tool = FunctionTool.from_defaults(fn=my_tool)
Add a reply
Sign up and join the conversation on Discord