Help us shape the future of Go! Take the 2026 Go Developer Survey

jevtest

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Package jevtest supplies a fake Jev provider for tests. No test reaches a real model.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockUntilDone

func BlockUntilDone(ctx context.Context) error

BlockUntilDone waits for the request's context to end, as an interrupted request does.

func Choice

func Choice(choice string, p, confidence float64, others ...string) systemone.Answer

Choice is a Choice answer that selects choice with probability p and spreads the rest evenly over others.

func Noul

func Noul(p float64) systemone.Answer

Noul is a Noul answer.

func Score added in v1.0.3

func Score(score, confidence float64, probabilities ...float64) systemone.Answer

Score is a Score answer at score with probabilities over the levels, lowest first.

Types

type Provider

type Provider struct {
	Results []Result
	Wait    func(context.Context) error
	// contains filtered or unexported fields
}

Provider returns its scripted results in order and repeats the last one. Wait, when set, runs before each result and may block until the request's context ends, returning its error.

func (*Provider) Evaluate

func (*Provider) Factory

func (p *Provider) Factory() func(jev.Settings, string) jev.Provider

Factory returns a jev.Judge provider factory that always returns p.

func (*Provider) Requests

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

Requests returns every request received.

type Result

type Result struct {
	Response systemone.Response
	Err      error
}

Result is one scripted provider result: a response, or an error.

Jump to

Keyboard shortcuts

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