decision

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 6 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

View Source
const (
	QuestionChoice = "choice"
	QuestionNoul   = "noul"
	QuestionScore  = "score"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Type          string
	Choice        string
	Probabilities map[string]float64
	Confidence    float64
	Noul          float64
	Score         float64
	Legend        map[string]string
}

type Evaluator

type Evaluator interface {
	ID() string
	Evaluate(ctx context.Context, req Request) (Response, error)
}

type Model

type Model struct {
	ID   string `yaml:"id"`
	Name string `yaml:"name"`
}

type Provider

type Provider struct {
	ID     string  `yaml:"id"`
	Name   string  `yaml:"name"`
	Models []Model `yaml:"models"`
}

type ProviderFactory

type ProviderFactory interface {
	ID() string
	New(rawConfig json.RawMessage) (Evaluator, error)
}

type Question

type Question struct {
	Type         string
	Instructions any
	Criteria     any
}

type Registry

type Registry struct {
	Providers []Provider `yaml:"providers"`
	// contains filtered or unexported fields
}

func Load

func Load(factories ...ProviderFactory) (*Registry, error)

Load reads the supported decision-provider and model catalog. Factories are matched to catalog providers so unsupported provider IDs cannot be constructed.

func (*Registry) GetModel

func (r *Registry) GetModel(providerID, modelID string) (Model, bool)

func (*Registry) GetProvider

func (r *Registry) GetProvider(id string) (Provider, bool)

func (*Registry) New

func (r *Registry) New(provider string, rawConfig json.RawMessage) (Evaluator, error)

type Request

type Request struct {
	Model     string
	State     json.RawMessage
	Questions map[string]Question
}

type Response

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

type Usage

type Usage struct {
	InputTokens  int
	OutputTokens int
}

Directories

Path Synopsis
Package liquid provides a decision evaluator for Liquid AI's d1 decision models.
Package liquid provides a decision evaluator for Liquid AI's d1 decision models.
tasks

Jump to

Keyboard shortcuts

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