Documentation
¶
Index ¶
Constants ¶
View Source
const EmptyResponseFallback = "I processed your message but couldn't formulate a visible response. Could you try rephrasing your question?"
EmptyResponseFallback is used only for truly empty successful turns.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
IdleTimeout time.Duration
HardCeiling time.Duration
TraceStore turntrace.Store
// DelegationBudgetMax is the delegation count threshold for budget warnings.
// Zero means use default (15).
DelegationBudgetMax int
}
Config controls runner timeouts and durable trace storage.
type Executor ¶
type Executor interface {
RunStreamingDetailed(
ctx context.Context,
sessionID, input string,
onChunk adk.ChunkCallback,
opts ...adk.RunOption,
) (adk.RunReport, error)
}
Executor is the subset of adk.Agent used by the runner.
type Request ¶
type Request struct {
SessionKey string
Input string
Entrypoint string
OnChunk func(string)
OnWarning func(elapsed, hardCeiling time.Duration)
// OnDelegation is called when a delegation event is observed in the trace.
// from/to are agent names, reason is optional context.
OnDelegation func(from, to, reason string)
// OnBudgetWarning is called when delegation count approaches the threshold.
OnBudgetWarning func(used, max int)
// OnToolCall is called when a tool invocation begins.
OnToolCall func(callID, toolName string, params map[string]any)
// OnToolResult is called when a tool invocation completes.
OnToolResult func(callID, toolName string, success bool, duration time.Duration, preview string)
// OnThinking is called when thinking/reasoning is detected via genai.Part.Thought.
// started=true means thinking began (summary is the thought text);
// started=false means thinking ended.
OnThinking func(agentName string, started bool, summary string)
}
Request is a single turn execution request.
type Result ¶
type Result struct {
ResponseText string
Outcome TurnOutcome
TraceID string
UserMessage string
Elapsed time.Duration
ErrorCode string
CauseClass string
CauseDetail string
OperatorSummary string
Summary string
}
Result is the structured result of a completed turn.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner owns timeout handling, durable tracing, and outcome classification.
func New ¶
func New( cfg Config, executor Executor, sessionStore langosession.Store, sanitizer Sanitizer, ) *Runner
New creates a new turn runner.
func (*Runner) OnTurnComplete ¶
func (r *Runner) OnTurnComplete(cb TurnCallback)
OnTurnComplete registers a callback fired after each completed turn.
type TurnCallback ¶
type TurnCallback func(sessionKey string)
TurnCallback fires after a turn finishes.
type TurnOutcome ¶
TurnOutcome is the shared classification for a completed turn.
Click to show internal directories.
Click to hide internal directories.