Documentation
¶
Overview ¶
Package runtimetest provides reusable fake runtime backends for dispatcher and Admin contract tests.
Index ¶
- type Backend
- func (b *Backend) Capabilities(_ context.Context, a agent.Agent) (agentruntime.Capabilities, error)
- func (b *Backend) CapabilityCalls() []agent.Agent
- func (b *Backend) RuntimeType() string
- func (b *Backend) ServeTurn(ctx context.Context, a agent.Agent, req agentruntime.TurnRequest, ...) error
- func (b *Backend) SetCapabilities(result agentruntime.Capabilities, err error)
- func (b *Backend) TurnCalls() []TurnCall
- type TurnCall
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
Type string
CapabilitiesResult agentruntime.Capabilities
CapabilitiesError error
ServeTurnError error
ServeTurnFunc func(context.Context, agent.Agent, agentruntime.TurnRequest, agentruntime.EventSink) error
// contains filtered or unexported fields
}
Backend implements only agentruntime.Backend. Tests that need optional capabilities can embed it in a small type implementing the relevant narrow interface, so unsupported capabilities remain truthful.
func NewBackend ¶
func (*Backend) Capabilities ¶
func (b *Backend) Capabilities(_ context.Context, a agent.Agent) (agentruntime.Capabilities, error)
func (*Backend) CapabilityCalls ¶
func (*Backend) RuntimeType ¶
func (*Backend) ServeTurn ¶
func (b *Backend) ServeTurn(ctx context.Context, a agent.Agent, req agentruntime.TurnRequest, emit agentruntime.EventSink) error
func (*Backend) SetCapabilities ¶
func (b *Backend) SetCapabilities(result agentruntime.Capabilities, err error)
SetCapabilities safely replaces the fake result while contract tests are running concurrent calls.
type TurnCall ¶
type TurnCall struct {
Agent agent.Agent
Request agentruntime.TurnRequest
}
Click to show internal directories.
Click to hide internal directories.