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.
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#8B0000', 'primaryTextColor': '#fff', 'primaryBorderColor': '#710101', 'lineColor': '#189AB4', 'secondaryColor': '#189AB4', 'tertiaryColor': '#fff' }}}%%
graph LR
agent["Agent"] -- "uses" --> tool["Tool: truncate_tool_output"]
tool -- "returns" --> result["Result"]
style tool fill:#189AB4,color:#fff
style agent fill:#8B0000,color:#fff
style result fill:#8B0000,color:#fffSignature
def truncate_tool_output(tool_name: str, output: str, tool_call_id: str, run_id: str) -> strParameters
ParamField
strNo description available.
ParamField
strNo description available.
ParamField
strNo description available.
ParamField
strNo description available.
Returns
ResponseField
strThe result of the operation.
Uses
get_tool_budgetestimate_tokensget_tool_output_storestore.storestore.format_referencelogger.debug
Source
View on GitHubpraisonaiagents/context/manager.py at line 731