Use OpenAI's ChatGPT in Python

  Рет қаралды 78,075

NeuralNine

NeuralNine

Күн бұрын

Today we learn how to use OpenAI's ChatGPT in Python.
OpenAI Platform: platform.openai.com/
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер: 61
@IzUrBoiKK
@IzUrBoiKK Жыл бұрын
2 years ago, i started learning python through your channel... Now i was searching for tutorials of chatgpt api with but was finding it hard to follow anyone. But is was really easy ans nostalgic for me because of your video. Good luck bro!
@veroverobrian
@veroverobrian Жыл бұрын
Coming as a C/C++/Java dev, learning Python from you is super helpful. I recognize every modality of my known languages, and seeing it in Python is just so nice to learn alongside. Many thanks!
@ricardo.alves.campos
@ricardo.alves.campos Жыл бұрын
Short, easy and well explained, congratulations for this video.
@tahlmilburn3565
@tahlmilburn3565 Жыл бұрын
Love your videos. Btw, strip() also remove chars so you don't need a separate step.
@bloodywolftr
@bloodywolftr Жыл бұрын
Thank you very much.Great content as always.
@giacomoferrari5624
@giacomoferrari5624 Жыл бұрын
Thanks brother, true OG , watched many of your vids
@farabihbk
@farabihbk Жыл бұрын
I'm waiting for it . Thx brother ❤❤
@paulthomas1052
@paulthomas1052 Жыл бұрын
Thanks - great demo 😀
@MateusMeurer
@MateusMeurer 11 ай бұрын
Man, this video was awesome thank you!
@rrahll
@rrahll Жыл бұрын
100 like is mine) thanks man for the helpful video.
@sahilsagwekar
@sahilsagwekar Жыл бұрын
Your channel is so underrated!!!
@D4narchy
@D4narchy 11 ай бұрын
You can remove a few lines of code for the final example with the walrus operator (i love it): "while (user_message := input()) != 'quit':"
@mtmanalyst
@mtmanalyst 7 ай бұрын
Very nice. Thank you
@ishratalikhan1231
@ishratalikhan1231 5 ай бұрын
Very nice Demo, I wanted to optimize oracle query, could you please suggest some good ideas to do so.
@dmk_weaver
@dmk_weaver 9 ай бұрын
Thanks! I always receive the error message that I exceeded my current quota. I'm sure I didn't. I have just created a new key and have not asked any questions since. Is anybody also experiencing this issue?
@julianhank1267
@julianhank1267 6 ай бұрын
yes i am also only receiving this message. It has been 3 months since your comment. Did you find a solution?
@YogeshKumar-kr1ke
@YogeshKumar-kr1ke 11 ай бұрын
THANK YOU SOOOOOOOO MUCH
@akhiluniyal9455
@akhiluniyal9455 10 ай бұрын
Do we have to subscribe to chat gpt plus ,to access gpt turbo 3.5?
@farzinkhaledi4394
@farzinkhaledi4394 Жыл бұрын
What do you think of the future of the Ai? Do you think it will take over the programmes world or not? And is it worth spending time to learn coding ?
@Brukrex
@Brukrex Жыл бұрын
Nobody knows just learn
@AK-zz9ok
@AK-zz9ok Жыл бұрын
The world of programming will definitely undergo significant changes due to AI, but I believe it's still definitely worth learning how to code. After all, we still need people to build the AIs.
@chaselsantos
@chaselsantos 6 ай бұрын
good video thank you
@BLACKDREAMIO
@BLACKDREAMIO 7 ай бұрын
what the f i didnt even use the api before its on new gmail account it says i hae exceeded the limit of useasge
@benjialexander5850
@benjialexander5850 7 ай бұрын
Imagine creating code with chatgpt integrated in the program that could check and trouble shout problems with code that you asked it to create for more refined and better performance, what if it could even come up with program ideas to fix a problem then develop it and even install it onto sum thing like a raspberry pie???? this is an exiting age indeed
@sushantpawar3703
@sushantpawar3703 Жыл бұрын
Informational video as usaul. What is name of intro music?
@MuhammadYasir-uc9xt
@MuhammadYasir-uc9xt 15 сағат бұрын
I have a project in python language which is a Plan text editor. I want to integrate it with open AI using API for the some purposes which are content suggetions, vocabulary suggetions, spell checker, grammar checker. kindly help me with it.
@kernelpanic2927
@kernelpanic2927 Жыл бұрын
Cool!
@bill123f2
@bill123f2 Жыл бұрын
In my terminal it says that the api key is not in any directory
@aduesh5120
@aduesh5120 Жыл бұрын
hello pls reply. how do i give the bot a personality like for example i want it to talk like sherlock holmes
@ingenieroriquelmecagardomo4067
@ingenieroriquelmecagardomo4067 Жыл бұрын
just tell it that, litterally "Try to talk like Sherlock Holmes"
@IronSnipEdits
@IronSnipEdits 4 ай бұрын
Love ❤
@fangaohua
@fangaohua Жыл бұрын
good video
@gergohorvath2538
@gergohorvath2538 Жыл бұрын
As this example shows It’s too slow to use it for e.g. speech to text conversion
@scarysticks66
@scarysticks66 Жыл бұрын
and expensive
@imangalinurkamalov5479
@imangalinurkamalov5479 7 ай бұрын
What you suggest to use? Other technologies from another companies? Just curious
@snehitvaddi
@snehitvaddi 11 ай бұрын
Why not provide the code you have used?
@WondrousHello
@WondrousHello Жыл бұрын
If you’re providing the entire chat log as context when having a conversation, will all previous messages count towards token usage? Just thinking that every new message becomes increasingly expensive.
@bluekeybo
@bluekeybo Жыл бұрын
From their website: "Prices are per 1,000 tokens. You can think of tokens as pieces of words, where 1,000 tokens is about 750 words." Yes, if you send the history, that counts towards your tokens.
@midprogramming
@midprogramming 9 ай бұрын
That's correct. Finding a way to summarize the conversation and passing that in for substituting memory is probably going to be your best bet
@deusopus
@deusopus Жыл бұрын
i just used chatgpt to write the code for me!
@JAGuy
@JAGuy 10 ай бұрын
Well what was the prompt
@Hazza0001
@Hazza0001 Жыл бұрын
🎉
@scotthjackson5651
@scotthjackson5651 2 ай бұрын
the code in this video doesn't work with the new version of the python openai library :( the new version changed basically everything shown in this video
@ajimustapha7943
@ajimustapha7943 Ай бұрын
can you pass files to chatgpt this way?
@VerticalBase
@VerticalBase Жыл бұрын
How do I create a chatGPT chatbot with python tkinter?
@KubaGacek-oy8uw
@KubaGacek-oy8uw 3 ай бұрын
gotch YA : from openai import OpenAI from tkinter import * root = Tk() root.title("Chat GPT") def get_response(): user_input = message_entry.get() API_KEY = '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' client = OpenAI(api_key=API_KEY) response = client.chat.completions.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": user_input}, ] ) text_content = response.choices[0].message.content chat_history.insert(END, " User: " + user_input) chat_history.insert(END, " Chat GPT: " + text_content) message_entry.delete(0, END) chat_history = Text(root) chat_history.pack() message_entry = Entry(root,width=50) message_entry.pack() send_button = Button(root, text="Ask", command=get_response, bg="blue", fg="white") send_button.pack() root.mainloop()
@angelus806
@angelus806 Жыл бұрын
is not working anymore
@philtoa334
@philtoa334 8 ай бұрын
Thx_.
@mohammadaqdas7998
@mohammadaqdas7998 Жыл бұрын
I got an error says that " module 'openai' has no attribute 'ChatCompletion' " Someone please help me!!!!!
@JAGuy
@JAGuy 10 ай бұрын
Did you solve it?
@mohammadaqdas7998
@mohammadaqdas7998 10 ай бұрын
@@JAGuy yes, the problem was i have the old python version, this library requires the latest one.
@JAGuy
@JAGuy 10 ай бұрын
@@mohammadaqdas7998 how exactly do you check to make sure you have the newest version I updated pycharm but I still see the error
@satishchekuri7664
@satishchekuri7664 11 ай бұрын
response['choices'][0]['message']['content'] --please explain this line
@jananirajendran1571
@jananirajendran1571 5 ай бұрын
{ "choices": [ { "finish_reason": "stop", "index": 0, "message": { "content": "The 2020 World Series was played in Texas at Globe Life Field in Arlington.", "role": "assistant" } } ], "created": 1677664795, "id": "chatcmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW", "model": "gpt-3.5-turbo-0613", "object": "chat.completion", "usage": { "completion_tokens": 17, "prompt_tokens": 57, "total_tokens": 74 } } This is the structure of the response
@user-cw7ym2nx9g
@user-cw7ym2nx9g 3 ай бұрын
tôi mún đc hướng dẫn file API_KEY tại tôi ko add đc
@ventiladorbueno1846
@ventiladorbueno1846 Жыл бұрын
👍🙏👍🙏👍
@eviehartman2895
@eviehartman2895 11 ай бұрын
New to Python here: Am I the only one who's bothered by the fact that "response" is spelled "respone" in this video? Is that actually how it's supposed to be spelled?
@MichaelShingo
@MichaelShingo 11 ай бұрын
lol you can call it whatever you want, he mispelled it
@Imenigmars
@Imenigmars 3 ай бұрын
He did spell it wrong, but it doesn't matter because he spelled it the same way when he used it again in the print line. If he had spelled it "repone = blah blah", and then done print(response), he would have gotten an error.
26 Incredible Use Cases for the New GPT-4o
21:58
The AI Advantage
Рет қаралды 251 М.
Modern Graphical User Interfaces in Python
11:12
NeuralNine
Рет қаралды 1,4 МЛН
Follow @karina-kola please 🙏🥺
00:21
Andrey Grechka
Рет қаралды 19 МЛН
Зу-зу Күлпәш.Курс (6 бөлім)
40:48
ASTANATV Movie
Рет қаралды 562 М.
Build Anything With ChatGPT, Here’s How
1:24:05
David Ondrej
Рет қаралды 931 М.
How good is the latest version of ChatGPT? | BBC News
23:16
BBC News
Рет қаралды 100 М.
Build a Python Web App to chat with your datasets using GenAI
4:23
Tech at Worldline
Рет қаралды 17 М.
The OpenAI (Python) API | Introduction & Example Code
23:46
Shaw Talebi
Рет қаралды 17 М.
Intelligent AI Chatbot in Python
35:42
NeuralNine
Рет қаралды 915 М.
GPT-4o Deep Dive & Hidden Abilities you should know about
28:11
Which Phone Unlock Code Will You Choose? 🤔️
0:14
Game9bit
Рет қаралды 9 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 4,4 МЛН
Обманет ли МЕНЯ компьютерный мастер?
20:48
Харчевников
Рет қаралды 145 М.
Apple Event - May 7
38:32
Apple
Рет қаралды 6 МЛН