responder

package
v0.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package responder implements an LLM-backed surrogate user that answers an interactive skill's follow-up questions during a multi-turn evaluation run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Classifier

type Classifier struct {
	// contains filtered or unexported fields
}

Classifier maintains a persistent surrogate-user session and classifies each agent message into a Decision.

func New

func New(exec Executor, cfg models.ResponderConfig, defaultModel string) *Classifier

New constructs a Classifier. defaultModel is used when cfg.Model is empty.

func (*Classifier) Classify

func (c *Classifier) Classify(ctx context.Context, agentMessage string) (Decision, error)

Classify sends the agent's latest message to the responder LLM and returns its decision. The first call seeds the session with the responder instructions; subsequent calls resume the same session.

func (*Classifier) Close

func (c *Classifier) Close(ctx context.Context) error

Close tears down the persistent responder session if one was created. It is safe to call multiple times and is a no-op when the underlying executor does not support explicit session deletion.

type Decision

type Decision struct {
	Kind   DecisionKind
	Answer string // set when Kind == DecisionReply
	Reason string // set when Kind == DecisionAbstain
}

Decision is the outcome of classifying a single agent message.

type DecisionKind

type DecisionKind int

DecisionKind enumerates the responder's possible classifications of an agent message.

const (
	// DecisionReply means the responder answered the agent's question.
	DecisionReply DecisionKind = iota
	// DecisionStop means the agent is done and no further input is needed.
	DecisionStop
	// DecisionAbstain means the responder could not answer from its brief.
	DecisionAbstain
)

type Executor

type Executor interface {
	Execute(ctx context.Context, req *execution.ExecutionRequest) (*execution.ExecutionResponse, error)
}

Executor is the narrow execution surface the responder needs. The concrete AgentEngine satisfies it, and tests supply a fake.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL