Truncate Tool Output • AI Agent SDK

truncate_tool_output: Truncate tool output according to its budget.

truncate_tool_output

Method

</div>

This is a method of the ContextManager class in the manager module.

Truncate tool output according to its budget.

Diagram

uses

returns

Agent

Tool: truncate_tool_output

Result

Signature

python
def truncate_tool_output(tool_name: str, output: str, tool_call_id: str, run_id: str) -> str

Parameters

ParamField str

No description available.

ParamField str

No description available.

ParamField str

No description available.

ParamField str

No description available.

Returns

ResponseField str

The result of the operation.

Uses

  • get_tool_budget
  • estimate_tokens
  • get_tool_output_store
  • store.store
  • store.format_reference
  • logger.debug

Source

View on GitHub

praisonaiagents/context/manager.py at line 731


Related Documentation