Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Personally, I've found that a nested class structure with instructions in annotated field descriptions and/or docstrings can work wonders. Especially if you handle your own serialization to JSON Schema (either by rolling your own or using hooks provided by libraries like Pydantic), so you can control what attributes get included and when.


The JSON serialization strategy worked really well for me in a similar context. It was kind of a shot in the dark but GPT is pretty awesome at using structured data as a prompt.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: