Documentation
¶
Overview ¶
Package llmtest provides public test helpers for the llm package.
StubClient is a scriptable llm.Client. Each Stream call consumes one TurnScript; the agent loop tests script multi-turn conversations as a slice of TurnScripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStubExhausted = errors.New("aikido/llmtest: stub client: script exhausted")
ErrStubExhausted is returned by Stream when no scripts remain.
Functions ¶
This section is empty.
Types ¶
type StubClient ¶
type StubClient struct {
// contains filtered or unexported fields
}
StubClient is a scriptable llm.Client.
func NewStubClient ¶
func NewStubClient(turns ...TurnScript) *StubClient
NewStubClient returns a StubClient that plays the given turn scripts in order.
func (*StubClient) Requests ¶
func (s *StubClient) Requests() []llm.Request
Requests returns a snapshot of every llm.Request the stub has been called with, in order. Useful for assertion in tests.
type TurnScript ¶
type TurnScript struct {
Events []llm.Event
// Block, if non-nil, causes Stream's producer to block on receive from this
// channel before emitting any events. Closing it (or context cancellation)
// unblocks the goroutine. Useful for timeout tests.
Block <-chan struct{}
}
TurnScript is the events the stub emits for one Stream call.
Click to show internal directories.
Click to hide internal directories.