Documentation
¶
Overview ¶
Package cook is a recipe-choosing and cooking agent with a gen-ai character.
Index ¶
- Variables
- type AStepCompleted
- type Agent
- func (a *Agent) Actions() []shared.ActionInfo
- func (a *Agent) AnyState(e *am.Event)
- func (a *Agent) CharacterReadyState(e *am.Event)
- func (a *Agent) CheckStoriesState(e *am.Event)
- func (a *Agent) ConfigUpdateState(e *am.Event)
- func (a *Agent) DBAgent() *sql.DB
- func (a *Agent) DBStartingState(e *am.Event)
- func (a *Agent) DisposingState(e *am.Event)
- func (a *Agent) ExceptionState(e *am.Event)
- func (a *Agent) GenJokesEnd(e *am.Event)
- func (a *Agent) GenJokesEnter(e *am.Event) bool
- func (a *Agent) GenJokesState(e *am.Event)
- func (a *Agent) GenStepCommentsEnd(e *am.Event)
- func (a *Agent) GenStepCommentsState(e *am.Event)
- func (a *Agent) GenStepsEnd(e *am.Event)
- func (a *Agent) GenStepsEnter(e *am.Event) bool
- func (a *Agent) GenStepsState(e *am.Event)
- func (a *Agent) HeartbeatState(e *am.Event)
- func (a *Agent) HistoryStates() S
- func (a *Agent) IngredientsReadyEnd(e *am.Event)
- func (a *Agent) Init(cfg *Config) error
- func (a *Agent) InputPendingState(e *am.Event)
- func (a *Agent) InterruptedState(e *am.Event)
- func (a *Agent) JokesReadyEnd(e *am.Event)
- func (a *Agent) LLMResources() sallm.ParamsGenResources
- func (a *Agent) LoopEnter(e *am.Event) bool
- func (a *Agent) LoopState(e *am.Event)
- func (a *Agent) MachMem() *am.Machine
- func (a *Agent) MachSchema() (am.Schema, am.S)
- func (a *Agent) MockEnter(e *am.Event) bool
- func (a *Agent) MockState(e *am.Event)
- func (a *Agent) Msgs() []*shared.Msg
- func (a *Agent) OrientingMoves() map[string]string
- func (a *Agent) PromptEnter(e *am.Event) bool
- func (a *Agent) PromptState(e *am.Event)
- func (a *Agent) Queries() *sqlc.Queries
- func (a *Agent) ReadyEnter(e *am.Event) bool
- func (a *Agent) ReadyState(e *am.Event)
- func (a *Agent) RestoreJokesState(e *am.Event)
- func (a *Agent) SSHConnState(e *am.Event)
- func (a *Agent) SSHDisconnState(e *am.Event)
- func (a *Agent) SSHReadyState(e *am.Event)
- func (a *Agent) Splash() string
- func (a *Agent) StartEnd(e *am.Event)
- func (a *Agent) StartState(e *am.Event)
- func (a *Agent) StepCommentsReadyEnd(e *am.Event)
- func (a *Agent) StepCompletedState(e *am.Event)
- func (a *Agent) StepsReadyEnd(e *am.Event)
- func (a *Agent) StepsReadyState(e *am.Event)
- func (a *Agent) Stories() []shared.StoryInfo
- func (a *Agent) Story(state string) *shared.Story
- func (a *Agent) StoryActionEnter(e *am.Event) bool
- func (a *Agent) StoryActionState(e *am.Event)
- func (a *Agent) StoryChangedState(e *am.Event)
- func (a *Agent) StoryCookingStartedEnd(e *am.Event)
- func (a *Agent) StoryCookingStartedEnter(e *am.Event) bool
- func (a *Agent) StoryCookingStartedState(e *am.Event)
- func (a *Agent) StoryIngredientsPickingEnd(e *am.Event)
- func (a *Agent) StoryIngredientsPickingState(e *am.Event)
- func (a *Agent) StoryJokeEnter(e *am.Event) bool
- func (a *Agent) StoryJokeState(e *am.Event)
- func (a *Agent) StoryMealReadyState(e *am.Event)
- func (a *Agent) StoryMemoryWipeState(e *am.Event)
- func (a *Agent) StoryRecipePickingEnd(e *am.Event)
- func (a *Agent) StoryRecipePickingEnter(e *am.Event) bool
- func (a *Agent) StoryRecipePickingState(e *am.Event)
- func (a *Agent) StoryStartAgainState(e *am.Event)
- func (a *Agent) StoryWakingUpEnd(e *am.Event)
- func (a *Agent) StoryWakingUpState(e *am.Event)
- func (a *Agent) UIModeEnd(e *am.Event)
- func (a *Agent) UIModeEnter(e *am.Event) bool
- func (a *Agent) UIModeState(e *am.Event)
- func (a *Agent) UIMsgEnter(e *am.Event) bool
- func (a *Agent) UIMsgState(e *am.Event)
- func (a *Agent) UIReadyEnter(e *am.Event) bool
- func (a *Agent) UIRenderClockState(e *am.Event)
- type Args
- type Config
- type ConfigCook
- type Mock
- type S
- type Web
Constants ¶
This section is empty.
Variables ¶
View Source
var APrefix = "cook"
APrefix is the args prefix, set from config.
View Source
var ArgsRPC = []am.ArgsApi{AStepCompleted{}}
View Source
var ConfigTpl []byte
View Source
var EnvCookDev = "COOK_DEV"
EnvCookDev enabled dev mode (local config and data dir).
View Source
var Pass = am.Pass
View Source
var SAdd = am.SAdd
View Source
var WelcomeMessage = "Please wait while loading..."
Functions ¶
This section is empty.
Types ¶
type AStepCompleted ¶ added in v0.6.0
func (AStepCompleted) ArgsState ¶ added in v0.6.0
func (AStepCompleted) ArgsState() string
type Agent ¶
type Agent struct {
// inherit from AgentLLM
*agentllm.AgentLLM
Config *Config
MemCutoff atomic.Uint64
// contains filtered or unexported fields
}
func (*Agent) Actions ¶ added in v0.5.0
func (a *Agent) Actions() []shared.ActionInfo
TODO move to LLM
func (*Agent) CharacterReadyState ¶
func (*Agent) CheckStoriesState ¶
func (*Agent) ConfigUpdateState ¶ added in v0.5.0
func (*Agent) DBStartingState ¶
func (*Agent) DisposingState ¶ added in v0.6.0
func (*Agent) ExceptionState ¶
func (*Agent) GenJokesEnd ¶
func (*Agent) GenJokesState ¶
func (*Agent) GenStepCommentsEnd ¶
func (*Agent) GenStepCommentsState ¶
func (*Agent) GenStepsEnd ¶
func (*Agent) GenStepsState ¶
func (*Agent) HeartbeatState ¶
func (*Agent) HistoryStates ¶ added in v0.4.0
HistoryStates returns a list of states to track in the history.
func (*Agent) IngredientsReadyEnd ¶
func (*Agent) InputPendingState ¶
func (*Agent) InterruptedState ¶
func (*Agent) JokesReadyEnd ¶
func (*Agent) LLMResources ¶ added in v0.5.0
func (a *Agent) LLMResources() sallm.ParamsGenResources
func (*Agent) OrientingMoves ¶ added in v0.5.0
func (*Agent) PromptState ¶
func (*Agent) ReadyState ¶
func (*Agent) RestoreJokesState ¶
func (*Agent) SSHConnState ¶ added in v0.5.0
func (*Agent) SSHDisconnState ¶ added in v0.5.0
func (*Agent) SSHReadyState ¶ added in v0.5.0
func (*Agent) StartState ¶
func (*Agent) StepCommentsReadyEnd ¶
func (*Agent) StepCompletedState ¶
func (*Agent) StepsReadyEnd ¶
func (*Agent) StepsReadyState ¶
func (*Agent) StoryActionState ¶ added in v0.5.0
func (*Agent) StoryChangedState ¶
TODO move to secai?
func (*Agent) StoryCookingStartedEnd ¶
func (*Agent) StoryCookingStartedState ¶
func (*Agent) StoryIngredientsPickingEnd ¶
func (*Agent) StoryIngredientsPickingState ¶
func (*Agent) StoryJokeState ¶
func (*Agent) StoryMealReadyState ¶
func (*Agent) StoryMemoryWipeState ¶
func (*Agent) StoryRecipePickingEnd ¶
func (*Agent) StoryRecipePickingState ¶
func (*Agent) StoryStartAgainState ¶
func (*Agent) StoryWakingUpEnd ¶
func (*Agent) StoryWakingUpState ¶
func (*Agent) UIModeState ¶
func (*Agent) UIMsgState ¶ added in v0.5.0
func (*Agent) UIRenderClockState ¶ added in v0.5.0
type Args ¶ added in v0.6.0
func (Args) ArgsPrefix ¶ added in v0.6.0
type Config ¶
type Config struct {
shared.Config
Cook ConfigCook
}
func ConfigDefault ¶ added in v0.4.0
func ConfigDefault() Config
type ConfigCook ¶ added in v0.4.0
type ConfigCook struct {
// Number of ingredients to collect.
MinIngredients int
GenJokesAmount int
// TODO move to secai
SessionTimeout time.Duration `kdl:",duration"`
// Number of recipes to generate.
GenRecipes int
// TODO remove?
MinPromptLen int
// Step comment frequency. Lower number = higher frequency of step comments. 2=50%, 3=33%.
StepCommentFreq int
// Heartbeat frequency.
HeartbeatFreq time.Duration `kdl:",duration"`
// Certainty above which the orienting move should be accepted.
OrientingMoveThreshold float64
}
type Mock ¶
type Mock struct {
// Local mock switch, complementary to the config switch.
Active bool
FlowPromptIngredients string
FlowPromptRecipe string
FlowPromptCooking string
Recipe string
GenStepsRes string
GenStepCommentsRes string
StoryCookingStartedInput string
StoryCookingStartedInput3 string
}
Mock will run a sample scenario
Click to show internal directories.
Click to hide internal directories.