Help us shape the future of Go! Take the 2026 Go Developer Survey

agent_llm

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: GPL-3.0 Imports: 20 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 ArgsRPC = []am.ArgsApi{AOrientingMove{}}
View Source
var ErrRetried = errors.New("retires reached")

TODO move

Functions

func IsStory added in v0.6.0

func IsStory(state string) bool

Types

type AOrientingMove added in v0.6.0

type AOrientingMove struct {
	Args
	Move *sa.ResultOrienting `log:"move"`
}

func (AOrientingMove) ArgsState added in v0.6.0

func (AOrientingMove) ArgsState() string

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      *shared.Document
	CharacterReadyMsg string
	// 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, deps AgentLLMDeps,
) 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 AgentLLMDeps added in v0.6.0

type AgentLLMDeps struct {
	LogArgs am.LogArgsMapperFn
	Groups  any
	States  am.States
	// RPC args for REPL
	ArgsREPL           []am.ArgsApi
	PromptGenCharacter *sa.PromptGenCharacter
	PromptGenResources *sa.PromptGenResources
	PromptOrienting    *sa.PromptOrienting
	// Certainty above which the orienting move should be accepted.
	OrientingMoveThreshold float32
	// Initial msg, optional, " " to disable.
	CharacterReadyMsg string
}

type Args added in v0.6.0

type Args struct {
	am.ArgsBase
}

func (Args) ArgsPrefix added in v0.6.0

func (Args) ArgsPrefix() string

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