agent_llm

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package agent_llm is a base agent extended with common LLM prompts.

Index

Constants

This section is empty.

Variables

View Source
var APrefix = "secaillm"

APrefix is the args prefix, set from config.

View Source
var Pass2 = shared.Pass
View Source
var Pass2RPC = shared.PassRPC

Functions

func LogArgs added in v0.5.0

func LogArgs(args am.A) map[string]string

LogArgs is an args logger for A and secai.A.

func Pass added in v0.5.0

func Pass(args *A) am.A

Pass prepares am.A from A to be passed to further mutations (encoder).

func PassRPC added in v0.5.0

func PassRPC(args *A) am.A

PassRPC is a network-safe version of Pass. Use it when mutating aRPC workers.

Types

type A added in v0.5.0

type A struct {
	// base args of the framework
	*shared.A

	// agent's args
	Move *sa.ResultOrienting `log:"move"`
}

A is a struct for node arguments. It's a typesafe alternative to am.A.

func NewArgs added in v0.5.0

func NewArgs() A

func ParseArgs added in v0.5.0

func ParseArgs(args am.A) *A

ParseArgs extracts A from am.Event.ArgsAPrefix (decoder).

type A2 added in v0.5.0

type A2 = shared.A

type A2RPC added in v0.5.0

type A2RPC = shared.ARPC

type ARPC added in v0.5.0

type ARPC struct {
	// base args of the framework
	*shared.A

	// agent's args
	Move *sa.ResultOrienting `log:"move"`
}

ARPC is a subset of A that can be passed over RPC (eg no channels, conns, etc)

func NewArgsRPC added in v0.5.0

func NewArgsRPC() ARPC

type AgentLLM

type AgentLLM struct {
	*secai.AgentBase

	Character     atomic.Pointer[sa.ResultGenCharacter]
	Resources     atomic.Pointer[sa.ResultGenResources]
	MoveOrienting atomic.Pointer[sa.ResultOrienting]

	PCheckingMenuRefs *sa.PromptCheckingMenuRefs
	PGenResources     *sa.PromptGenResources
	PGenCharacter     *sa.PromptGenCharacter
	POrienting        *sa.PromptOrienting
	PConfigTest       *sa.PromptConfigTest

	DocCharacter *secai.Document
	// contains filtered or unexported fields
}

AgentLLM is secai.AgentBase extended with common LLM prompts, meant to be embedded in final agents.

func New

func New(ctx context.Context, states am.S, schema am.Schema) *AgentLLM

func (*AgentLLM) CharacterReadyEnd added in v0.5.0

func (a *AgentLLM) CharacterReadyEnd(e *am.Event)

func (*AgentLLM) CharacterReadyEnter added in v0.5.0

func (a *AgentLLM) CharacterReadyEnter(e *am.Event) bool

func (*AgentLLM) CharacterReadyState added in v0.5.0

func (a *AgentLLM) CharacterReadyState(e *am.Event)

func (*AgentLLM) CheckingMenuRefsState added in v0.5.0

func (a *AgentLLM) CheckingMenuRefsState(e *am.Event)

func (*AgentLLM) ConfigUpdateState added in v0.5.0

func (a *AgentLLM) ConfigUpdateState(e *am.Event)

func (*AgentLLM) ConfigValidatingState added in v0.5.0

func (a *AgentLLM) ConfigValidatingState(e *am.Event)

func (*AgentLLM) GenCharacterEnd added in v0.5.0

func (a *AgentLLM) GenCharacterEnd(e *am.Event)

func (*AgentLLM) GenCharacterState added in v0.5.0

func (a *AgentLLM) GenCharacterState(e *am.Event)

func (*AgentLLM) GenResourcesEnd added in v0.5.0

func (a *AgentLLM) GenResourcesEnd(e *am.Event)

func (*AgentLLM) GenResourcesEnter added in v0.5.0

func (a *AgentLLM) GenResourcesEnter(e *am.Event) bool

func (*AgentLLM) GenResourcesState added in v0.5.0

func (a *AgentLLM) GenResourcesState(e *am.Event)

func (*AgentLLM) Init

func (a *AgentLLM) Init(
	agentImpl shared.AgentAPI, cfg *shared.Config, logArgs am.LogArgsMapperFn, groups any, states am.States, args any,
) error

func (*AgentLLM) MemoryWipe added in v0.5.0

func (a *AgentLLM) MemoryWipe(ctx context.Context, e *am.Event)

func (*AgentLLM) OrientingMoveEnter added in v0.5.0

func (a *AgentLLM) OrientingMoveEnter(e *am.Event) bool

func (*AgentLLM) OrientingMoveState added in v0.5.0

func (a *AgentLLM) OrientingMoveState(e *am.Event)

func (*AgentLLM) OrientingState added in v0.5.0

func (a *AgentLLM) OrientingState(e *am.Event)

func (*AgentLLM) OutputPhrase added in v0.5.0

func (a *AgentLLM) OutputPhrase(key string, args ...any) error

OutputPhrase is sugar for Phrase followed by Output FromAssistant.

func (*AgentLLM) Phrase added in v0.5.0

func (a *AgentLLM) Phrase(key string, args ...any) string

Phrase returns a random phrase from resources under [key], or an empty string. TODO move to base agent

func (*AgentLLM) Queries added in v0.5.0

func (a *AgentLLM) Queries() *sqlc.Queries

func (*AgentLLM) ResourcesReadyEnd added in v0.5.0

func (a *AgentLLM) ResourcesReadyEnd(e *am.Event)

func (*AgentLLM) RestoreCharacterState added in v0.5.0

func (a *AgentLLM) RestoreCharacterState(e *am.Event)

func (*AgentLLM) RestoreResourcesState added in v0.5.0

func (a *AgentLLM) RestoreResourcesState(e *am.Event)

type ChildAPI added in v0.5.0

type ChildAPI interface {
	// LLMResources returns the params for the LLM prompt that generates resources, eg phrases.
	LLMResources() sa.ParamsGenResources
}

type S

type S = am.S

Directories

Path Synopsis
db
Package schema contains a stateful schema-v2 for AgentLLM.
Package schema contains a stateful schema-v2 for AgentLLM.

Jump to

Keyboard shortcuts

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