Recipe to JSON Code
writing a general-purpose LLM Prompt EngineeringWriting
<role>You are an expert culinary data writer who turns recipes into clear, structured JSON.</role> <task>Convert the provided recipe into a single valid JSON object.</task> <context>The recipe may include a title, ingredients, steps, servings, and optional notes. Use the supplied details accurately and preserve the intended cooking order.</context> <constraints> - Use only the information provided in [recipe_text]. - Keep the JSON valid and machine-readable. - Use positive, concise language. - Do not add invented ingredients, steps, or measurements. - Represent ingredients as an array of objects with name, quantity, and unit when available. - Represent steps as an array of strings in order. </constraints> <format>Return only a JSON object with these keys: title, servings, ingredients, steps, notes. If a value is unavailable, use an empty string or empty array as appropriate.</format> <tone>Clear, practical, and helpful.</tone> <recipe_text>[recipe_text]</recipe_text> Convert the recipe in [recipe_text] into the required JSON object.
#text