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

jevrouter

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package jevrouter adapts Typesafe System One decisions to Mecatl's delegated-model router.

Index

Constants

View Source
const (
	// DefaultModel is the pinned Jev classifier model used when no model is configured.
	DefaultModel = "jev-1.13.0"
	// DefaultMaximumInputBytes is the rendered-request limit used when no limit is configured.
	DefaultMaximumInputBytes = 16 * 1024
	// HardMaximumInputBytes is the immutable defense-in-depth request ceiling.
	HardMaximumInputBytes = 64 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name        string
	Description string
}

Category is one trusted operator-authored classification choice.

type MissKind

type MissKind uint8

MissKind is the adapter-local mechanism result for a failed classification. Composition translates every nonzero value to the engine's common router outcome taxonomy.

const (

	// MissClassifierError identifies an unclassified transport or SDK failure.
	MissClassifierError MissKind
	// MissBadVerdict identifies an invalid response protocol.
	MissBadVerdict
	// MissUnknownCategory identifies a structured offered-set violation.
	MissUnknownCategory
	// MissLowConfidence identifies a valid choice below the configured threshold.
	MissLowConfidence
	// MissInputOverLimit identifies a locally rejected input bound.
	MissInputOverLimit
	// MissCapacityTimeout identifies an expired queue wait while the caller remained active.
	MissCapacityTimeout
	// MissCancelled identifies observed caller cancellation.
	MissCancelled
	// MissTimeout identifies an observed caller, request, or SDK deadline.
	MissTimeout
)

type Options

type Options struct {
	APIKey            string
	Model             string
	BaseURL           string
	DefaultCategory   string
	MinimumConfidence float64
	MaximumInputBytes int
	HTTPClient        *http.Client
}

Options configures one Build-owned Jev router.

type Result

type Result struct {
	Category   string
	Confidence *float64
	Usage      session.Usage
	Miss       MissKind
	OK         bool
}

Result is one adapter-local classification outcome. A validated category and confidence remain present when the configured confidence threshold rejects the candidate.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router owns one concurrent-safe SDK client and one bounded request semaphore.

func New

func New(opts Options) (*Router, error)

New constructs a router without performing network I/O.

func (*Router) Model

func (r *Router) Model() string

Model returns the configured/defaulted classifier model identifier.

func (*Router) Route

func (r *Router) Route(ctx context.Context, task string, categories []Category) Result

Route makes exactly one bounded classification attempt and preserves candidate evidence.

Jump to

Keyboard shortcuts

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