ToolOutputTruncationConfig class
Configuration for truncating large tool outputs.
When a tool's output exceeds maxTokens, the harness preserves the beginning (prefix) of the output up to the limit and truncates the remainder (tail), appending a notice informing the model that the output was truncated.
Example:
final config = ToolOutputTruncationConfig(maxTokens: 2048);
- Annotations
-
- @MappableClass.new(caseStyle: CaseStyle.snakeCase, ignoreNull: true)
Constructors
- ToolOutputTruncationConfig({required int maxTokens})
-
Creates a ToolOutputTruncationConfig with the given
maxTokens. - ToolOutputTruncationConfig.fromJson(String json)
-
Decodes a ToolOutputTruncationConfig from a JSON string.
factory
-
ToolOutputTruncationConfig.fromMap(Map<
String, dynamic> map) -
Decodes a ToolOutputTruncationConfig from a map.
factory
Properties
-
copyWith
→ ToolOutputTruncationConfigCopyWith<
ToolOutputTruncationConfig, ToolOutputTruncationConfig, ToolOutputTruncationConfig> -
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxTokens → int
-
Maximum number of estimated tokens for a single tool response.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → String -
inherited
-
toMap(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited