Documentation
¶
Overview ¶
Package scripted is a scripted model for the tests that run a real agent: a Streamer that answers each request with the next of its steps, built on the emitter, offline and deterministic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model answers request i with step i, and fails a request past the last. It also keeps the requests it saw.
func (*Model) CreateStream ¶
func (m *Model) CreateStream(ctx context.Context, req openresponses.Request, sink openresponses.EventSink) error
CreateStream implements openresponses.Streamer.
func (*Model) Requests ¶
func (m *Model) Requests() []openresponses.Request
Requests returns the requests the model has received.
type Step ¶
type Step func(ctx context.Context, em *openresponses.Emitter) error
Step is one model response.
func SayThenBlock ¶
SayThenBlock streams one chunk and then waits for the request's context to end, as a model that never finishes does.
Click to show internal directories.
Click to hide internal directories.