Documentation
¶
Index ¶
- type Provider
- func (p *Provider) Generate(context.Context, *api.GenerateRequest) (*api.GenerateResult, error)
- func (p *Provider) Name() string
- func (p *Provider) Stream(ctx context.Context, req *api.GenerateRequest, emit api.StreamFunc) (*api.GenerateResult, error)
- func (p *Provider) WithName(name string) *Provider
- type Step
- type Tool
- type ToolOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider returns scripted responses in order.
func NewProvider ¶
NewProvider creates a deterministic scripted provider.
func (*Provider) Generate ¶
func (p *Provider) Generate(context.Context, *api.GenerateRequest) (*api.GenerateResult, error)
Generate returns the next scripted result.
func (*Provider) Stream ¶
func (p *Provider) Stream(ctx context.Context, req *api.GenerateRequest, emit api.StreamFunc) (*api.GenerateResult, error)
Stream emits scripted streaming events before returning the final scripted result.
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
Step is a deterministic provider script step.
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool is a deterministic test tool with overridable behavior.
func NewTool ¶
func NewTool(name string, options ...ToolOption) *Tool
NewTool creates a mock tool with a default echo-style handler.
func (*Tool) Description ¶
Description returns the tool description.
func (*Tool) Schema ¶
func (t *Tool) Schema() api.ToolSchema
Schema returns a stable, provider-neutral tool schema.
type ToolOption ¶
type ToolOption func(*Tool)
ToolOption customizes the default mock tool.
func WithDescription ¶
func WithDescription(description string) ToolOption
WithDescription overrides the mock tool description.
func WithHandler ¶
func WithHandler(handler func(context.Context, api.ToolCall) (*api.ToolResult, error)) ToolOption
WithHandler overrides the mock tool execution behavior.
func WithSchema ¶
func WithSchema(schema map[string]any) ToolOption
WithSchema overrides the mock tool input schema.