-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding state management example #56
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Ang Weoy Yang <[email protected]>
args: [ | ||
{name: "currentBudget", description: "The current budget of the kitchen"}, | ||
{name: "ingredient", description: "The ingredient to buy"}, | ||
{name: "price", description: "The price of the ingredient"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like we're not getting the price from your defined record from worker.ts
, the agent is estimating its own ingredient price if we don't provide the price list for it^
HeadChef | ||
] , | ||
getAgentState: getAgentState | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nit to add a newline at end of file to comply with POSIX standard
JSON.stringify(restaurantBudget) | ||
) | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same regarding the posix standard
} | ||
} | ||
|
||
main(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same regarding the posix standard
inventory: restaurantInventory | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same regarding the posix standard
// export const updateInventory = new GameFunction({ | ||
// name: "update_inventory", | ||
// description: "Update the inventory", | ||
// args: [] as const, | ||
// executable: async (args, logger) => { | ||
// return new ExecutableGameFunctionResponse | ||
// } | ||
// }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this is not used I think we could remove these lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
description: `You are a responsible kitchen manager that maximizes the efficiency of the workers under you and the kitchen. | ||
You are a great problem solver and also nice to work with. | ||
You are also in charge of making sure the kitchen produces as much high quality food in the moves_left constraint, | ||
keep in mind that the moves_left constraint is the number of moves you have left to make, and each call to a worker reduces the moves_left constraint by 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I don't think you should use this kind of language- "each call to a worker ..."; it's not that agentic - perhaps use more "natural language"?
// export const updateInventory = new GameFunction({ | ||
// name: "update_inventory", | ||
// description: "Update the inventory", | ||
// args: [] as const, | ||
// executable: async (args, logger) => { | ||
// return new ExecutableGameFunctionResponse | ||
// } | ||
// }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
||
export const getBudget = new GameFunction({ | ||
name: "get_budget", | ||
description: "Get the budget", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you be a bit more detailed with the prompt - just for the sake of making this a "good" example? :)
e.g. "Get the budget required to prepare the food..." or with more context
export const HeadChef = new GameWorker({ | ||
id: "head_chef", | ||
name: "HeadChef", | ||
description: `The head chef of the kitchen, your goal is to utilize the available inventory to make the best food. Available inventory is based on the amount behind the inventory object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit confused because I thought
- the ingredient manager buys ingredients based on budget
- and head chef just cooks based on available ingredients (i.e. doesn't care about amounts (i.e. ingredient prices) at all?
This is an example for state management article