No video

Get structured Json Output from OpenAI GPT API Consistently!

  Рет қаралды 8,205

Hubel Labs

Hubel Labs

Жыл бұрын

UPDATE: in openAI DevDay, they announced new functionality to improve consistency of JSON output. check out the details here: platform.opena...
Colab Workbook with code: colab.research...
Includes few-shot learning with function calling demo!
Using OpenAI's Chat Completion API, we explore two different ways of getting structured JSON output out from GPT rather than a blob of free text - For example, if you wanted to get the output returned as a list or as a dictionary of key-value pairs or even more completed schemas!
In the first method, we just use prompt engineering to describe what we want the output schema to be in free text. However, this gets a bit hairy when the schema gets more complicated. So as an alternative, we also explore a second method.
In this second method, we use function calling. But instead of using it to actually call a function, we just take the arguments as our output.
However, when the schema gets more complicated, GPT has trouble filling in all of the required arguments. So we also show you how to do "Few-Shot Learning" for function calling to teach GPT a few real worked examples to improve it's ability to consistently deliver the output you want!

Пікірлер: 14
@valentind.5398
@valentind.5398 9 ай бұрын
I'm glad I found the hidden gem your channel is! Thank you for sharing
@JOHNSMITH-ve3rq
@JOHNSMITH-ve3rq 6 ай бұрын
Ah loving this chan. Forgot about it. It’s the bomb!!!
@kunalr_ai
@kunalr_ai 9 ай бұрын
Hidden gem Channel
@AnkitSharma-rh2hs
@AnkitSharma-rh2hs 11 ай бұрын
Just what I was looking for. Thank you for this amazing info!! 😊
@bobjake4381
@bobjake4381 9 ай бұрын
This is a great video! Can you please make another one to get back consistent responses using json format now that devday happened? I am curious about using the api to parse through input data and returning data consistently. Very helpful channel!
@hubel-labs
@hubel-labs 9 ай бұрын
Thanks for the suggestion! Will add to my list!
@arun7291
@arun7291 11 ай бұрын
Thank you! this helped out alot with the project I am building!
@notgreen11
@notgreen11 10 ай бұрын
thanks, this is exactly what I needed
@InnocenceVVX
@InnocenceVVX 9 ай бұрын
Great video. I think chatGPT will have problems doing math like word count for the foreseeable future. At its core the LLM predicts the next word. Using it to do math is just using the wrong tool for the job until Open AI implements some additional math layer on top of the model.
@hubel-labs
@hubel-labs 9 ай бұрын
GPT uses code interpreter for more numerical tasks these days.
@thisiscrispin
@thisiscrispin 7 ай бұрын
You mention providing examples in the end, but do I see that correctly that you never feed those into an API call to openai?
@hubel-labs
@hubel-labs 7 ай бұрын
U mean the few shot learning part? At 11:33, and also at 13:36, when I ran those cells, the examples did get passed in to the API call to get the json output result. Not sure if that helps to answer your question. The way that I’m using function calling here is a bit of a hack. If you want to see how it is intended to work, can watch this one: OpenAI Assistants API - Part 2: using Agents with function calling together with info retrieval kzfaq.info/get/bejne/eLxdkpiQ15qam3k.html
@thomassmith1598
@thomassmith1598 10 ай бұрын
Awesome awesome awesome!!!
@hubel-labs
@hubel-labs 10 ай бұрын
Thanks!!
OpenAI Structured Output - All You Need to Know
24:46
Dave Ebbelaar
Рет қаралды 21 М.
Harley Quinn's desire to win!!!#Harley Quinn #joker
00:24
Harley Quinn with the Joker
Рет қаралды 6 МЛН
天使救了路飞!#天使#小丑#路飞#家庭
00:35
家庭搞笑日记
Рет қаралды 63 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 22 МЛН
GPT function calling in a nutshell
15:36
Henrik Kniberg
Рет қаралды 41 М.
ChatGPT Functions - Full Tutorial for using OpenAI Functions
29:14
Adrian Twarog
Рет қаралды 89 М.
The ULTIMATE Guide to ChatGPT 4o | Beginner to Advanced
24:43
Futurepedia
Рет қаралды 267 М.
A Hackers' Guide to Language Models
1:31:13
Jeremy Howard
Рет қаралды 520 М.
Creating Custom GPT with Complex Outside Actions Using API Endpoints
21:24
Automate With Chris
Рет қаралды 3,3 М.
New Prompt Generator Just Ended the Need for Prompt Engineering
10:43
Skill Leap AI
Рет қаралды 117 М.
Harley Quinn's desire to win!!!#Harley Quinn #joker
00:24
Harley Quinn with the Joker
Рет қаралды 6 МЛН