domain

package
v0.243.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Name        string
	Type        QuestionType
	Probability float64
	Choice      string
}

Answer is the decision model's answer to one question. Probability holds a predicate's p(true), Choice a choice's pick.

type Decider

type Decider interface {
	Decide(ctx context.Context, model string, evidence string, questions []Question) (Decisions, error)
}

Decider answers typed questions about shared evidence with native probabilities. model is the "provider/model" id of the decision model.

type Decisions

type Decisions struct {
	Answers     []Answer
	InputTokens int
}

Decisions is the answer set of one request plus the input tokens it cost.

func (Decisions) ByName

func (d Decisions) ByName(name string) (Answer, bool)

ByName returns the answer named name and whether it was given.

type Option

type Option struct {
	Value       string
	Description string
}

Option is one answer of a choice question.

type Question

type Question struct {
	Name         string
	Type         QuestionType
	Instructions string
	Choices      []Option
}

Question is one typed question asked about shared evidence. Name identifies its answer. Choices apply to Choice questions only.

type QuestionType

type QuestionType string

QuestionType is the kind of answer a question asks for.

const (
	Predicate QuestionType = "predicate"
	Choice    QuestionType = "choice"
)

Question kinds: a predicate answers with one probability, a choice picks one option.

Jump to

Keyboard shortcuts

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