Tool Result Truncating Transformer
class ToolResultTruncatingTransformer(maxLength: Int, truncationMarker: String? = null, logLevel: ToolLoopLoggingInspector.LogLevel? = null, logger: <Error class: unknown class> = LoggerFactory.getLogger(ToolResultTruncatingTransformer::class.java)) : ToolLoopTransformer
Transformer that truncates tool results exceeding a maximum length.
Useful for preventing large tool outputs from consuming excessive context.
Parameters
max Length
Maximum length of tool result string (default 10,000)
truncation Marker
Marker appended to truncated results
log Level
Optional log level for truncation events (null = no logging)
logger
Logger to use when logLevel is set
Constructors
Link copied to clipboard
constructor(maxLength: Int, truncationMarker: String? = null, logLevel: ToolLoopLoggingInspector.LogLevel? = null, logger: <Error class: unknown class> = LoggerFactory.getLogger(ToolResultTruncatingTransformer::class.java))
Functions
Link copied to clipboard
Transform history after iteration completes. Return modified list.
Link copied to clipboard
Transform LLM response before adding to history. Return modified message.
Link copied to clipboard
Transform tool result before adding to history. Return modified string.
Link copied to clipboard
Transform history before sending to LLM. Return modified list.