mock

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: GPL-3.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register()

Register installs a fresh mock provider under the name "mock" in the global registry. Tests that drive the CLI through config-driven provider lookup (Phase 5+) call this; production code never imports this package.

Types

type Provider

type Provider struct {
	NameValue        string
	DefaultModelName string
	Window           int
	PricingValue     provider.Pricing

	ResponseContent string
	ChunkCount      int
	Latency         time.Duration

	InputTokens  int
	OutputTokens int
	CachedInput  int

	// Error injection
	ReviewErr      error
	StreamErr      error
	StreamErrAfter int // 0: synchronous (returned from ReviewStream); >0: emit EventError after N delta events
	TestConnErr    error

	// Call telemetry
	ReviewCalls int
	StreamCalls int
	TestCalls   int
	LastRequest provider.Request
	// contains filtered or unexported fields
}

func New

func New() *Provider

func (*Provider) ContextWindow

func (m *Provider) ContextWindow(string) int

func (*Provider) DefaultModel

func (m *Provider) DefaultModel() string

func (*Provider) EstimateTokens

func (m *Provider) EstimateTokens(s string) int

func (*Provider) Name

func (m *Provider) Name() string

func (*Provider) Pricing

func (m *Provider) Pricing(string) provider.Pricing

func (*Provider) Review

func (m *Provider) Review(ctx context.Context, req provider.Request) (provider.Response, error)

func (*Provider) ReviewStream

func (m *Provider) ReviewStream(ctx context.Context, req provider.Request) (<-chan provider.Event, error)

func (*Provider) TestConnection

func (m *Provider) TestConnection(ctx context.Context) error

Jump to

Keyboard shortcuts

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