Documentation
¶
Overview ¶
Package schema contains a stateful schema-v2 for AgentBase, Mem, and Tool.
Index ¶
Constants ¶
const TagManual = "manual"
TagManual is for stories that CANNOT be triggered by the LLM orienting story.
const TagPrompt = "prompt"
TagPrompt is for states with LLM prompts.
const TagTrigger = "trigger"
TagTrigger is for stories that can be triggered by the LLM orienting story.
Variables ¶
var ( // AgentBaseStates contains all the states for the AgentLLM machine. AgentBaseStates = ssAB // AgentBaseGroups contains all the state groups for the AgentLLM machine. AgentBaseGroups = sgAB )
var ( // MemStates contains all the states for the Mem machine. MemStates = ssM // MemGroups contains all the state groups for the Mem machine. MemGroups = sgM )
var ( // ToolStates contains all the states for the Tool machine. ToolStates = ssT // ToolGroups contains all the state groups for the Tool machine. ToolGroups = sgT )
var AgentSchema = SchemaMerge( ssam.BasicSchema, ssam.DisposedSchema, ssrpc.NetSourceSchema, am.Schema{ ssAB.ErrLLM: { Multi: true, Require: S{Exception}, }, ssAB.ErrDB: { Multi: true, Require: S{Exception}, }, ssAB.ErrMem: { Multi: true, Require: S{Exception}, }, ssAB.ErrUI: { Multi: true, Require: S{ssAB.UIMode}, }, ssAB.Start: {Add: S{ssAB.BaseDBStarting, ssAB.HistoryDBStarting}}, ssAB.Ready: { Require: S{ssAB.Start}, Add: S{ssAB.Loop}, }, ssAB.Loop: {Require: S{ssAB.Ready}}, ssAB.InputPending: {Remove: S{ssAB.Prompt}}, ssAB.InputBlocked: {Remove: S{ssAB.Prompt}}, ssAB.Requesting: {}, ssAB.RequestingTool: { Multi: true, Add: S{ssAB.Requesting}, }, ssAB.RequestingLLM: { Multi: true, Add: S{ssAB.Requesting}, }, ssAB.Mock: {}, ssAB.BaseDBStarting: { Require: S{ssAB.Start}, Remove: S{ssAB.BaseDBReady}, }, ssAB.BaseDBReady: { Require: S{ssAB.Start}, Remove: S{ssAB.BaseDBStarting}, }, ssAB.BaseDBSaving: {Multi: true}, ssAB.HistoryDBStarting: { Require: S{ssAB.Start}, Remove: S{ssAB.HistoryDBReady}, }, ssAB.HistoryDBReady: { Require: S{ssAB.Start}, Remove: S{ssAB.HistoryDBStarting}, }, ssAB.Prompt: { Multi: true, Require: S{ssAB.Start}, Remove: S{ssAB.InputPending}, }, ssAB.Interrupted: { Add: S{ssAB.InputPending}, Remove: S{ssAB.Resume}, }, ssAB.Resume: { Remove: S{ssAB.Interrupted}, }, ssAB.Msg: { Multi: true, Require: S{ssAB.Start}, }, ssAB.UIMode: {}, ssAB.UIReady: {Require: S{ssAB.UIMode}}, ssAB.UIButtonSend: {Require: S{ssAB.UIMode}}, ssAB.UIButtonIntt: {Require: S{ssAB.UIMode}}, ssAB.UISaveOutput: {Require: S{ssAB.UIMode}}, ssAB.UICleanOutput: { Multi: true, Require: S{ssAB.UIMode}, }, ssAB.UISessConn: { Multi: true, Require: S{ssAB.UIMode}, }, ssAB.UISessDisconn: { Multi: true, Require: S{ssAB.UIMode}, }, ssAB.UISrvListening: {Require: S{ssAB.UIMode}}, })
AgentSchema represents all relations and properties of AgentBaseStates.
var Exception = am.StateException
Exception is a type alias for the exception state.
var MemSchema = am.Schema{}
MemSchema represents all relations and properties of MemStates.
var SAdd = am.SAdd
SAdd is a func alias for merging lists of states.
var SchemaMerge = am.SchemaMerge
SchemaMerge is a func alias for extending an existing state structure.
var StateAdd = am.StateAdd
StateAdd is a func alias for adding to an existing state definition.
var StateSet = am.StateSet
StateSet is a func alias for replacing parts of an existing state definition.
var ToolSchema = SchemaMerge( ssam.BasicSchema, ssam.DisposedSchema, ssrpc.NetSourceSchema, 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 AgentBaseGroupsDef ¶ added in v0.4.0
type AgentBaseGroupsDef struct{}
AgentBaseGroupsDef contains all the state groups AgentLLM state machine.
type AgentBaseStatesDef ¶ added in v0.4.0
type AgentBaseStatesDef struct {
*am.StatesBase
ErrLLM string
ErrDB string
ErrMem string
ErrUI string
// AgentLLM is waiting for user input.
InputPending string
// User input is blocked by the agent.
InputBlocked string
// AgentLLM is currently requesting >=1 tools
RequestingTool string
// AgentLLM 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
HistoryDBStarting string
HistoryDBReady 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 NetSourceStatesDef
*ssrpc.NetSourceStatesDef
}
AgentBaseStatesDef contains all the states of the AgentLLM 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 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 NetSourceStatesDef
*ssrpc.NetSourceStatesDef
}
ToolStatesDef contains all the states of the Tool state machine.