schema

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 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 Tool. Bootstrapped with am-gen. Edit manually or re-gen & merge.

Index

Constants

This section is empty.

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 (

	// 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.BasicStruct,

	ssam.DisposedStruct,

	ssrpc.WorkerStruct,
	am.Schema{

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

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

		ssA.DBStarting: {
			Require: S{ssA.Start},
			Remove:  S{ssA.DBReady},
		},
		ssA.DBReady: {
			Require: S{ssA.Start},
			Remove:  S{ssA.DBStarting},
		},
		ssA.DBSaving: {Multi: true},

		ssA.Prompt: {
			Require: S{ssA.Start},
			Remove:  S{ssA.InputPending},
		},
		ssA.Interrupt: {
			Add:    S{ssA.InputPending},
			Remove: S{ssA.Prompt},
		},

		ssA.UIMode:        {},
		ssA.UIReady:       {Require: S{ssA.UIMode}},
		ssA.UIButtonPress: {Require: S{ssA.UIMode}},
		ssA.UISaveOutput:  {Require: S{ssA.UIMode}},
		ssA.UICleanOutput: {Require: S{ssA.UIMode}},
		ssA.UIErr:         {Require: S{ssA.UIMode}},
	})

AgentSchema represents all relations and properties of AgentStates. TODO refac Struct -> Schema

View Source
var Exception = am.Exception

Exception is a type alias for the exception state.

View Source
var SAdd = am.SAdd

SAdd is a func alias for merging lists of states.

View Source
var SchemaMerge = am.SchemaMerge

StructMerge 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.BasicStruct,

	ssam.DisposedStruct,

	ssrpc.WorkerStruct,
	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. TODO

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

	InputPending 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

	DBStarting string
	DBReady    string
	DBSaving   string

	// Loop is the main agent loop
	Loop      string
	Prompt    string
	Interrupt string

	UIMode        string
	UIReady       string
	UIButtonPress string
	UISaveOutput  string
	UICleanOutput string
	UIErr         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 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 ToolState

type ToolState = string

type ToolStatesDef

type ToolStatesDef struct {
	*am.StatesBase

	Working ToolState
	Idle    ToolState

	// 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