formdefaults

package
v0.0.60 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeOutputMap

func NormalizeOutputMap(opInput map[string]interface{}, opOutput map[string]interface{}) (map[string]interface{}, error)

NormalizeOutputMap accepts the normalized input-op invocation map and the op output map, then returns a canonical input Output map.

func ValidationOutputMap added in v0.0.13

func ValidationOutputMap(opInput map[string]interface{}) (map[string]interface{}, bool)

ValidationOutputMap synthesizes an input output for semantic validation. It preserves the normal output shape while marking required fields as present so validation can proceed without a submitted human response.

Types

type Config

type Config struct {
	Question   string
	Type       string
	Default    interface{}
	HasDefault bool
	ScaleMin   int
	HasScale   bool
	Fields     []Field
}

type Field

type Field struct {
	ID         string
	Type       string
	Required   bool
	Default    interface{}
	HasDefault bool
	ScaleMin   int
	HasScale   bool
}

type MissingRequiredFieldError added in v0.0.57

type MissingRequiredFieldError struct{ FieldID string }

MissingRequiredFieldError identifies an unanswered required question.

func (*MissingRequiredFieldError) Error added in v0.0.57

func (e *MissingRequiredFieldError) Error() string

type Output

type Output struct {
	Response        interface{}
	ResponsePresent bool
	Fields          map[string]interface{}
	UserID          string
	Metadata        map[string]interface{}
}

func NormalizeOutput

func NormalizeOutput(form Config, out Output) (Output, error)

Jump to

Keyboard shortcuts

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