ChatGPT API in Python

preview_player
Показать описание
Exploring the ChatGPT (GPT3.5) API from OpenAI and building some simple chat applications with it.

Contents:
0:00 - Why use the ChatGPT API
2:10 - How to query the ChatGPT API
7:45 - History and dynamic input w/ ChatGPT API
15:30 - Comining everything so far
18:25 - Building a Gradio chat application with ChatGPT
Рекомендации по теме
Комментарии
Автор

I have always loved that you don't edit out errors and mistakes, and show us your process of trying to understand them.

isaacandrewdixon
Автор

This is a beginning for numerous of startups

krzysiek
Автор

I love how simple the API is! We really are in the gold rush of AI based applications.

CodingWithLewis
Автор

I was about to write "you don't need an API key" but then I did a sanity check. I thought I was using `gpt-3.5-turbo` API for free, but what's actually true is ... if OPENAI_API_KEY is in your environment variables, then `import openai` will automatically find that key and use it.

I'd previously set the env var for testing `text-davinci-003` (GPT-3) AND I'd included `openai.api_key = os.getenv('OPENAI_API_KEY')` in my code, but when I tested `gpt-3.5-turbo` for the first time I forgot the second line and then when it worked I assumed they'd removed the need for a key.

Great video! Thanks!

riveradam
Автор

I started watching your videos in 2017 in college. Thanks to you and specifically your pygame series I'm a mid level SWE

fordtify
Автор

Total side note but I wanted to tell you how amazing your Neural Networks from Scratch book is. Ive started down a few roads with NNs and I normally prefer video but you have really made it so clear and so much fun to learn. Congratulations on creating the perfect technology book!

GiantsOnTheHorizon
Автор

Who has been waiting for this for a long time now?

raomuhammadsharjeel
Автор

In my experience, the system role is really useful for things like restraining the bot as to what it can do, and also to give it some background information like how it would like to be called or what tasks it can perform. So when the user asks :" what can you do for me ?" The chatbot can answer what the system says it will be able to do or what it's main purpose is, and the personality you want the bot to have.
The system message may be something like "You are a language translation helping bot, you cannot talk about anything else, your name is Bob and you are a stern but calm teacher."

funkahontas
Автор

I’ve been a sub of your for years, funny thing is I am not a programmer, or even remotely work in the field you produce videos on. I just love watching your curiosity take you around the j Ferber and take your time to teach others. Well done mate

yellowboat
Автор

Greatest guy on the internet, always loved the way you follow your passion and work not on just some classical stuff but playing with whatever is interesting for you

If you’ll ever want to work on AI-aided chemistry/medicine - our Chemistry and Artificial Intelligence lab in ITMO university is fully open for you 🥰

Continue making great stuff 👍

nikitaserov
Автор

Amazing!!! Thank you!!! I was always waiting for this!!

I have notifications set for your channel but I never get any notifications, also I didn't even see any of your videos for the past year on my feed or anything

awesomefeldmanfamily
Автор

Bro. This is a great tutorial. Most other people are just publishing some nonsense gpt-api stuff. You are bit of a whacko (compliment) but i 😍 your speed of tutoring. You did not waste our time by going back to check on AI reply about which moon it was sizing. Great stuff dude.

naidol
Автор

The longer between this video and your next one, the more excited I get.😂😂

nuclear_AI
Автор

I used the api to make a chat bot for my discord community, but they used it too much, and I could not afford to keep it going, but man having a group chat with AI is crazy.

edellenburg
Автор

A big thanks from an Indian. Amazing stuff you post. God bless you.

samahirrao
Автор

Amazing! I am building a cocktail maschine with this. I recognise voice with speech to text, feed it into the API. Like "I want a martini please", I will feed in with the custom add on to convert the cocktail to a json with a given format, my cocktail machine can use and make a cocktail with. :)

schlechtestergtaspielerdek
Автор

It's quite interesting. I try to make it a role with the "spell" : "You are a well-trained AI multi-task language translator. When I input non-Chinese sentences, you should output Chinese translation sentences. While I input Chinese sentences, you should output Vietnamese. You only need to ouput the translation result, no need other words or explanation. If you understand, say OK."
It succeed in the first, but with more sentences input, it confused, even I input a chinese sentence, it return a chinese sentence "translation" (which is the same words because no need to translate) but not a vietnamese one. I'm not sure why but it just can't understand or forget the tasks when I input like 5~6 non-chinese sentences and some chinese sentences.

sptoo
Автор

Your awesome. Keep making simple videos like this! I just subscribed because of how simple this was.

real_Emmanuel
Автор

System is where I define the persona of the bot, any special instructions, and most importantly, where I dump any additional information that will be useful to the bot. Text retrieved using semantic search, summarized chat logs from previous conversations etc.

generichuman_
Автор

I wonder where the conversations would end up if you have another ChatGPT model play the role of the user

tielessin