schema

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package schema contains a stateful schema-v2 for Agent. Bootstrapped with am-gen. Edit manually or re-gen & merge.

Package schema contains a stateful schema-v2 for Mem. Bootstrapped with am-gen. Edit manually or re-gen & merge.

Package schema contains a stateful schema-v2 for Tool. Bootstrapped with am-gen. Edit manually or re-gen & merge.

Index

Constants

View Source
const TagManual = "manual"

TagManual is for stories that CANNOT be triggered by the LLM orienting story.

View Source
const TagPrompt = "prompt"

TagPrompt is for states with LLM prompts.

View Source
const TagTrigger = "trigger"

TagTrigger is for stories that can be triggered by the LLM orienting story.

Variables

View Source
var (

	// AgentStates contains all the states for the Agent machine.
	AgentStates = ssA
	// AgentGroups contains all the state groups for the Agent machine.
	AgentGroups = sgA
)
View Source
var (

	// MemStates contains all the states for the Mem machine.
	MemStates = ssM
	// MemGroups contains all the state groups for the Mem machine.
	MemGroups = sgM
)
View Source
var (

	// ToolStates contains all the states for the Tool machine.
	ToolStates = ssT
	// ToolGroups contains all the state groups for the Tool machine.
	ToolGroups = sgT
)
View Source
var AgentSchema = SchemaMerge(

	ssam.BasicSchema,

	ssam.DisposedSchema,

	ssrpc.WorkerSchema,
	am.Schema{

		ssA.ErrLLM: {
			Multi:   true,
			Require: S{Exception},
		},
		ssA.ErrDB: {
			Multi:   true,
			Require: S{Exception},
		},
		ssA.ErrMem: {
			Multi:   true,
			Require: S{Exception},
		},
		ssA.ErrUI: {
			Multi:   true,
			Require: S{ssA.UIMode},
		},

		ssA.Start: {Add: S{ssA.BaseDBStarting}},
		ssA.Ready: {
			Require: S{ssA.Start},
			Add:     S{ssA.Loop},
		},

		ssA.Loop:         {Require: S{ssA.Ready}},
		ssA.InputPending: {Remove: S{ssA.Prompt}},
		ssA.InputBlocked: {Remove: S{ssA.Prompt}},
		ssA.Requesting:   {},
		ssA.RequestingTool: {
			Multi: true,
			Add:   S{ssA.Requesting},
		},
		ssA.RequestingLLM: {
			Multi: true,
			Add:   S{ssA.Requesting},
		},
		ssA.Mock: {},

		ssA.BaseDBStarting: {
			Require: S{ssA.Start},
			Remove:  S{ssA.BaseDBReady},
		},
		ssA.BaseDBReady: {
			Require: S{ssA.Start},
			Remove:  S{ssA.BaseDBStarting},
		},
		ssA.BaseDBSaving: {Multi: true},

		ssA.Prompt: {
			Multi:   true,
			Require: S{ssA.Start},
			Remove:  S{ssA.InputPending},
		},
		ssA.Interrupted: {
			Add:    S{ssA.InputPending},
			Remove: S{ssA.Resume},
		},
		ssA.Resume: {
			Remove: S{ssA.Interrupted},
		},
		ssA.Msg: {
			Multi:   true,
			Require: S{ssA.Start},
		},

		ssA.UIMode:       {},
		ssA.UIReady:      {Require: S{ssA.UIMode}},
		ssA.UIButtonSend: {Require: S{ssA.UIMode}},
		ssA.UIButtonIntt: {Require: S{ssA.UIMode}},
		ssA.UISaveOutput: {Require: S{ssA.UIMode}},
		ssA.UICleanOutput: {
			Multi:   true,
			Require: S{ssA.UIMode},
		},
		ssA.UISessConn: {
			Multi:   true,
			Require: S{ssA.UIMode},
		},
		ssA.UISessDisconn: {
			Multi:   true,
			Require: S{ssA.UIMode},
		},
		ssA.UISrvListening: {Require: S{ssA.UIMode}},
	})

AgentSchema represents all relations and properties of AgentStates.

View Source
var Exception = am.Exception

Exception is a type alias for the exception state.

View Source
var MemSchema = am.Schema{}

MemSchema represents all relations and properties of MemStates.

View Source
var SAdd = am.SAdd

SAdd is a func alias for merging lists of states.

View Source
var SchemaMerge = am.SchemaMerge

SchemaMerge is a func alias for extending an existing state structure.

View Source
var StateAdd = am.StateAdd

StateAdd is a func alias for adding to an existing state definition.

View Source
var StateSet = am.StateSet

StateSet is a func alias for replacing parts of an existing state definition.

View Source
var ToolSchema = SchemaMerge(

	ssam.BasicSchema,

	ssam.DisposedSchema,

	ssrpc.WorkerSchema,
	am.Schema{

		ssT.Working: {
			Require: S{ssT.Ready},
			Remove:  S{ssT.Idle},
		},
		ssT.Idle: {
			Auto:    true,
			Require: S{ssT.Ready},
			Remove:  S{ssT.Working},
		},
	})

ToolSchema represents all relations and properties of ToolStates.

Functions

This section is empty.

Types

type AgentGroupsDef

type AgentGroupsDef struct{}

AgentGroupsDef contains all the state groups Agent state machine.

type AgentStatesDef

type AgentStatesDef struct {
	*am.StatesBase

	ErrLLM string
	ErrDB  string
	ErrMem string
	ErrUI  string

	// Agent is waiting for user input.
	InputPending string
	// User input is blocked by the agent.
	InputBlocked string
	// Agent is currently requesting >=1 tools
	RequestingTool string
	// Agent is currently requesting >=1 LLMs
	RequestingLLM string
	// Requesting implies either RequestingTool or RequestingLLM being active
	Requesting string
	// The machine has been mocked.
	Mock string

	BaseDBStarting string
	BaseDBReady    string
	// BaseDBSaving is lazy query execution.
	BaseDBSaving string

	// Loop is the agent-user loop (eg dialogue).
	Loop string
	// Prompt is the text the user has sent us.
	Prompt string
	// Interrupted is when the user interrupts the agent, until Resume.
	Interrupted string
	// Resume is the signal from the user to resume after an Interrupted.
	Resume string
	// Msg will output the passed text into the UI.
	Msg string

	UIMode  string
	UIReady string
	// UI button "Send" has been pressed
	UIButtonSend string
	// UI button "Interrupt" has been pressed
	UIButtonIntt   string
	UISaveOutput   string
	UICleanOutput  string
	UISessConn     string
	UISessDisconn  string
	UISrvListening string

	// inherit from BasicStatesDef
	*ssam.BasicStatesDef
	// inherit from DisposedStatesDef
	*ssam.DisposedStatesDef
	// inherit from WorkerStatesDef
	*ssrpc.WorkerStatesDef
}

AgentStatesDef contains all the states of the Agent state machine.

type MemGroupsDef added in v0.2.0

type MemGroupsDef struct {
}

MemGroupsDef contains all the state groups Mem state machine.

type MemStatesDef added in v0.2.0

type MemStatesDef struct {
	*am.StatesBase
}

MemStatesDef contains all the states of the Mem state machine.

type S

type S = am.S

S is a type alias for a list of state names.

type State

type State = am.State

State is a type alias for a state definition. See am.State.

type ToolGroupsDef

type ToolGroupsDef struct {
}

ToolGroupsDef contains all the state groups Tool state machine.

type ToolStatesDef

type ToolStatesDef struct {
	*am.StatesBase

	Working string
	Idle    string

	// inherit from BasicStatesDef
	*ssam.BasicStatesDef
	// inherit from DisposedStatesDef
	*ssam.DisposedStatesDef
	// inherit from WorkerStatesDef
	*ssrpc.WorkerStatesDef
}

ToolStatesDef contains all the states of the Tool state machine.

type Website

type Website struct {
	URL     string `description:"The URL of the website."`
	Title   string `description:"The title of the website."`
	Content string `description:"The content or a snippet of the website."`
}

Jump to

Keyboard shortcuts

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