Create a Recipe with ChatGPT

Use ChatGPT to generate a recipe that will adhere to certain constraints.

The Dinner Party Preparations

We’ve all been there. It’s our turn to plan a nice party for our friends and family, and we’ve decided to make it a dinner party. The only issue is that we don’t know what to cook for dinner! Luckily, ChatGPT can help us find the perfect recipe to accommodate all our party guests.

Setting a Context - Techniques with ChatGPT

To help us with a recipe, we must first set the context for ChatGPT. When setting the context of a request using ChatGPT (in this case that it must create a recipe), several techniques can be employed to ensure clear communication and improve the quality of the response. Firstly, it is important to provide a concise and specific introduction, clearly stating the purpose of the request. Including relevant background information, such as previous conversations or related topics, helps establish context and aids the model in understanding the specific problem or question at hand. Additionally, using bullet points or numbered lists to break down complex requests into smaller, manageable parts, can assist in maintaining clarity. When appropriate, providing examples, specific details, or specifications can further enhance the model’s understanding and accuracy in generating a response when appropriate. Lastly, using proper formatting, and maintaining a conversational tone, can foster productive interaction.

Here’s an example:

Prompt:

Pretending you are a world-class chef, please generate a recipe for a delicious chocolate cake.

By specifying the type of recipe (chocolate cake) in the prompt, we inform ChatGPT about the desired output. It’s also helpful to mention any specific requirements or preferences we have, such as dietary restrictions, preferred ingredients, or cooking methods. For instance:

Prompt:

Please generate a vegan recipe for a delicious chocolate cake using alternative ingredients and without using any animal products.

With this additional information, ChatGPT can tailor the recipe to our specific needs and preferences. Feel free to adjust the prompt consistent with our requirements to get the desired recipe.

Our Dinner Party ChatGPT Prompt

With all the details of the party gathered, we can feed ChatGPT a prompt that sets the context of our dinner party and covers the details specific to the needs of the party guests.

Prompt:

I am hosting a dinner party and need assistance creating a recipe that accommodates various dietary restrictions, food allergies, and specific food preferences. Please generate a recipe that satisfies the following requirements:

1. Three guests are attending the dinner party: John, Lisa, and Sarah.
2. John follows a vegetarian diet and cannot consume any meat or fish.
3. Lisa has a gluten allergy and cannot have any wheat, barley, or rye products.
4. Sarah is lactose intolerant and cannot consume any dairy products.
5. All guests love Italian cuisine and prefer a pasta-based dish.
6. Please ensure the recipe is flavorful, well-balanced, and visually appealing.

Please generate a recipe that considers these dietary restrictions, food allergies, and preferences. Feel free to ask for any additional information if needed.

Recipe Results from ChatGPT

ChatGPT responds to the provided prompt by generating the following response:

As an AI language model, I can certainly help you create a recipe that accommodates the dietary restrictions, food allergies, and preferences of your dinner party guests. Here's a recipe that aligns with the given requirements:

Recipe: Vegan Eggplant Parmesan Pasta

Ingredients:
- 1 large eggplant, sliced into rounds
- 1 cup breadcrumbs (gluten-free, if desired)
- 1 teaspoon dried oregano
- 1 teaspoon dried basil
- 1/2 teaspoon garlic powder
- Salt and pepper to taste
- 2 cups marinara sauce (check for gluten-free and dairy-free options)
- 8 ounces gluten-free pasta (such as rice or corn pasta)
- Fresh basil leaves, for garnish
- Olive oil, for cooking

Instructions:
1. Preheat the oven to 375°F (190°C).
2. In a shallow bowl, combine the breadcrumbs, dried oregano, dried basil, garlic powder, salt, and pepper.
3. Dip each eggplant slice into the breadcrumb mixture, coating both sides evenly.
4. Heat a drizzle of olive oil in a large skillet over medium heat. Cook the breaded eggplant slices for about 3-4 minutes per side, or until golden brown. You may need to cook them in batches. Place the cooked slices on a paper towel-lined plate to absorb any excess oil.
5. Cook the gluten-free pasta according to the package instructions until al dente. Drain and set aside.
6. In a separate saucepan, heat the marinara sauce over low heat until warmed through.
7. In a baking dish, spread a thin layer of marinara sauce on the bottom. Arrange a single layer of the cooked eggplant slices over the sauce.
8. Pour a portion of the remaining marinara sauce over the eggplant slices, spreading it evenly.
9. Add a layer of cooked gluten-free pasta on top of the sauce.
10. Repeat steps 7-9, creating layers until all the ingredients are used, finishing with a layer of marinara sauce on top.
11. Cover the baking dish with aluminum foil and bake for 25-30 minutes, or until the dish is heated through and the flavors meld together.
12. Remove from the oven and let it rest for a few minutes.
13. Garnish with fresh basil leaves before serving.

This recipe for Vegan Eggplant Parmesan Pasta is a flavorful and visually appealing option that satisfies the dietary restrictions and food preferences of your guests. It combines the beloved flavors of Italian cuisine with a vegan twist, making it suitable for John's vegetarian diet, Lisa's gluten allergy, and Sarah's lactose intolerance. Enjoy your dinner party!

This prompt sets the context for ChatGPT to generate a recipe suitable for a dinner party, taking into account the dietary restrictions, food allergies, and specific food preferences of the guests. It provides the necessary information and encourages ChatGPT to seek further clarification if required to create a well-suited recipe.

2 - Modifying Results Generated by ChatGPT

The recipe generated by ChatGPT is perfect for our dinner party guests except for one ingredient: garlic powder, which we don’t like. We can ask ChatGPT to update our recipe with a modification request.

Modification Prompt

In the same ChatGPT chat session, express the need to replace garlic powder with an alternate ingredient.

Prompt:

Thank you for the recipe. I'd like to use a substitute instead of garlic powder. Please regenerate this recipe with an alternate ingredient to garlic powder.

Modified Recipe Results from ChatGPT

ChatGPT will regenerate the recipe and replace garlic powder with fresh garlic. Here is an example of a modified response:

Certainly! Here's an updated version of the recipe using an alternative ingredient to garlic powder:

Recipe: Vegan Eggplant Parmesan Pasta

Ingredients:
- 1 large eggplant, sliced into rounds
- 1 cup breadcrumbs (gluten-free, if desired)
- 1 teaspoon dried oregano
- 1 teaspoon dried basil
- 2 cloves of garlic, minced
- Salt and pepper to taste
- 2 cups marinara sauce (check for gluten-free and dairy-free options)
- 8 ounces gluten-free pasta (such as rice or corn pasta)
- Fresh basil leaves, for garnish
- Olive oil, for cooking

Instructions:
1. Preheat the oven to 375°F (190°C).
2. In a shallow bowl, combine the breadcrumbs, dried oregano, dried basil, minced garlic, salt, and pepper.
3. Dip each eggplant slice into the breadcrumb mixture, coating both sides evenly.
4. Heat a drizzle of olive oil in a large skillet over medium heat. Cook the breaded eggplant slices for about 3-4 minutes per side, or until golden brown. You may need to cook them in batches. Place the cooked slices on a paper towel-lined plate to absorb any excess oil.
5. Cook the gluten-free pasta according to the package instructions until al dente. Drain and set aside.
6. In a separate saucepan, heat the marinara sauce over low heat until warmed through.
7. In a baking dish, spread a thin layer of marinara sauce on the bottom. Arrange a single layer of the cooked eggplant slices over the sauce.
8. Pour a portion of the remaining marinara sauce over the eggplant slices, spreading it evenly.
9. Add a layer of cooked gluten-free pasta on top of the sauce.
10. Repeat steps 7-9, creating layers until all the ingredients are used, finishing with a layer of marinara sauce on top.
11. Cover the baking dish with aluminum foil and bake for 25-30 minutes, or until the dish is heated through and the flavors meld together.
12. Remove from the oven and let it rest for a few minutes.
13. Garnish with fresh basil leaves before serving.

In this updated version, ChatGPT replaced the garlic powder with minced garlic for a more natural and robust garlic flavor.

3 - Skill Level and Equipment Specifications in ChatGPT Recipes

Now that the recipe’s ingredients adhere to the cook’s preferences, we can take a closer look at techniques, terminology, and equipment needs. In our scenario, the cook is a beginner and doesn’t know what a garnish is.

Skill Level and Clarification Prompt(s)

Take the opportunity to learn from ChatGPT by requesting clarification of the term “garnish” in the context of the recipe by letting ChatGPT know you’ll need more information about garnishing a dish, but explained at a beginner level.

Prompt:

Great! I am a beginner at cooking and I need help understanding what "Garnish with fresh basil leaves before serving" means. Please explain this step in more detail.

ChatGPT may respond with a similar response to this:

Certainly! "Garnish with fresh basil leaves before serving" means adding fresh basil leaves as a decorative and flavorful finishing touch to your dish just before you are ready to serve it. Here's a step-by-step explanation of the garnishing process:

1. Once your Vegan Eggplant Parmesan Pasta is cooked and out of the oven, remove it from the heat and let it rest for a few minutes to allow the flavors to meld together.
2. Take a few fresh basil leaves and gently tear them into smaller pieces or leave them whole, depending on your preference.
3. Sprinkle or scatter the torn or whole basil leaves on top of the dish. You can distribute them evenly or arrange them in a visually appealing manner.
4. The fresh basil leaves will add a vibrant pop of color to the dish and enhance its aroma and flavor.
5. Once you have garnished the dish with the basil leaves, it is now ready to be served to your guests.

Garnishing with fresh basil leaves not only adds an aesthetic element to your dish but also provides a pleasant herbal note that complements the Italian flavors in the recipe. Enjoy your beautifully garnished Vegan Eggplant Parmesan Pasta at your dinner party!

Update Recipe with Garnish Instructions

Now, update the recipe to include the clarified garnish instructions:

Thank you! Now, compile the previous explanation into the recipe recently provided.

The updated recipe will look something like this:

Certainly! Here's the updated recipe with a detailed explanation of the garnishing step included:

Recipe: Vegan Eggplant Parmesan Pasta

Ingredients:
- 1 large eggplant, sliced into rounds
- 1 cup breadcrumbs (gluten-free, if desired)
- 1 teaspoon dried oregano
- 1 teaspoon dried basil
- 2 cloves of garlic, minced
- Salt and pepper to taste
- 2 cups marinara sauce (check for gluten-free and dairy-free options)
- 8 ounces gluten-free pasta (such as rice or corn pasta)
- Fresh basil leaves, for garnish
- Olive oil, for cooking

Instructions:
1. Preheat the oven to 375°F (190°C).
2. In a shallow bowl, combine the breadcrumbs, dried oregano, dried basil, minced garlic, salt, and pepper.
3. Dip each eggplant slice into the breadcrumb mixture, coating both sides evenly.
4. Heat a drizzle of olive oil in a large skillet over medium heat. Cook the breaded eggplant slices for about 3-4 minutes per side, or until golden brown. You may need to cook them in batches. Place the cooked slices on a paper towel-lined plate to absorb any excess oil.
5. Cook the gluten-free pasta according to the package instructions until al dente. Drain and set aside.
6. In a separate saucepan, heat the marinara sauce over low heat until warmed through.
7. In a baking dish, spread a thin layer of marinara sauce on the bottom. Arrange a single layer of the cooked eggplant slices over the sauce.
8. Pour a portion of the remaining marinara sauce over the eggplant slices, spreading it evenly.
9. Add a layer of cooked gluten-free pasta on top of the sauce.
10. Repeat steps 7-9, creating layers until all the ingredients are used, finishing with a layer of marinara sauce on top.
11. Cover the baking dish with aluminum foil and bake for 25-30 minutes, or until the dish is heated through and the flavors meld together.
12. Remove from the oven and let it rest for a few minutes.
13. Garnish with fresh basil leaves by taking a few leaves and tearing them into smaller pieces or leaving them whole. Sprinkle or scatter the torn or whole basil leaves on top of the dish, distributing them evenly or arranging them in a visually appealing manner.
14. The fresh basil leaves will add a vibrant pop of color to the dish and enhance its aroma and flavor.
15. Once garnished, the Vegan Eggplant Parmesan Pasta is ready to be served to your guests.

This updated version of the recipe includes a detailed explanation of the garnishing step to help you understand how to add the fresh basil leaves as a finishing touch to the dish. Enjoy your beautifully garnished Vegan Eggplant Parmesan Pasta at your dinner party!

Equipment Consideration Prompt

In some recipes generated by ChatGPT, there may be some equipment needed that we don’t have. We can ask ChatGPT to consider our equipment limitations and update the recipe to use only the tools we have available.

Prompt:

Oh, wait! I don't have a separate saucepan or a baking dish. What I do have is a skillet and a pot. Please update the recipe so that I can use the tools available to me.

ChatGPT will make the necessary adjustments to the recipe:

Certainly! Here's an updated version of the recipe that utilizes a skillet and a pot instead of a separate saucepan and baking dish:

Recipe: Vegan Eggplant Parmesan Pasta

Ingredients:
- 1 large eggplant, sliced into rounds
- 1 cup breadcrumbs (gluten-free, if desired)
- 1 teaspoon dried oregano
- 1 teaspoon dried basil
- 2 cloves of garlic, minced
- Salt and pepper to taste
- 2 cups marinara sauce (check for gluten-free and dairy-free options)
- 8 ounces gluten-free pasta (such as rice or corn pasta)
- Fresh basil leaves, for garnish
- Olive oil, for cooking

Instructions:
1. Preheat the oven to 375°F (190°C).
2. In a shallow bowl, combine the breadcrumbs, dried oregano, dried basil, minced garlic, salt, and pepper.
3. Dip each eggplant slice into the breadcrumb mixture, coating both sides evenly.
4. Heat a drizzle of olive oil in a skillet over medium heat. Cook the breaded eggplant slices for about 3-4 minutes per side, or until golden brown. You may need to cook them in batches. Place the cooked slices on a paper towel-lined plate to absorb any excess oil.
5. Cook the gluten-free pasta in a pot according to the package instructions until al dente. Drain and set aside.
6. In the same skillet used for cooking the eggplant, add the marinara sauce and heat it over low heat until warmed through.
7. Arrange a single layer of the cooked eggplant slices in the skillet on top of the marinara sauce.
8. Pour a portion of the remaining marinara sauce over the eggplant slices, spreading it evenly.
9. Add a layer of cooked gluten-free pasta on top of the sauce.
10. Repeat steps 7-9, creating layers until all the ingredients are used, finishing with a layer of marinara sauce on top.
11. Cover the skillet with a lid or aluminum foil and cook on low heat for 10-15 minutes, allowing the flavors to meld together.
12. Remove from heat and let it rest for a few minutes.
13. Garnish with fresh basil leaves by taking a few leaves and tearing them into smaller pieces or leaving them whole. Sprinkle or scatter the torn or whole basil leaves on top of the dish, distributing them evenly or arranging them in a visually appealing manner.
14. The fresh basil leaves will add a vibrant pop of color to the dish and enhance its aroma and flavor.
15. Once garnished, the Vegan Eggplant Parmesan Pasta is ready to be served to your guests directly from the skillet.

With these adjustments, you can now prepare and serve the Vegan Eggplant Parmesan Pasta using a skillet and a pot. Enjoy your deliciously prepared meal!

Modifying results in ChatGPT is as easy as asking it to replace an item with an alternative. Whether it’s simple modifications or more advanced modifications to our dinner party recipe, ChatGPT is equipped to handle what we toss at it to create the perfect recipe for an inclusive dinner party.

To see what else you can do with ChatGPT (or generative AI in general), checkout some of the articles located here: AI Articles.

Author

Codecademy Team

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

Meet the full team