Skip to content

ai_assistant_tool_result_string_max_chars

github-actions[bot] edited this page Nov 14, 2026 · 6 revisions

Filters the maximum string field size kept inside compacted tool results.

Longer string values are truncated with context metadata before the result is sent to the provider.

Auto-generated Example

add_filter(
   'ai_assistant_tool_result_string_max_chars',
    function( int $chars ) {
        // Your code here.
        return $chars;
    }
);

Parameters

  • int $chars Maximum string field size in characters. Default 8192.

Files

apply_filters('ai_assistant_tool_result_string_max_chars', 8 * 1024)

← All Hooks

Clone this wiki locally