Allow Tools to be set to return directly

Created on 7 April 2025, 7 days ago

Problem/Motivation

Langchain has a structure used that allows certain tools to return there results directly to the end user. Example on the Wikipedia tool being used for that here: https://api.python.langchain.com/en/latest/tools/langchain_community.too...

We should do the same for configuration agents.

We already have a structure where we allow the getToolResults, so you can get all the tool objects and possible results they have, however this would mean that if you know that the textual result of a tool is good enough, the agent doesn't have to spend time on rewriting the output of the tool.

This also means that simpler use cases, like the AI Validations module that does Field Validation, could create its own extended ToolInterface that adds a allow/disallow method, that can be used to easily hook on agents to AI Validations module or any other type of module that wants to return anything structured.

Proposed resolution

When setting up an agent, setup so that a tool can be set to Return Directly.
If that tool is hit, return the text value as the result and end the loop.

Note that in a hierarchy, the child agent would return this value to the parent agent, but it would not stop the parents run.

📌 Task
Status

Active

Version

1.1

Component

Code

Created by

🇩🇪Germany marcus_johansson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024