decision

package
v1.261203.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: MPL-2.0 Imports: 8 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

Overview

Package decision identifies and converts supported decision wire formats and resolves known provider endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversion

type Conversion struct {
	From      Dialect
	Questions []question
}

func ConvertRequest

func ConvertRequest(body []byte, from, to Dialect) ([]byte, *Conversion, error)

ConvertRequest converts the explicitly supported common subset. The context retains question order and original names for response reconstruction.

func (*Conversion) ConvertResponse

func (c *Conversion) ConvertResponse(body []byte) ([]byte, error)

ConvertResponse converts answers, refusing missing or invalid data rather than inventing confidence, probability or score values.

type Dialect

type Dialect string
const (
	Unknown   Dialect = "unknown"
	OpenAI    Dialect = "openai_decisions"
	SystemOne Dialect = "systemone"
)

func Request

func Request(body []byte) (Dialect, error)

Request recognizes the two published shapes. Unknown permits legacy opaque /decisions payloads with no distinguishing fields; callers decide whether that fallback is appropriate for their endpoint.

func Response

func Response(body []byte) Dialect

Response recognizes answer containers without imposing a provider schema.

type Target

type Target struct {
	Dialect  Dialect
	BasePath string
	Endpoint string
}

func ResolveTarget

func ResolveTarget(base string) Target

ResolveTarget uses exact, known official hosts. Unknown providers stay opaque.

Jump to

Keyboard shortcuts

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