···4646 }
47474848 for _, i := range ings {
4949- fmt.Println(toString(i.Description))
4949+ fmt.Printf("%s:$%s original ($%s)\n", toString(i.Description), toFloat(i.PriceSale), toFloat(i.PriceRegular))
5050 }
51515252+}
5353+5454+func toFloat(f *float32) string {
5555+ if f == nil {
5656+ return "0"
5757+ }
5858+ return fmt.Sprintf("%.2f", *f)
5259}
53605461func toString(s *string) string {
+11-9
internal/ai/client.go
···4343 Instructions []string `json:"instructions"`
4444 Health string `json:"health"`
4545 DrinkPairing string `json:"drink_pairing"`
4646+ WineStyles []string `json:"wine_styles"`
4647 OriginHash string `json:"origin_hash,omitempty" jsonschema:"-"` //not in schema
4748 Saved bool `json:"previously_saved,omitempty" jsonschema:"-"` //not in schema
4849}
···101102Generate distinct, practical recipes using the provided constraints to maximize ingredient freshness, quality, and value while ensuring meal variety.
102103103104# Instructions
104104-- Each meal must feature a protein and at least one side of either a vegetable and/or a starch. A combined dish (such as a pasta, stew, or similar) that incorporates a vegetable or starch alongside protein is acceptable and satisfies the side requirement.
105105+- Each meal must feature a protein and at least one side of either a vegetable and/or a starch. A combined dish (such as a pasta, stew, or similar) that incorporates a vegetable or starch is also good.
105106- Recipes should use diverse cooking methods and represent a variety of cuisines.
106106-- Provide clear, step-by-step instructions and an ingredient list for each recipe.
107107+- Provide clear, step-by-step instructions and an ingredient list for each recipe. repeat amounts and prep for each recipe in instructions.
107108- Recipes should take under 1 hour to prepare, unless the user asks for something longer
108108-- Optionally include a wine pairing suggestion for each recipe if appropriate. Suggest a local brand if possible.
109109-- Prioritize ingredients that are on sale (the bigger the discount, the higher the priority)
109109+- Optionally include a wine pairing suggestion for each recipe if appropriate. Suggest a couple of styles and a local brand if possible. Really put your Sommielier hat on for this.
110110+- Prioritize ingredients that are on sale (the bigger the discount, the higher the priority but but don't pay more for something on sale than a similar ingredient that isn't)
110111111112112113# Output Format
···116117 - Ingredient list: should include quantities and price if in input.
117118 - Step-by-step instructions starting with prep. Don't prefix with numbers.
118119 - A guess at calorie count and healthiness
119119- - Optional wine or beer pairing.
120120+ - Optional wine pairing guidance.
121121+ - Three wine or less wine styles.
120122121123# Planning & Verification
122124- Before generating each recipe, reference your checklist to ensure variety in cooking methods and cuisines, and confirm ingredient prioritization matches sale/seasonal data.`
···217219func (c *Client) buildRecipeMessages(location *locations.Location, saleIngredients []kroger.Ingredient, instructions string, date time.Time, lastRecipes []string) (responses.ResponseInputParam, error) {
218220 var messages []responses.ResponseInputItemUnionParam
219221 //constants we might make variable later
220220- messages = append(messages, user("Each recipe should serve 2 people."))
221221- messages = append(messages, user("generate 3 recipes"))
222222- messages = append(messages, user("Permitted cooking methods: oven, stove, grill, slow cooker"))
223223- //location and date for seasonal ingredientss
224222 messages = append(messages, user("Prioritize ingredients that are in season for the current date and user's state location "+date.Format("January 2nd")+" in "+location.State+"."))
223223+ messages = append(messages, user("Default: each recipe should serve 2 people."))
224224+ messages = append(messages, user("Default: generate 3 recipes"))
225225+ messages = append(messages, user("Default: cooking methods: oven, stove, grill, slow cooker"))
226226+ //location and date for seasonal ingredientss
225227226228 //Available ingredients (in TOON format for token efficiency)
227229 ingredientsMessage := "Ingredients currently on sale in TOON format\n"