platform

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 6 Imported by: ? 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 platform implements a deterministic orchestration runtime for conversational workflows driven by structured domain definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateRegistry

func ValidateRegistry(reg *Registry) error

Types

type CandidateBuilder

type CandidateBuilder interface {
	Build(ctx context.Context, input TurnInput, registry *Registry) ([]string, error)
}

type Capability

type Capability struct {
	ID        string
	Scenarios []Scenario
}

type Domain

type Domain struct {
	ID               string
	Aliases          []string
	Examples         []string
	NegativeExamples []string
	Capabilities     map[string]Capability
	Relationships    []Relationship
}

type Gate

type Gate interface {
	Name() string
	Evaluate(ctx context.Context, input TurnInput) (GateResult, error)
}

type GateResult

type GateResult struct {
	Blocked     bool
	ForcedTasks []TaskRequest
	Signals     []string
}

type Interpreter

type Interpreter interface {
	Interpret(ctx context.Context, input InterpreterInput) (InterpreterOutput, error)
}

type InterpreterInput

type InterpreterInput struct {
	Message          string
	CandidateDomains []string
	State            string
	Context          map[string]any
}

type InterpreterOutput

type InterpreterOutput struct {
	Tasks            []TaskRequest
	PrimaryTaskIndex int
	FillerTemplateID string
}

type Registry

type Registry struct {
	InitialState string
	Domains      map[string]Domain
	Templates    map[string]Template
	StateMachine StateMachine
}

type Relationship

type Relationship struct {
	Type   string
	Target string
}

type RenderedResponse

type RenderedResponse struct {
	TaskID      string
	TemplateID  string
	Text        string
	Variables   map[string]any
	ToolSignals []string
}

type Renderer

type Renderer interface {
	Render(t Template, vars map[string]any) (string, error)
}

type Runtime

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

func New

func New(registry *Registry, candidateBuilder CandidateBuilder, interpreter Interpreter, renderer Renderer) (*Runtime, error)

func (*Runtime) Run

func (r *Runtime) Run(ctx context.Context, input TurnInput) (TurnOutput, error)

func (*Runtime) WithGates

func (r *Runtime) WithGates(gates ...Gate) *Runtime

func (*Runtime) WithIDFactory

func (r *Runtime) WithIDFactory(fn func(prefix string, index int) string) *Runtime

func (*Runtime) WithTool

func (r *Runtime) WithTool(id string, tool Tool) *Runtime

type Scenario

type Scenario struct {
	ID               string
	AllowedStates    []string
	RequiredContext  map[string]string
	ToolID           string
	NextState        string
	ResponseTemplate string
}

type StateDefinition

type StateDefinition struct {
	AllowedDomains []string
	Transitions    []string
}

type StateMachine

type StateMachine struct {
	States map[string]StateDefinition
}

type Task

type Task struct {
	ID         string
	DomainID   string
	Capability string
	Status     TaskStatus
}

type TaskRequest

type TaskRequest struct {
	DomainID   string
	Capability string
}

type TaskStatus

type TaskStatus string
const (
	TaskPending   TaskStatus = "pending"
	TaskActive    TaskStatus = "active"
	TaskCompleted TaskStatus = "completed"
	TaskCancelled TaskStatus = "cancelled"
)

type Template

type Template struct {
	ID       string
	Locale   string
	Text     string
	Approved bool
}

type TemplateRenderer

type TemplateRenderer struct{}

func (TemplateRenderer) Render

func (TemplateRenderer) Render(t Template, vars map[string]any) (string, error)

type Tool

type Tool interface {
	Execute(ctx context.Context, call ToolCall) (ToolResult, error)
}

type ToolCall

type ToolCall struct {
	SessionID string
	State     string
	Task      Task
	Input     TurnInput
	Scenario  Scenario
}

type ToolResult

type ToolResult struct {
	Variables map[string]any
	Signals   []string
}

type Trace

type Trace struct {
	Steps []TraceStep
}

type TraceStep

type TraceStep struct {
	Name    string
	Details map[string]any
}

type TurnInput

type TurnInput struct {
	SessionID string
	Message   string
	State     string
	Context   map[string]any
}

type TurnOutput

type TurnOutput struct {
	SessionID string
	State     string
	Queue     []Task
	Responses []RenderedResponse
	Trace     Trace
}

Jump to

Keyboard shortcuts

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