Documentation
¶
Overview ¶
Package testkit provides shared test doubles for harness and server integration tests.
Index ¶
- func AssertStatusMatchesEvent(t testing.TB, rt session.Client, id session.ID, ev session.Event)
- func ContentTokenEstimate(msgs []*message.Message) int
- func CountedHTTPModel(tb testing.TB, ...) tacklr.Model
- func HTTPModel(tb testing.TB, ...) tacklr.Model
- func TextHTTPModel(tb testing.TB, ...) tacklr.Model
- func UncountedHTTPModel(tb testing.TB, ...) tacklr.Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertStatusMatchesEvent ¶ added in v0.5.0
AssertStatusMatchesEvent checks Runtime.Status against a turn-finished stream event. complete → SessionComplete, error → SessionFailed, yield → running+Waiting.
func ContentTokenEstimate ¶
ContentTokenEstimate is a shared length-based token stand-in for pressure tests.
func CountedHTTPModel ¶ added in v0.5.0
func CountedHTTPModel(tb testing.TB, respond func(ctx context.Context, msgs []*message.Message, tools []*tacklr.Tool, ch chan<- tacklr.LLMResponseChunk), count func(msgs []*message.Message) (int, error)) tacklr.Model
CountedHTTPModel is HTTPModel whose provider counts a request's tokens with count. msgs is the request as the provider got it: the system prompt is its first message. The token-count endpoint answers the count, or HTTP 500 when count fails, and each response reports the count as its input tokens.
func HTTPModel ¶ added in v0.4.0
func HTTPModel(tb testing.TB, respond func(ctx context.Context, msgs []*message.Message, tools []*tacklr.Tool, ch chan<- tacklr.LLMResponseChunk)) tacklr.Model
HTTPModel is the real OpenAI-compatible client pointed at a local server. respond sees the conversation the client sent and writes chunks. An error chunk becomes the HTTP error the client classifies. Anything else is SSE.
func TextHTTPModel ¶ added in v0.4.0
func TextHTTPModel(tb testing.TB, respond func(ctx context.Context, msgs []*message.Message, tools []*tacklr.Tool, ch chan<- tacklr.LLMResponseChunk)) tacklr.Model
TextHTTPModel is HTTPModel on a model id that accepts text only.
func UncountedHTTPModel ¶ added in v0.5.0
func UncountedHTTPModel(tb testing.TB, respond func(ctx context.Context, msgs []*message.Message, tools []*tacklr.Tool, ch chan<- tacklr.LLMResponseChunk), count func(msgs []*message.Message) (int, error)) tacklr.Model
UncountedHTTPModel is CountedHTTPModel on a provider with no token-count endpoint (HTTP 404): only each response reports count as its input tokens.
Types ¶
This section is empty.