Documentation
¶
Index ¶
- Variables
- func EncodedExceeds(value any, limit ToolOutputLimit) bool
- func LimitError(err error, label string, limit ToolOutputLimit) error
- func LimitString(text, label string, limit ToolOutputLimit) string
- func LimitToolOutput(output any, label string, limit ToolOutputLimit) any
- func MarshalString(value any) string
- type Tier
- type ToolOutputLimit
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // GatewayResultTier matches internal/conversation/flow's gateway prune for // tool-result content. GatewayResultTier = Tier{ MaxBytes: textprune.DefaultMaxBytes, MaxLines: textprune.DefaultMaxLines, HeadBytes: 6 * 1024, TailBytes: 2 * 1024, HeadLines: 180, TailLines: 50, Marker: textprune.DefaultMarker, } // GatewayArgsTier matches internal/conversation/flow's gateway prune for // tool-call arguments. GatewayArgsTier = Tier{ MaxBytes: textprune.DefaultMaxBytes, MaxLines: textprune.DefaultMaxLines, HeadBytes: 4 * 1024, TailBytes: 2 * 1024, HeadLines: 180, TailLines: 50, Marker: textprune.DefaultMarker, } )
Functions ¶
func EncodedExceeds ¶
func EncodedExceeds(value any, limit ToolOutputLimit) bool
func LimitError ¶
func LimitError(err error, label string, limit ToolOutputLimit) error
func LimitString ¶
func LimitString(text, label string, limit ToolOutputLimit) string
func LimitToolOutput ¶
func LimitToolOutput(output any, label string, limit ToolOutputLimit) any
func MarshalString ¶
Types ¶
type Tier ¶
type Tier struct {
MaxBytes int
MaxLines int
HeadBytes int
TailBytes int
HeadLines int
TailLines int
Marker string
}
Tier is a named layered truncation policy: MaxBytes/MaxLines are the outer ceiling that decides whether truncation engages at all; HeadBytes/TailBytes and HeadLines/TailLines are the retained head/tail split once it does.
func (Tier) LimitString ¶
LimitString truncates s to this tier's head/tail budget, UTF-8 safely, once s exceeds the tier's ceiling.
type ToolOutputLimit ¶
func NormalizedLimit ¶
func NormalizedLimit(limit ToolOutputLimit) ToolOutputLimit
Click to show internal directories.
Click to hide internal directories.