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
related reading
- Perplexityperplexity.ai
- Cookbookcookbook.openai.com
- Parsed | Custom, interpretable AI systems that continuously learnparsed.com
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com
- AI Model & API Providers Analysis | Artificial Analysisartificialanalysis.ai
- GitHub - 567-labs/instructor: structured outputs for llmsgithub.com
- OpenAI | Research & Deploymentopenai.com
- Prompt generation | OpenAI APIplatform.openai.com
- GPT-4o doesn't consistently respect JSON schema on tool usecommunity.openai.com
- Prompt engineering | OpenAI APIplatform.openai.com
- Prompting best practicesdocs.anthropic.com
- undefined - YouTubeyoutube.com