Documentation
¶
Overview ¶
Package testkit holds the Agent-free test doubles the root package's tests use, exported so a test in a package ABOVE the root (such as tools_test) can script a provider the same way. It imports core and schema only; a helper that constructed an Agent would import the root, and the root's own internal tests could not then import it.
Index ¶
Constants ¶
const TestAPI core.API = "test-api"
TestAPI is the wire API every scripted provider registers under.
Variables ¶
This section is empty.
Functions ¶
func AssistantWithTools ¶
func AssistantWithTools(reason core.StopReason, blocks ...core.ContentBlock) core.AssistantMessage
AssistantWithTools is an assistant message carrying the given blocks.
Types ¶
type Scripted ¶
type Scripted struct {
Turns []core.AssistantMessage
// Seen records the message list each turn was asked to complete, so a
// test can assert what the loop actually sent and when.
Seen []core.Messages
// Systems records the assembled system prompt per turn.
Systems [][]core.ContentBlock
// contains filtered or unexported fields
}
Scripted is a provider that replays a predetermined sequence of assistant messages, one per turn, and answers "done" once the script is exhausted. It is the executable double the loop is tested against; provider/faux is the shipped, supported form of the same idea.