Help us shape the future of Go! Take the 2026 Go Developer Survey

tester

package
v0.9.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// OnCall, when set, sees every request sent to the model.
	OnCall func(types.CompletionRequest)
	// contains filtered or unexported fields
}

func (*Client) Call

func (c *Client) Call(_ context.Context, messageRequest types.CompletionRequest, _ []string, _ chan<- types.CompletionStatus) (resp *types.CompletionMessage, respErr error)

func (*Client) ProxyInfo

func (c *Client) ProxyInfo([]string) (string, string, error)

type Result

type Result struct {
	Text    string
	Func    types.CompletionFunctionCall
	Content []types.ContentPart
	Err     error
}

type Runner

type Runner struct {
	*runner.Runner

	Client       *Client
	StepAsserted int
}

func NewRunner

func NewRunner(t *testing.T, opts ...runner.Options) *Runner

NewRunner returns a runner backed by a scripted model client. Options, when given, are applied on top of the test defaults.

func (*Runner) AssertResponded

func (r *Runner) AssertResponded(t *testing.T)

func (*Runner) AssertStep

func (r *Runner) AssertStep(t *testing.T, resp runner.ChatResponse, err error)

func (*Runner) Load

func (r *Runner) Load(script string) (types.Program, error)

func (*Runner) RespondWith

func (r *Runner) RespondWith(result ...Result)

func (*Runner) Run

func (r *Runner) Run(script, input string) (string, error)

func (*Runner) RunDefault

func (r *Runner) RunDefault() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL