flâneur — a map of the web's best reading

OpenAI/GPT: Returning consistent/valid JSON from a prompt | Mark Needham

markhneedham.com · 1,286 words · saved by 1 readers

In this post, we'll learn how to return a consistent and predictable JSON response to a sentiment analysis prompt in OpenAI/GPT.

27 Jul 2023 · gpt openai python til OpenAI/GPT: Returning consistent/valid JSON from a prompt When using OpenAI it can be tricky to get it to return a consistent response for a prompt. In this blog post, we’re going to learn how to use functions to return a consistent JSON format for a basic sentiment analysis prompt. I’ve created a video showing how to do this on my YouTube channel, Learn Data with Mark , so if you prefer to consume content through that medium, I’ve embedded it below: Let’s start by installing OpenAI and Pandas: pip install openai pandas And now, we’ll open a Python RE

Explore this link on the map →

related reading