models

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlacementSourceAuto   = "auto"
	PlacementSourceManual = "manual"
)

Placement source values attached to accepted placement instances.

View Source
const (
	RunStatusCompleted       = "completed"
	RunStatusPartial         = "partial"
	RunStatusBudgetExhausted = "budget_exhausted"
	RunStatusTimedOut        = "timed_out"
	RunStatusFailed          = "failed"
)
View Source
const (
	RunReasonResolvedAll       = "resolved_all"
	RunReasonUnresolvedFields  = "unresolved_fields"
	RunReasonBudgetExhausted   = "budget_exhausted"
	RunReasonTimedOut          = "timed_out"
	RunReasonResolverError     = "resolver_error"
	RunReasonResolverShortStop = "resolver_short_circuit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Estimate

type Estimate struct {
	ResolverID string
	Accuracy   float64
	Cost       float64
	Latency    float64
	Supported  bool
	Reason     string
}

Estimate captures pre-execution resolver quality/cost/latency estimates.

type ExecutionLimits

type ExecutionLimits struct {
	MaxBudget float64
	MaxTime   time.Duration
}

ExecutionLimits controls max budget/time constraints for a run.

type ExistingPlacement

type ExistingPlacement struct {
	FieldDefinitionID string
	Geometry          Geometry
}

ExistingPlacement represents already-authored field placements.

type FieldDefinition

type FieldDefinition struct {
	ID            string
	ParticipantID string
	FieldType     string
	Label         string
	Required      bool
}

FieldDefinition is a logical definition input for placement suggestions.

type Geometry

type Geometry struct {
	PageNumber int
	X          float64
	Y          float64
	Width      float64
	Height     float64
}

Geometry captures canonical page-space placement coordinates.

type NativeFormField

type NativeFormField struct {
	Name          string
	FieldTypeHint string
	Geometry      Geometry
}

NativeFormField represents an extracted native form field from a PDF source.

type Policy

type Policy struct {
	EnabledResolvers []string
	HardOrder        []string
	Weights          ScoringWeights
	Limits           ExecutionLimits
}

Policy is the effective placement policy applied to a run.

type ResolveResult

type ResolveResult struct {
	Suggestions             []Suggestion
	UnresolvedDefinitionIDs []string
	Terminate               bool
	TerminationReason       string
}

ResolveResult captures resolver output and optional short-circuit directives.

type ResolverScore

type ResolverScore struct {
	ResolverID string
	Accuracy   float64
	Cost       float64
	Latency    float64
	Score      float64
	Supported  bool
	Reason     string
}

ResolverScore captures final weighted ranking score metadata.

type Run

type Run struct {
	ID                      string
	AgreementID             string
	Status                  string
	ReasonCode              string
	Policy                  Policy
	ResolverOrder           []string
	ExecutedResolvers       []string
	Estimates               []Estimate
	Scores                  []ResolverScore
	Suggestions             []Suggestion
	UnresolvedDefinitionIDs []string
	SelectedSource          string
	BudgetUsed              float64
	Elapsed                 time.Duration
	CreatedByUserID         string
	CreatedAt               time.Time
	CompletedAt             time.Time
}

Run captures full run telemetry and merged suggestions.

type ScoringWeights

type ScoringWeights struct {
	Accuracy float64
	Cost     float64
	Latency  float64
}

ScoringWeights controls weighted utility ranking.

type Suggestion

type Suggestion struct {
	ID                string
	FieldDefinitionID string
	ResolverID        string
	Confidence        float64
	Geometry          Geometry
	Label             string
	Metadata          map[string]any
}

Suggestion captures one candidate placement for a field definition.

func (Suggestion) NormalizedConfidence

func (s Suggestion) NormalizedConfidence() float64

NormalizedConfidence clamps confidence into [0,1].

Jump to

Keyboard shortcuts

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