Documentation
¶
Index ¶
- type Client
- type Result
- type Runner
- func (r *Runner) AssertResponded(t *testing.T)
- func (r *Runner) AssertStep(t *testing.T, resp runner.ChatResponse, err error)
- func (r *Runner) Load(script string) (types.Program, error)
- func (r *Runner) RespondWith(result ...Result)
- func (r *Runner) Run(script, input string) (string, error)
- func (r *Runner) RunDefault() string
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)
type Result ¶
type Result struct {
Text string
Func types.CompletionFunctionCall
Content []types.ContentPart
Err error
}
type Runner ¶
func NewRunner ¶
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 (*Runner) AssertStep ¶
func (*Runner) RespondWith ¶
func (*Runner) RunDefault ¶
Click to show internal directories.
Click to hide internal directories.