Documentation
¶
Index ¶
- Variables
- type Ingredient
- type ParamsCookingStarted
- type ParamsGenJokes
- type ParamsGenStepComments
- type ParamsGenSteps
- type ParamsIngredientsPicking
- type ParamsRecipePicking
- type PromptCookingStarted
- type PromptGenJokes
- type PromptGenStepComments
- type PromptGenSteps
- type PromptIngredientsPicking
- type PromptRecipePicking
- type Recipe
- type ResultCookingStarted
- type ResultGenJokes
- type ResultGenStepComments
- type ResultGenSteps
- type ResultIngredientsPicking
- type ResultRecipePicking
Constants ¶
This section is empty.
Variables ¶
View Source
var LLMResources = sa.ParamsGenResources{ Phrases: map[string]string{ "NoCookingNoJokes": "No jokes without cooking.", "IngredientsPicking": "Tell me what cooking ingredients do you have at hand, we need at least %d to continue.", "IngredientsPickingEnd": "OK, I have the ingredients I need.", "RecipePicking": "Ok, let me check my books for what we could make...", "ResumeNeeded": "You have to Resume for me to do anything.", "WokenUp": "OK I'm ready to start", "CookingStarted": "You chose %s as the recipe which we will cook, got it. I will plan all the cooking steps nicely for us. Just press those buttons on the right, once I'm done.", "CharacterReady": sp(` Welcome to Cook - your AI-powered cooking assistant! It will help you pick a meal from the ingredients you have, and then you can cook it together (wink wink). `), ss.StoryMealReady: "We made it, the meal is ready! You can enjoy it now. I hope you had fun cooking with us.", "ReqLimitReached": "You have reached the limit of %d requests per session. Please come back later.", }, }
View Source
var MatchIngredients = regexp.MustCompile("^Ingredient")
View Source
var MatchSteps = regexp.MustCompile(`^Step`)
View Source
var StoryCookingStarted = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryCookingStarted, Title: "Cooking Started", Desc: "The main story, the bot translates the recipe into actionable steps, then comments while the user completes them.", }, Agent: shared.StoryActor{ Trigger: amhelp.Cond{ Is: am.S{ss.Ready, ss.RecipeReady}, }, }, Memory: shared.StoryActor{ Trigger: amhelp.Cond{ Not: am.S{states.MemMealReady}, }, }, }
View Source
var StoryIngredientsPicking = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryIngredientsPicking, Title: "Ingredients Picking", Desc: "The bot asks the user what ingredients they have at hand.", }, Agent: shared.StoryActor{ Trigger: amhelp.Cond{ Is: am.S{ss.Ready}, Not: am.S{ss.IngredientsReady, ss.StoryWakingUp}, }, }, }
View Source
var StoryJoke = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryJoke, Title: "Joke", Desc: "In this story the bot tells a joke when asked to, based on the character.", }, CanActivate: func(s *shared.Story) bool { mem := s.Memory.Mach stepStates := mem.StateNamesMatch(MatchSteps) stepsNow := mem.Time(stepStates).Sum(nil) + s.Epoch freq := 1.5 return s.Tick == 0 || float64(stepsNow)*freq >= float64(s.Tick) }, }
View Source
var StoryMealReady = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryMealReady, Title: "Meal Ready", Desc: "This story is the end of the flow, the recipe should have been materialized by now.", }, Memory: shared.StoryActor{ Trigger: amhelp.Cond{ Is: am.S{states.MemMealReady}, }, }, }
View Source
var StoryMemoryWipe = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryMemoryWipe, Title: "Memory Wipe", Desc: "The bot will clean both short term and long term memory.", }, }
View Source
var StoryRecipePicking = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryRecipePicking, Title: "Recipe Picking", Desc: "The bot offers some recipes, based on the ingredients.", }, Agent: shared.StoryActor{ Trigger: amhelp.Cond{ Is: am.S{ss.Ready, ss.IngredientsReady}, Not: am.S{ss.RecipeReady}, }, }, }
View Source
var StoryStartAgain = &shared.Story{ StoryInfo: shared.StoryInfo{ State: ss.StoryStartAgain, Title: "Start Again", Desc: "The session will re-start, keeping the bot's memory.", }, }
Functions ¶
This section is empty.
Types ¶
type Ingredient ¶
type ParamsCookingStarted ¶
type ParamsGenJokes ¶
type ParamsGenJokes struct {
// The number of jokes to generate.
Amount int
}
type ParamsGenStepComments ¶
type ParamsGenSteps ¶
type ParamsGenSteps struct {
Recipe Recipe
}
type ParamsIngredientsPicking ¶
type ParamsIngredientsPicking struct {
// The minimum number of ingredients needed.
MinIngredients int
// Text to extract ingredients from.
Prompt string
// List of ingredients extracted from prompts till now.
Ingredients []Ingredient
}
type ParamsRecipePicking ¶
type ParamsRecipePicking struct {
// List of available ingredients.
Ingredients []Ingredient
// The number of recipes needed.
Amount int
}
type PromptCookingStarted ¶
type PromptCookingStarted = secai.Prompt[ParamsCookingStarted, ResultCookingStarted]
func NewPromptCookingStarted ¶
func NewPromptCookingStarted(agent shared.AgentBaseAPI) *PromptCookingStarted
type PromptGenJokes ¶
type PromptGenJokes = secai.Prompt[ParamsGenJokes, ResultGenJokes]
func NewPromptGenJokes ¶
func NewPromptGenJokes(agent shared.AgentBaseAPI) *PromptGenJokes
type PromptGenStepComments ¶
type PromptGenStepComments = secai.Prompt[ParamsGenStepComments, ResultGenStepComments]
func NewPromptGenStepComments ¶
func NewPromptGenStepComments(agent shared.AgentBaseAPI) *PromptGenStepComments
type PromptGenSteps ¶
type PromptGenSteps = secai.Prompt[ParamsGenSteps, ResultGenSteps]
func NewPromptGenSteps ¶
func NewPromptGenSteps(agent shared.AgentBaseAPI) *PromptGenSteps
type PromptIngredientsPicking ¶
type PromptIngredientsPicking = secai.Prompt[ParamsIngredientsPicking, ResultIngredientsPicking]
func NewPromptIngredientsPicking ¶
func NewPromptIngredientsPicking(agent shared.AgentBaseAPI) *PromptIngredientsPicking
type PromptRecipePicking ¶
type PromptRecipePicking = secai.Prompt[ParamsRecipePicking, ResultRecipePicking]
func NewPromptRecipePicking ¶
func NewPromptRecipePicking(agent shared.AgentBaseAPI) *PromptRecipePicking
type ResultCookingStarted ¶
type ResultCookingStarted struct {
// Max 2 sentences, min 3 words.
Answer string
}
type ResultGenJokes ¶
type ResultGenStepComments ¶
type ResultGenStepComments struct {
// Comments for each step.
Comments []string
}
type ResultGenSteps ¶
type ResultIngredientsPicking ¶
type ResultIngredientsPicking struct {
Ingredients []Ingredient
// A message to be shown to the user if the results are not valid.
RedoMsg string
}
type ResultRecipePicking ¶
Click to show internal directories.
Click to hide internal directories.