Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeEventData ¶
func EncodeEventData(v any) json.RawMessage
func New ¶
New registers agent/coding: Default coding agent: runs one turn against session, LLM, tools and prompt.
Best practices:
- budget.maxContinuations defaults to 0, i.e. one segment: an agent stays request/response until you raise it.
- budget.softRatio (default 0.8) marks the point where a turn-stopping hook should wrap up rather than start new work.
- An interrupted turn is repaired on the next turn, so a crash mid-tool-call does not leave the session unusable.
Types ¶
type BudgetConfig ¶
type BudgetConfig struct {
MaxTotalSteps int `json:"maxTotalSteps"`
MaxContinuations int `json:"maxContinuations"`
WallClockSeconds int `json:"wallClockSeconds"`
MaxTotalTokens int `json:"maxTotalTokens"`
SoftRatio float64 `json:"softRatio"`
}
BudgetConfig bounds one autonomous turn. Every dimension is optional; zero means unlimited for that dimension. MaxContinuations defaults to 0, so an agent without explicit budget config behaves exactly as before: one segment, capped by MaxSteps.
type Config ¶
type Config struct {
// ID is agent id, referenced by loop.defaultAgent.
ID agentkit.AgentID `json:"id"`
// Model is model name passed to the LLM provider.
Model string `json:"model"`
// MaxSteps is steps allowed in one segment.
MaxSteps int `json:"maxSteps"`
// Retry is per-step retry for transient provider failures.
Retry *RetryConfig `json:"retry,omitempty"`
// Budget is hard bounds for a whole turn including its continuations. No hook can extend a turn past these.
Budget *BudgetConfig `json:"budget,omitempty"`
}
type Deps ¶
type Deps struct {
SessionStore agentkit.SessionStore `json:"sessionStore"`
LLM agentkit.LLMProvider `json:"llm"`
Tools agentkit.ToolRuntime `json:"tools"`
Prompt agentkit.PromptAssembler `json:"prompt"`
Policies []agentkit.Policy `json:"policies,omitempty"`
Hooks agentkit.HookRuntime `json:"hooks,omitempty"`
Compaction []compaction.Service `json:"compaction,omitempty"`
}
type RetryConfig ¶
Click to show internal directories.
Click to hide internal directories.