3 Comments
author

In this article I didn't go too deep into ensuring the JSON response was properly formatted, but in the book we tackle this problem more seriously and build a safe JSON parser that most of the time ensures the response is not only valid JSON, but actually conforms to a user-defined class. Feel free to ask if you want more details.

Expand full comment
Jun 26Liked by Alejandro Piad Morffis

I bought your book and tried to run the code, but I keep getting exceptions that seem to be related to the JSON problem. But actually, I want to run your code with OpenAI endpoints. Maybe that works better. At least in other projects my experiences with having GPT-4(o) produce JSON output were pretty good.

Expand full comment
author

Yes, GPT4 is much better at JSON. I want to change the code to use the openai endpoints by default at some point.

Expand full comment