testkit

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(t *testing.T, r api.ContentToolResult, v any)

func Golden

func Golden(t *testing.T, got []byte)

func IsCompaction

func IsCompaction(req api.Request) bool

func MessageStorage

func MessageStorage(t *testing.T, open func(t *testing.T) api.MessageStorage)

func MessageStorageUsers

func MessageStorageUsers(t *testing.T, open func(t *testing.T) func(user string) api.MessageStorage)

func Results

func Results(req api.Request) []api.ContentToolResult

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(t *testing.T, s Setup) *Controller

func (*Controller) Ask

func (c *Controller) Ask(api.ChatAsk) (func(context.Context), error)

func (*Controller) Config

func (c *Controller) Config() api.ThreadConfig

func (*Controller) Context

func (c *Controller) Context() context.Context

func (*Controller) Ctx

func (c *Controller) Ctx() context.Context

func (*Controller) FS

func (c *Controller) FS() api.FS

func (*Controller) FilesConfig

func (c *Controller) FilesConfig() api.FilesConfig

func (*Controller) ID

func (c *Controller) ID() api.ThreadID

func (*Controller) Model

func (c *Controller) Model() api.Model

func (*Controller) Modules

func (c *Controller) Modules() iter.Seq[common.Module]

func (*Controller) PageContext

func (c *Controller) PageContext() context.Context

func (*Controller) Rename

func (c *Controller) Rename(context.Context, string) error

func (*Controller) Store

func (c *Controller) Store() *local.FileStorage

func (*Controller) Task

func (*Controller) Tasks

func (c *Controller) Tasks() []*Task

type Note

type Note struct {
	Data json.RawMessage
	Meta map[string]any
}

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(model api.Model, turns ...Turn) *Provider

func (*Provider) Model

func (p *Provider) Model() api.Model

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) OnCompaction

func (p *Provider) OnCompaction(turns ...Turn)

func (*Provider) Push

func (p *Provider) Push(turns ...Turn)

func (*Provider) Request

func (p *Provider) Request(t *testing.T, i int) api.Request

func (*Provider) Requests

func (p *Provider) Requests() []api.Request

func (*Provider) Stream

func (p *Provider) Stream(ctx context.Context, req api.Request) <-chan api.Event

type Setup

type Setup struct {
	Model   api.Model
	Files   api.FilesConfig
	Modules []common.Module
}

type Task

type Task struct {
	// contains filtered or unexported fields
}

func (*Task) Err

func (t *Task) Err(error)

func (*Task) ID

func (t *Task) ID() uint

func (*Task) Notify

func (t *Task) Notify(data json.RawMessage, meta map[string]any)

func (*Task) Ok

func (t *Task) Ok(json.RawMessage)

func (*Task) WaitNotes

func (t *Task) WaitNotes(tb testing.TB, n int) []Note

type Turn

type Turn func(ctx context.Context, req api.Request, out chan<- api.Event)

func Call

func Call(name string, args any) Turn

func Events

func Events(events ...api.Event) Turn

func Hang

func Hang(events ...api.Event) Turn

func Say

func Say(text string) Turn

func Then

func Then(f func(req api.Request) Turn) Turn

Directories

Path Synopsis
fetchspec command

Jump to

Keyboard shortcuts

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