Create your own AI chat bot with ease using GPT-4 API!

preview_player
Показать описание
I'll walk you through making a simple chat bot that uses the GPT-4 API. You can customize the bot and even share it with friends!

Chat bot code:
! pip install openai
! pip install gradio

import openai
import gradio

messages = [{"role": "system", "content": "You are a life advice bot. You have personality of a California surfer bro, and answer every question from a surfer bro tone"}]

def CustomChatGPT(user_input):
model = "gpt-4",
#model = "gpt-3.5-turbo",
messages = messages
)
ChatGPT_reply = response["choices"][0]["message"]["content"]
return ChatGPT_reply

demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "Advice Bro")

Other Videos:

#ai #artificialintelligence #chatgpt #api #chatgpt4 #gpt4 #learnpython #openai #llm #gpt3 #howto #tutorial #tech #technology #python #aitechnology #chatbot #stepbystep #aitraining #beginner #aichatbots #aichatbot #chatgpt #openai
Рекомендации по теме
Комментарии
Автор

The Surfer AI is the best personality ever! Some langchain, few agents, and a prioritization matrix would make this killer way to interact and get stuff done.

collectivelogic
Автор

Love your vidéo ! Please create a tutorial to fine-tune chat GPT with you own client support question 🤞

GuillaumeNattyFitness
Автор

I've watched 3 of your videos and found them all to be really interesting and useful. Thanks!! You teach well. Liked and subscribed. P.S. you might want to remove your OpenAI key from the colab.

newcooldiscoveries
Автор

This is such a great video covering the process, step by step! Thank you for this. I just have a question. How many system messages would be too many for giving it context?

KevinLe
Автор

I jsut did this but it is showing an error. How come !?!?

agoldman
Автор

Awesome, thank you! Do you know how to add memory to this, so it functions more like a chatbot that remembers previous prompts and responses?

UnchartedDiscoveries
Автор

I'm wondering about the cost, based on tokens. On each user input, you send the whole conversation (previous prompts and responses + new prompt). I guess it's required because there's no "conversation session", right? Do you know if the number of tokens for pricing is always the total number of tokens in all the messages[*]["content"]? Or only the ones in the last message?

PS: And thanks for this video 😀

ppolleunus
Автор

Great Video. I still could get the access for the gpt 4 even after applying it multiple times. Could you help with how can I access gpt 4 at the earliest?

manojkumarreddy
Автор

This doesn't work anymore, I've tried to fix it myself but nope, please help.

AvaHolst-ih
Автор

Very easy ! Thanks
Can you do the same for GPT Fine tune ?

Fhdixjfhdkkzbfkjxidj
Автор

How can you take the output from google colab and add it to a website for people to use considering the shared link goes away after 3 days?

Ojordanfootball
Автор

Works great for me with turbo, but "gpt-4" simply gives me an "error" in the reply box. Anyone else have this issue, and if so, were you able to resolve it?

SuperBird
Автор

Is GPT 4 paid monthly or just one time payment?

Dexsaixec