Skip to content

Custom methods to extract the output of FunctionTool #2046

@pokliu

Description

@pokliu

Please read this first

  • Have you read the docs?Agents SDK docs [yes]
  • Have you searched for related issues? Others may have had similar requests [yes]

Describe the feature

Currently, Agent.as_tool supports custom_output_extractor to optimize the tool's output before passing it to the next LLM call. However, FunctionTool lacks this functionality. This leads to inefficiency in my application: the tool's output often contains front-end presentation data (e.g., image URLs, timestamps), which is irrelevant to LLM. Forcing the entire output into the LLM context results in unnecessary token consumption and increased costs. To address this issue, I recommend extending the custom_output_extractor functionality or a similar mechanism to FunctionTool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions