core

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package core provides core loop types and interfaces for REAL/VEAL loop patterns.

Index

Constants

View Source
const (
	LoopREAL = multiagentspec.LoopREAL
	LoopVEAL = multiagentspec.LoopVEAL
)

Loop type constants.

View Source
const (
	CheckTypeCommand = multiagentspec.CheckTypeCommand
	CheckTypePattern = multiagentspec.CheckTypePattern
	CheckTypeFile    = multiagentspec.CheckTypeFile
	CheckTypeManual  = multiagentspec.CheckTypeManual
)

Check type constants.

View Source
const (
	EscalationHuman    = multiagentspec.EscalationHuman
	EscalationAbort    = multiagentspec.EscalationAbort
	EscalationContinue = multiagentspec.EscalationContinue
	EscalationFallback = multiagentspec.EscalationFallback
)

Escalation policy constants.

Variables

This section is empty.

Functions

func AgentsFromLoop

func AgentsFromLoop(loop *Loop) []string

AgentsFromLoop returns the agent names involved in a loop.

func EnrichAgentWithLoop

func EnrichAgentWithLoop(agent *multiagentspec.Agent, loop *Loop, role string) *multiagentspec.Agent

EnrichAgentWithLoop adds loop participation instructions to an agent.

func GenerateCoordinatorInstructions

func GenerateCoordinatorInstructions(loops []*Loop) string

GenerateCoordinatorInstructions generates instructions for a loop coordinator. This is used when a coordinator agent orchestrates multiple loops.

func GenerateLoopInstructions

func GenerateLoopInstructions(loop *Loop, role string) string

GenerateLoopInstructions generates loop-aware instructions for an agent. This is appended to the agent's existing instructions when it participates in a loop.

Types

type CheckType

type CheckType = multiagentspec.CheckType

CheckType is how a check is executed.

type EscalationPolicy

type EscalationPolicy = multiagentspec.EscalationPolicy

EscalationPolicy defines what to do when max attempts are reached.

type Loop

type Loop = multiagentspec.Loop

Loop is the canonical loop type from multi-agent-spec.

func LoadLoopFromFile

func LoadLoopFromFile(path string) (*Loop, error)

LoadLoopFromFile loads a loop from a JSON or YAML file.

func LoadLoopsFromDir

func LoadLoopsFromDir(dir string) ([]*Loop, error)

LoadLoopsFromDir loads all loops from a directory.

func NewLoop

func NewLoop(name string, loopType LoopType) *Loop

NewLoop creates a new loop with the given name and type.

func NewREALLoop

func NewREALLoop(name, actor, mission string) *Loop

NewREALLoop creates a new REAL loop with actor agent and mission.

func NewVEALLoop

func NewVEALLoop(name, validator, actor string) *Loop

NewVEALLoop creates a new VEAL loop with validator and actor agents.

type LoopAgentConfig

type LoopAgentConfig struct {
	// IncludeLoopInstructions adds loop-specific instructions to agents.
	IncludeLoopInstructions bool

	// ValidatorSuffix is appended to validator agent instructions.
	ValidatorSuffix string

	// ActorSuffix is appended to actor agent instructions.
	ActorSuffix string
}

LoopAgentConfig describes how to generate agents from a loop.

func DefaultLoopAgentConfig

func DefaultLoopAgentConfig() *LoopAgentConfig

DefaultLoopAgentConfig returns the default configuration.

type LoopCheck

type LoopCheck = multiagentspec.LoopCheck

LoopCheck is a validation check within a loop.

type LoopSet

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

LoopSet is a collection of loops indexed by name.

func LoadLoopSet

func LoadLoopSet(dir string) (*LoopSet, error)

LoadLoopSet loads a LoopSet from a directory.

func NewLoopSet

func NewLoopSet() *LoopSet

NewLoopSet creates a new empty LoopSet.

func (*LoopSet) Add

func (ls *LoopSet) Add(loop *Loop)

Add adds a loop to the set.

func (*LoopSet) All

func (ls *LoopSet) All() []*Loop

All returns all loops in the set.

func (*LoopSet) Get

func (ls *LoopSet) Get(name string) (*Loop, bool)

Get returns a loop by name.

func (*LoopSet) Len

func (ls *LoopSet) Len() int

Len returns the number of loops.

func (*LoopSet) Names

func (ls *LoopSet) Names() []string

Names returns all loop names.

func (*LoopSet) REALLoops

func (ls *LoopSet) REALLoops() []*Loop

REALLoops returns all REAL loops.

func (*LoopSet) VEALLoops

func (ls *LoopSet) VEALLoops() []*Loop

VEALLoops returns all VEAL loops.

type LoopType

type LoopType = multiagentspec.LoopType

LoopType is the loop execution pattern.

Jump to

Keyboard shortcuts

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