Documentation
¶
Index ¶
- Variables
- func AddErrAI(event *am.Event, mach *am.Machine, err error, args ...am.A) am.Result
- func AddErrDB(event *am.Event, mach *am.Machine, err error, args ...am.A) am.Result
- func ToolAddToPrompts(t ToolApi, prompts ...PromptApi)
- type A
- type AgentBase
- func (a *AgentBase) AgentImpl() shared.AgentAPI
- func (a *AgentBase) BaseDBReadyEnd(e *am.Event)
- func (a *AgentBase) BaseDBSavingEnter(e *am.Event) bool
- func (a *AgentBase) BaseDBSavingState(e *am.Event)
- func (a *AgentBase) BaseDBStartingState(e *am.Event)
- func (a *AgentBase) BuildOffer() string
- func (a *AgentBase) CheckingMenuRefsEnter(e *am.Event) bool
- func (a *AgentBase) CheckingMenuRefsState(e *am.Event)
- func (a *AgentBase) ConfigBase() *shared.Config
- func (a *AgentBase) ConfigUpdateEnter(e *am.Event) bool
- func (a *AgentBase) ConfigUpdateState(e *am.Event)
- func (a *AgentBase) DBBase() *sql.DB
- func (a *AgentBase) DBG() *debugger.Debugger
- func (a *AgentBase) DBHistory() *sql.DB
- func (a *AgentBase) ExceptionState(e *am.Event)
- func (a *AgentBase) Gemini() []*shared.GeminiClient
- func (a *AgentBase) Hist() (amhist.MemoryApi, error)
- func (a *AgentBase) HistMem() *amhist.Memory
- func (a *AgentBase) HistSQLite() *amhistg.Memory
- func (a *AgentBase) HistoryDBReadyEnd(e *am.Event)
- func (a *AgentBase) HistoryDBStartingState(e *am.Event)
- func (a *AgentBase) Init(agentImpl shared.AgentAPI, cfg *shared.Config, logArgs am.LogArgsMapperFn, ...) error
- func (a *AgentBase) InterruptedState(e *am.Event)
- func (a *AgentBase) Log(txt string, args ...any)
- func (a *AgentBase) LogErr(msg string, err error, args ...any)
- func (a *AgentBase) Logger() *slog.Logger
- func (a *AgentBase) Mach() *am.Machine
- func (a *AgentBase) OpenAI() []*shared.OpenAIClient
- func (a *AgentBase) Output(txt string, from shared.From) am.Result
- func (a *AgentBase) PromptEnd(e *am.Event)
- func (a *AgentBase) PromptEnter(e *am.Event) bool
- func (a *AgentBase) PromptState(e *am.Event)
- func (a *AgentBase) QueriesBase() *sqlc.Queries
- func (a *AgentBase) RequestedAIState(e *am.Event)
- func (a *AgentBase) RequestedToolState(e *am.Event)
- func (a *AgentBase) RequestingAIState(e *am.Event)
- func (a *AgentBase) RequestingExit(e *am.Event) bool
- func (a *AgentBase) RequestingToolState(e *am.Event)
- func (a *AgentBase) ResumeState(e *am.Event)
- func (a *AgentBase) SetMach(m *am.Machine)
- func (a *AgentBase) Start() am.Result
- func (a *AgentBase) StartEnter(e *am.Event) bool
- func (a *AgentBase) StartState(e *am.Event)
- func (a *AgentBase) Stop(disposeCtx context.Context) am.Result
- func (a *AgentBase) Store() *shared.AgentStore
- func (a *AgentBase) StoryActivate(e *am.Event, story string) am.Result
- func (a *AgentBase) StoryDeactivate(e *am.Event, story string) am.Result
- func (a *AgentBase) UIMsgEnter(e *am.Event) bool
- func (a *AgentBase) ValFile(ctx context.Context, name string, val any, enc string)
- type Document
- type Prompt
- func (p *Prompt[P, R]) AddDoc(doc *Document)
- func (p *Prompt[P, R]) AddTool(tool ToolApi)
- func (p *Prompt[P, R]) Conversation() (*instrc.Conversation, string)
- func (p *Prompt[P, R]) Exec(e *am.Event, params P) (*R, error)
- func (p *Prompt[P, R]) GenSysPrompt() string
- func (p *Prompt[P, R]) HistClean()
- type PromptApi
- type PromptMsg
- type PromptSchemaless
- type S
- type SlogWriter
- type Tool
- type ToolApi
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHistNil = errors.New("history is nil") ErrNoAI = errors.New("no AI provider configured") )
View Source
var ErrAI = errors.New("AI error")
ErrAI is for states.AgentBaseStatesDef.ErrAI.
View Source
var ErrDB = errors.New("DB error")
ErrDB is for states.AgentBaseStatesDef.ErrDB.
View Source
var ParseArgs = shared.ParseArgs
View Source
var Pass = shared.Pass
View Source
var PassRpc = shared.PassRPC
Functions ¶
func ToolAddToPrompts ¶
Types ¶
type AgentBase ¶ added in v0.4.0
type AgentBase struct {
*am.ExceptionHandler
*ssam.DisposedHandlers
// UserInput is a prompt submitted the user, owned by [schema.AgentBaseStatesDef.Prompt].
UserInput string
// OfferList is a list of choices for the user.
// TODO atomic?
OfferList []string
DbConn *sql.DB
// contains filtered or unexported fields
}
func (*AgentBase) BaseDBReadyEnd ¶ added in v0.4.0
func (*AgentBase) BaseDBSavingEnter ¶ added in v0.4.0
func (*AgentBase) BaseDBSavingState ¶ added in v0.4.0
func (*AgentBase) BaseDBStartingState ¶ added in v0.4.0
func (*AgentBase) BuildOffer ¶ added in v0.4.0
func (*AgentBase) CheckingMenuRefsEnter ¶ added in v0.5.0
func (*AgentBase) CheckingMenuRefsState ¶ added in v0.5.0
func (*AgentBase) ConfigBase ¶ added in v0.4.0
func (*AgentBase) ConfigUpdateEnter ¶ added in v0.5.0
func (*AgentBase) ConfigUpdateState ¶ added in v0.5.0
func (*AgentBase) ExceptionState ¶ added in v0.5.0
func (*AgentBase) Gemini ¶ added in v0.4.0
func (a *AgentBase) Gemini() []*shared.GeminiClient
func (*AgentBase) HistSQLite ¶ added in v0.4.0
func (*AgentBase) HistoryDBReadyEnd ¶ added in v0.4.0
func (*AgentBase) HistoryDBStartingState ¶ added in v0.4.0
func (*AgentBase) InterruptedState ¶ added in v0.4.0
func (*AgentBase) Log ¶ added in v0.4.0
Log is an slog logger. It can optionally pipe log entries into the machine log.
func (*AgentBase) OpenAI ¶ added in v0.4.0
func (a *AgentBase) OpenAI() []*shared.OpenAIClient
func (*AgentBase) Output ¶ added in v0.4.0
Output is a sugar for adding a [schema.AgentBaseStatesDef.Msg] mutation.
func (*AgentBase) PromptState ¶ added in v0.4.0
func (*AgentBase) QueriesBase ¶ added in v0.4.0
func (*AgentBase) RequestedAIState ¶ added in v0.5.0
func (*AgentBase) RequestedToolState ¶ added in v0.5.0
func (*AgentBase) RequestingAIState ¶ added in v0.5.0
func (*AgentBase) RequestingExit ¶ added in v0.4.0
func (*AgentBase) RequestingToolState ¶ added in v0.5.0
func (*AgentBase) ResumeState ¶ added in v0.4.0
func (*AgentBase) Start ¶ added in v0.4.0
Start is a sugar for adding a [schema.AgentBaseStatesDef.Start] mutation.
func (*AgentBase) StartState ¶ added in v0.4.0
func (*AgentBase) Store ¶ added in v0.5.0
func (a *AgentBase) Store() *shared.AgentStore
func (*AgentBase) StoryActivate ¶ added in v0.5.0
func (*AgentBase) StoryDeactivate ¶ added in v0.5.0
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
func (*Document) AddToPrompts ¶ added in v0.2.0
type Prompt ¶
type Prompt[P any, R any] struct { Conditions string Steps string Result string SchemaParams P SchemaResult R State string A shared.AgentBaseAPI // number of previous messages to include HistoryMsgLen int Msgs []*PromptMsg // contains filtered or unexported fields }
func (*Prompt[P, R]) AddTool ¶
AddTool registers a SECAI TOOL which then exports it's documents into the system prompt. This is different from an AI tool.
func (*Prompt[P, R]) Conversation ¶ added in v0.4.0
func (p *Prompt[P, R]) Conversation() (*instrc.Conversation, string)
Conversation will create a conversation with history and system prompt, return sys prompt on the side.
func (*Prompt[P, R]) GenSysPrompt ¶ added in v0.4.0
GenSysPrompt generates a system prompt.
type PromptSchemaless ¶
type SlogWriter ¶ added in v0.5.0
Directories
¶
| Path | Synopsis |
|---|---|
|
Package agent_llm is a base agent extended with common LLM prompts.
|
Package agent_llm is a base agent extended with common LLM prompts. |
|
schema
Package schema contains a stateful schema-v2 for AgentLLM.
|
Package schema contains a stateful schema-v2 for AgentLLM. |
|
examples
|
|
|
cook
Package cook is a recipe-choosing and cooking agent with a gen-ai character.
|
Package cook is a recipe-choosing and cooking agent with a gen-ai character. |
|
cook/cmd
command
|
|
|
cook/scripts/gen_sql_schema
command
|
|
|
research
Package research is a port of atomic-agents/deepresearch to secai.
|
Package research is a port of atomic-agents/deepresearch to secai. |
|
research/cmd
command
|
|
|
scripts
|
|
|
gen_sql_schema
command
|
|
|
Package schema contains a stateful schema-v2 for AgentBase, Mem, and Tool.
|
Package schema contains a stateful schema-v2 for AgentBase, Mem, and Tool. |
|
tools
|
|
|
browser/cmd
command
|
|
Click to show internal directories.
Click to hide internal directories.

