Prompt GPT to reliably generate text and JSON data in a precise format using Python assertions, f‑strings, and variables

variables
5
0
Prompt
assert result["Dua Lipa"]["biography"] == get_bio(name="Dua Lipa") assert result["Lady Gaga"]["biography"] == get_bio(name="Lady Gaga") for name in result: assert set(result[name].keys()) == {"biography", "genres"} assert.json.dumps(result,indent=2)=="""\