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

jev

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Overview

Package jev defines the typed decision boundary used by lintpal.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRequest = errors.New("invalid Jev request")
View Source
var ErrInvalidResponse = errors.New("invalid Jev response")

Functions

func ValidateRequest

func ValidateRequest(request Request) error

ValidateRequest checks the native contract without exposing state or question text in errors.

func ValidateResponse

func ValidateResponse(request Request, response Response) error

ValidateResponse rejects partial or inconsistent decisions before policy uses them.

Types

type Answer

type Answer interface {
	// contains filtered or unexported methods
}

type ChoiceAnswer

type ChoiceAnswer struct {
	Choice        string
	Probabilities map[string]float64
	Confidence    float64
}

type ChoiceQuestion

type ChoiceQuestion struct {
	Instructions string
	Criteria     map[string]string
}

type NoulAnswer

type NoulAnswer struct {
	Probability float64
}

type NoulCriteria

type NoulCriteria struct {
	True  string
	False string
}

NoulCriteria optionally describes the two ends of a yes/no answer.

type NoulQuestion

type NoulQuestion struct {
	Instructions string
	Criteria     *NoulCriteria
}

type Provider

type Provider interface {
	Evaluate(context.Context, Request) (Response, error)
}

Provider evaluates typed questions against one state.

type Question

type Question interface {
	// contains filtered or unexported methods
}

Question is one of the supported Jev decision primitives.

type Request

type Request struct {
	Model     string
	State     any
	Questions map[string]Question
}

Request is independent of the provider's wire format.

type Response

type Response struct {
	Model   string
	Answers map[string]Answer
	Usage   Usage
}

Response carries decisions and optional usage metadata.

type ScoreAnswer

type ScoreAnswer struct {
	Score         float64
	Legend        map[string]string
	Probabilities map[string]float64
	Confidence    float64
}

type ScoreQuestion

type ScoreQuestion struct {
	Instructions string
	Criteria     []string
}

type Usage

type Usage struct {
	InputTokens  int
	OutputTokens int
	CostUSD      *float64
}

Jump to

Keyboard shortcuts

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