conform

package
v0.1.2 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: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EffortOff  = "off"
	EffortLow  = "low"
	EffortHigh = "high"
	EffortMax  = "max"
)
View Source
const (
	KindText     = "text"
	KindThinking = "thinking"
	KindSummary  = "summary"
	KindTool     = "tool"
	KindOpaque   = "opaque"
)
View Source
const (
	UsageInput  = 11
	UsageOutput = 7
)
View Source
const ChoiceNamed api.ToolChoice = "lookup"
View Source
const ProbeEntry = "tools"

Variables

This section is empty.

Functions

func CheckGrammar

func CheckGrammar(t testing.TB, events []api.Event)

func CheckUnframed

func CheckUnframed(t testing.TB, events []api.Event)

func Describe

func Describe(e api.Event) string

func DescribeAll

func DescribeAll(events []api.Event) []string

func Run

func Run(t *testing.T, a Adapter)

Types

type Accept

type Accept struct {
	At     string
	Also   any
	Source string
}

type Adapter

type Adapter struct {
	Name     string
	Models   []api.Model
	New      func(base string, m api.Model, p Params) (api.Provider, error)
	Wire     map[string]string
	Spec     Spec
	Render   func(m api.Model, s Script) (string, bool)
	Errors   []ErrorCase
	Rules    []Rule
	Sampling bool
	Signed   bool
	Unframed bool
	Live     Live
}

type Block

type Block struct {
	Kind      string
	Text      string
	Signature string
	ID        string
	Name      string
	Args      string
}

type Entry

type Entry struct {
	Name    string
	Request api.Request
}

func Corpus

func Corpus(model string) []Entry

type ErrorCase

type ErrorCase struct {
	Name   string
	Status int
	Header http.Header
	Body   string
	Stream string
	Want   api.ErrCode
	Schema bool
	Source string
}

type Live

type Live struct {
	Env    string
	Model  api.Model
	Params Params
	Base   string
	Count  string
	Strip  []string
	Auth   func(r *http.Request, key string)
}

type Outcome

type Outcome int
const (
	Send Outcome = iota
	RefuseLocal
	Remote
	RefuseNew
)

func (Outcome) String

func (o Outcome) String() string

type Params

type Params struct {
	Effort      string
	Choice      api.ToolChoice
	Temperature float64
	TopP        float64
	MaxTokens   int
	Key         string
}

func Matrix

func Matrix(ceiling int, withSampling bool) []Params

func (Params) Forced

func (p Params) Forced() bool

func (Params) Sampling

func (p Params) Sampling() bool

func (Params) String

func (p Params) String() string

func (Params) Thinking

func (p Params) Thinking() bool

type Rule

type Rule struct {
	Model  string
	Entry  string
	When   func(Params) bool
	Want   Outcome
	Carry  map[string]any
	Omit   []string
	Bug    string
	Source string
}

type Script

type Script struct {
	Name   string
	Blocks []Block
	Stop   api.ErrCode
}

func Scripts

func Scripts() []Script

type Spec

type Spec struct {
	File         string
	Request      string
	Count        string
	Event        string
	Error        string
	Version      string
	Private      []string
	EventPrivate []string
	Defaults     map[string]any
	LooseOneOf   bool
	Accept       []Accept
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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