mockplugin

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package mockplugin owns deterministic Lua plugin fixtures for Go tests.

Each builder returns one small source with a distinct type key, one model card per capability, and no network use. Tests install a fixture with Install, create a provider instance for its type key, and route by provider ID plus Fixture.Models entry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct {
	PluginName string
	TypeKey    string
	Models     []string
	Handlers   []string
	Source     string
}

Fixture is one deterministic Lua plugin source: its type key, the bare model names its get_model_infos declares, the handlers it implements, and the source itself.

func All

func All() []Fixture

All returns every builder for install coverage.

func Chat

func Chat() Fixture

Chat serves one chat model with a fixed completion.

func ChatOnly

func ChatOnly() Fixture

ChatOnly serves one chat-only model with no other handlers.

func Denied

func Denied() Fixture

Denied serves one chat model reporting an authentication failure.

func Embeddings

func Embeddings() Fixture

Embeddings serves one embeddings model returning one vector per input.

func Image

func Image() Fixture

Image serves one image model honoring url and b64_json formats.

func Limited

func Limited() Fixture

Limited serves one chat model reporting quota exhaustion on every call.

func Speech

func Speech() Fixture

Speech serves one speech model returning fixed WAV bytes.

func Stream

func Stream() Fixture

Stream serves one chat model emitting two chunks per stream.

func Tools

func Tools() Fixture

Tools serves one chat model echoing the first requested tool call.

func Transcribe

func Transcribe() Fixture

Transcribe serves one transcription model with text plus segments.

func Video

func Video() Fixture

Video serves one video model completing the job at submit time.

func VideoPending

func VideoPending() Fixture

VideoPending serves one video model pending at submit, completed on poll.

func (Fixture) ModelID

func (fixture Fixture) ModelID(providerID string) string

ModelID builds the provider/model id for the fixture's first model.

Jump to

Keyboard shortcuts

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