Skip to content

Tools should be able to return structured data #250

@sheaturon

Description

@sheaturon

Tool results often contain a lot of structure such as dictionaries and lists that are important in conserving the authenticity of their output.
However, _execute_tool_calls, which calls the tools always compresses the resulting output returned to the agent into a single string. result_model is available to reformat the data returned by the tool but only after the original structure has been lost, and can only do so on the final completion. This leads to the loss of a lot of important structure data and lower performance by the model that is calling the tool.

The agentic tool calling engine squashes the output to a string here: https://github.com/supercog-ai/agentic/blob/main/src/agentic/actor_agents.py#L419

Should there be a way to preserve the structure better, such as returning a json in these cases?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions