Documentation
¶
Index ¶
- Constants
- func ApplyAll(ctx context.Context, services []Service, req Request) ([]agentkit.ModelMessage, int, error)
- func PruneToolResults(messages []agentkit.ModelMessage, maxBytes int) []agentkit.ModelMessage
- func RetryCall(ctx context.Context, policy RetryPolicy, isRetryable func(error) bool, ...) error
- func TruncateToolResult(result agentkit.ToolResult, maxBytes int) agentkit.ToolResult
- type EventData
- type Request
- type Result
- type RetryConfig
- type RetryPolicy
- type Service
- type SummarizationRetryCallbacks
Constants ¶
View Source
const ( KindSummary = "summary" KindPrune = "prune" )
Variables ¶
This section is empty.
Functions ¶
func ApplyAll ¶
func ApplyAll(ctx context.Context, services []Service, req Request) ([]agentkit.ModelMessage, int, error)
ApplyAll runs compaction services in order, returning the latest message view and how many services reported Applied.
func PruneToolResults ¶
func PruneToolResults(messages []agentkit.ModelMessage, maxBytes int) []agentkit.ModelMessage
PruneToolResults truncates oversized tool result text deterministically.
func RetryCall ¶
func RetryCall( ctx context.Context, policy RetryPolicy, isRetryable func(error) bool, call func() error, callbacks *SummarizationRetryCallbacks, ) error
RetryCall runs call with bounded retries. isRetryable classifies transient failures; when nil, only context cancellation is treated as non-retryable.
func TruncateToolResult ¶
func TruncateToolResult(result agentkit.ToolResult, maxBytes int) agentkit.ToolResult
TruncateToolResult truncates oversized tool result content after execution.
Types ¶
type EventData ¶
type EventData struct {
BeforeSeq agentkit.EventSeq `json:"beforeSeq"`
Summary agentkit.ModelMessage `json:"summary"`
Kind string `json:"kind"`
}
type Result ¶
type Result struct {
Applied bool
Event agentkit.SessionEvent
Messages []agentkit.ModelMessage
}
type RetryConfig ¶
type RetryConfig struct {
Enabled *bool `json:"enabled"`
MaxRetries int `json:"maxRetries"`
BaseDelayMs int `json:"baseDelayMs"`
}
RetryConfig controls bounded retries with exponential backoff for compaction LLM calls.
type RetryPolicy ¶
RetryPolicy is the resolved retry configuration.
func ResolveRetrySettings ¶
func ResolveRetrySettings(cfg *RetryConfig) RetryPolicy
ResolveRetrySettings applies defaults aligned with agent-level auto retry.
Click to show internal directories.
Click to hide internal directories.