ChatGPT in Python for Beginners - Build A Chatbot

The AI Advantage
7 Mar 202314:24

Summary

TLDRThis tutorial guides beginners through creating three versions of a ChatGPT-powered chatbot using Python and Visual Studio Code. It starts with a simple script that prompts ChatGPT to write an essay, progresses to a customizable chatbot with memory, and culminates in a web-hosted chatbot accessible to others. The video emphasizes ease of use, cost-effectiveness, and the potential for further customization, encouraging viewers to explore coding and AI technology.

Takeaways

  • ๐Ÿ˜€ The tutorial aims to guide beginners through building three versions of a ChatGPT-powered chatbot, varying in complexity and features.
  • ๐Ÿ› ๏ธ To start, you need an IDE like Visual Studio Code, Python installed on your machine, and an API key from OpenAI.
  • ๐Ÿ”‘ The API key from OpenAI is essential for integrating the ChatGPT language model into your application.
  • ๐Ÿ“ A starter folder is provided for users to follow along, which can be downloaded from a link in the video description or from the presenter's GitHub account.
  • ๐Ÿ’ก The first app is a simple script that prompts ChatGPT to write an essay about penguins, demonstrating the basic use of the OpenAI package in Python.
  • ๐Ÿ“ The script includes importing the OpenAI package, setting the API key, and making a request to the GPT-3.5 Turbo model with a user prompt.
  • ๐Ÿ“‘ The second app, based on Greg Baugues' blog post, allows for a back-and-forth conversation with ChatGPT that remembers previous inputs.
  • ๐Ÿ”„ The conversation history is maintained by appending each new user input and ChatGPT's response to a list that is continually fed into the API.
  • ๐ŸŒ The third app uses Gradio to create a web-based chatbot that can be shared and accessed through a URL, showcasing the potential for customization.
  • ๐Ÿ”ง Customization of the chatbot involves editing the script to change the role and responses of the ChatGPT model, such as setting it up as a psychologist.
  • ๐Ÿ“ฑ The web-based chatbot can be accessed on different devices, including mobile phones, by sharing the .gradio.live URL.
  • โ“ For troubleshooting and further learning, the presenter suggests consulting the OpenAI documentation and using ChatGPT for specific coding queries.

Q & A

  • What are the three versions of ChatGPT-powered chatbots discussed in the script?

    -The script discusses three versions: 1) An extremely simple version accessible to beginners, 2) A customizable version that allows back-and-forth conversation, and 3) A web-hosted version that can be shared with friends.

  • What is an IDE and why is Visual Studio Code recommended in the script?

    -An IDE is an Integrated Development Environment, an application for coding. Visual Studio Code is recommended because it's free, popular, and the script's author uses it, with many tutorials available for setup.

  • Why is Python installed on the machine as part of the setup process?

    -Python is installed because it's the programming language used to interact with the OpenAI API and build the chatbot applications discussed in the script.

  • What is the purpose of obtaining a secret key from OpenAI?

    -The secret key from OpenAI is used to authenticate and allow the script to access the OpenAI API, enabling the integration of the ChatGPT language model into the applications.

  • How does the script suggest obtaining the OpenAI secret key?

    -The script suggests creating an OpenAI account and generating an API key through a provided URL, which is the same account used to log into ChatGPT.

  • What is the role of the 'OpenAI' package in the script?

    -The 'OpenAI' package is a Python package that simplifies the implementation of the OpenAI API, allowing the script to easily send requests to the ChatGPT model.

  • What is the significance of the 'print' command in the script?

    -The 'print' command is used to display text in the terminal, showing the responses from the ChatGPT model after processing the prompts.

  • Why is the Gradio package used in the third app?

    -The Gradio package is used to create a web-based interface for the chatbot, allowing users to interact with the ChatGPT model through a browser.

  • How can the chatbot be customized in the third app?

    -The chatbot can be customized by modifying the script, particularly the 'messages' variable and the function that interacts with the ChatGPT API, to change the chatbot's role and responses.

  • What is the advantage of using the script's method over using ChatGPT directly in the browser?

    -The script's method is more cost-effective, as it uses the new GPT 3.5 Turbo model which is 10 times cheaper than the playground, and provides a deeper understanding of how to implement and customize the ChatGPT API.

  • How can the user get help if they encounter problems while following the script?

    -Users can consult ChatGPT for help with specific issues, but should refer to the OpenAI documentation for the most accurate and updated information on implementing the API.

Outlines

00:00

๐Ÿค– Building a Custom ChatGPT Chatbot

The video script introduces a tutorial on creating a custom ChatGPT chatbot in three different versions, catering to beginners and those with coding experience. The first version is extremely simple and requires no coding knowledge. The second version allows customization and conversational interaction. The third version demonstrates how to host a chatbot online. The tutorial emphasizes beginner-friendliness and guides viewers through setting up an IDE, installing Python, obtaining an OpenAI API key, and downloading a starter folder. It also touches on the simplicity of the code involved and encourages viewers to explore OpenAI's documentation for a deeper understanding.

05:03

๐Ÿ“ Coding the Simplest Chat GPT Application

This section of the script provides a step-by-step guide to coding the simplest Chat GPT application. It begins with installing necessary packages like OpenAI using pip and setting up the Python environment. The script explains the process of importing the OpenAI package, linking the account with an API key, and using the GPT-3.5 Turbo model to generate text based on a prompt. The tutorial simplifies the coding process by highlighting the use of a print statement to display the AI's response in the terminal. It also suggests changing the prompt to explore different functionalities of the ChatGPT model and emphasizes the cost-effectiveness of this approach compared to using the ChatGPT playground.

10:03

๐ŸŒ Creating an Interactive Chatbot with Gradio

The final part of the script focuses on creating an interactive ChatGPT-powered chatbot using Gradio, which can be accessed through a web browser. The process involves installing the Gradio package, customizing the chatbot's role and responses, and defining a function to interact with the ChatGPT API. The script demonstrates how to launch the chatbot locally and share it online, allowing others to engage with the custom AI model. It also shows how to customize the chatbot's behavior and appearance, and how to update and share the web app with others. The tutorial concludes with troubleshooting advice, directing users to the OpenAI documentation for the most accurate and up-to-date information.

Mindmap

Keywords

๐Ÿ’กChatbot

A chatbot is an AI-powered software designed to mimic human conversation. In the video, the main theme revolves around creating different versions of chatbots using the ChatGPT technology, which can interact with users in a conversational manner. The script mentions building three versions of chatbots, ranging from simple to more complex and customizable.

๐Ÿ’กIDE (Integrated Development Environment)

An IDE is a software application that provides a comprehensive environment for developers to write, test, and debug code. The video script specifically mentions Visual Studio Code as the IDE of choice for building the chatbots, highlighting its popularity and the availability of Python extensions.

๐Ÿ’กPython

Python is a high-level, interpreted programming language widely used for its readability and efficiency. In the context of the video, Python is the programming language used to build the chatbots, with the script guiding viewers on how to install Python and utilize it with the OpenAI API.

๐Ÿ’กOpenAI

OpenAI is a company that creates AI technologies, including the ChatGPT language model. The video script discusses obtaining an API key from OpenAI to access their language model and integrate it into the chatbot applications being developed.

๐Ÿ’กAPI Key

An API key is a unique code used to authenticate requests to an API. In the video, the script explains how to obtain an API key from OpenAI, which is essential for enabling the chatbot to communicate with the ChatGPT language model.

๐Ÿ’กGradio

Gradio is a Python library used to quickly create web applications. The script introduces Gradio in the context of building a web-based chatbot that can be shared and accessed through a URL, demonstrating its ease of use for deploying AI models.

๐Ÿ’กCustomization

Customization refers to the ability to modify or adapt something to one's needs or preferences. The video script discusses customizing chatbots by changing the prompts and the behavior of the ChatGPT model to create unique experiences, such as a 'sassy and tired personal assistant'.

๐Ÿ’กAPI (Application Programming Interface)

An API is a set of rules and protocols that allows different software applications to communicate with each other. The video script explains how the OpenAI API enables the integration of the ChatGPT model into the chatbot applications, facilitating interaction between the user's code and the AI service.

๐Ÿ’กDocumentation

Documentation provides information about how to use a particular software or technology. In the video, the script encourages viewers to consult the OpenAI documentation for a deeper understanding of the API and its functionalities, especially for those new to coding or the specific AI technology.

๐Ÿ’กFunction (in programming)

In programming, a function is a reusable block of code that performs a specific task. The video script briefly touches on the concept of functions in Python, which are used to structure the code for the chatbot applications, particularly when defining how user inputs are processed.

๐Ÿ’กWeb Application

A web application is a software program that runs on a web browser, allowing users to interact with it over the internet. The video script describes creating a web-based chatbot using Gradio, which can be accessed through a URL, demonstrating the convenience of sharing AI-powered chatbots online.

Highlights

Building three versions of a custom ChatGPT chatbot for different skill levels.

The first version is extremely simple and accessible to coding beginners.

The second version allows customization for a chatbot that remembers past interactions.

The third version demonstrates hosting a chatbot on the web for sharing.

Using Visual Studio Code as the IDE for coding the chatbots.

Installing Python and the OpenAI extension in Visual Studio Code.

Obtaining an API key from OpenAI for application integration.

Importing the OpenAI package to link the script with the OpenAI account.

Creating a simple application to prompt ChatGPT to write an essay about penguins.

The importance of understanding the basics of Python for beginners.

Using 'pip install openai' to install the necessary package for the application.

Customizing the chatbot by changing the prompt and observing the responses.

The cost-effectiveness of using the custom chatbot over the playground or subscription.

Exploring a user-friendly blog post for building an interactive ChatGPT chatbot.

Demonstrating a chatbot that takes on a 'sassy and tired personal assistant' persona.

Using Gradio for creating a web-based ChatGPT application.

Customizing the web app to act as a 'Digital Psychologist' and sharing it online.

The ease of re-customizing the web app for different personas, like a 'Real Estate Pro'.

The importance of consulting the OpenAI documentation for reliable API implementation guidance.

Invitation for feedback on whether the audience wants more coding tutorials.

Transcripts

play00:00

Today, we'll be building a custom ChatGPT chatbot that is extremely easy to make.

play00:05

And not just that, we'll actually make three versions.

play00:08

One extremely simple one accessible even to people that have never touched code before.

play00:13

A second one which allows you to customize it and then go back and forth and talk to

play00:17

it.

play00:18

And then finally, I'll show you how to make a custom ChatGPT-powered chatbot that you

play00:22

can send to your friend because we're gonna host this on the web.

play00:26

And all of this is gonna be as beginner-friendly as possible.

play00:29

So if you've never touched code before but really wanted to try this out, this is the

play00:32

video for you.

play00:33

Alright, let's start by making the simplest Chat GPT powered application you can build.

play00:38

And to start out, you'll need three things.

play00:40

First of all, you need an IDE which is an app that allows you to code.

play00:43

We'll be using Visual Studio Code here because it's free, one of the most popular ones, and

play00:47

it's what I use.

play00:48

It's just a simple download and installation on both Windows and Mac, with many tutorials

play00:51

out there on how to do it.

play00:53

Once you install it, it's gonna look something like this, and you can head on over to extensions.

play00:57

And this is the second thing you need.

play00:58

You're going to need to install Python on your machine.

play01:01

So we're going to look for Python, and then here we're just gonna click install.

play01:05

That is going to install the newest version of Python on your machine, and we're almost

play01:09

ready to do this.

play01:10

And the last thing you'll need to prepare is the secret key from OpenAI.

play01:14

You can simply get that by creating an OpenAI account, which I showed you how to do in this

play01:18

two-minute video.

play01:19

It's the same account you used to log into ChatGPT, and by going to this URL, we can

play01:23

simply click plus.

play01:24

And for the sake of the video, we'll be creating this API key.

play01:28

Super briefly an API is just a simple way for two applications to interact.

play01:32

Essentially, it's going to allow us to plug the Chat GPT language model into our app with

play01:38

this key.

play01:39

So let's copy it and head on over to VS Code.

play01:40

Okay, actually, there's one more step, and that is that you'll need to download the folder

play01:44

that I provide for you to follow along for this video.

play01:47

You can find a link to get this in the description below.

play01:49

And for anybody who's a little more familiar with all this, you can go to my brand new

play01:52

GitHub account that we'll be using for this channel and get it from there.

play01:55

But for beginners, the easiest way is just to download this folder.

play01:58

And then all you're gonna do is drag and drop this folder onto the icon of VS Code.

play02:03

Okay, and right away, it should open up "01_chat_GPT_simple," and this is going to be our first application.

play02:09

And as the name implies, it's going to be extremely simple.

play02:12

First things first, inside of the parentheses right here, you will want to post your API

play02:16

key.

play02:17

Nice!

play02:18

And let me just note here, there's a lot of different ways of doing some of the things

play02:22

I'll be showing you in this video.

play02:24

But as this is a beginner tutorial, the focus here is on simplicity.

play02:29

And that's it.

play02:30

This is the whole application.

play02:31

So let me explain, but essentially, this is going to allow you to go in and prompt ChatGPT

play02:35

to write an essay about penguins.

play02:37

One of our favorite prompts on this channel because those little guys are really good

play02:40

at adapting to change, as are most of us being early adopters of AI technology.

play02:46

Alright, so let's talk about this in

play02:47

non-coder terms, okay?

play02:49

There are three parts to this, as you can see.

play02:51

The first one is really simple to understand.

play02:53

Alright, OpenAI, the company behind ChatGPT, created a so-called package that allows us

play02:59

to really easily implement all this, okay?

play03:02

As you can see, if I remove these empty lines, it's four lines of code.

play03:06

Couldn't get any simpler.

play03:07

And that's because we imported the OpenAI package.

play03:10

This is what that looks like in Python: "import OpenAI".

play03:13

A package is a bunch of complicated tricks that do a lot, compressed into two words,

play03:19

"import OpenAI".

play03:20

And with this package, we teach Python how to link to our OpenAI account by using the

play03:24

API key, as discussed before.

play03:26

So, that's the second part.

play03:27

By saying "OpenAI.api_key =", and then, if you put something into parentheses in Python,

play03:33

you tell the program this is a string.

play03:35

That's programming lingo for a word with all kinds of different signs in it.

play03:39

If it was just whole numbers, we could call this integer, but again, this is not going

play03:42

to be a programming tutorial.

play03:43

Just follow what we're doing here.

play03:44

And now that we've activated all the things that OpenAI can do for us here, and we've

play03:48

linked our OpenAI account to this little script we're dealing with here, next up, we're going

play03:53

to actually ask ChatGPT something.

play03:55

And if you're a beginner, you don't really have to understand what's going on here.

play03:58

Just know, we're calling the GPT-3.5 Turbo, which is the brand new ChatGPT model that

play04:04

is 10 times cheaper, that was released last week.

play04:06

And we're sending a message as a user that says, "Write an essay about penguins".

play04:11

And again, you don't need to know these things by heart, neither do you need to understand

play04:15

them to get started.

play04:16

But if you want to, OpenAI provides a so-called documentation, which is essentially an encyclopedia

play04:20

that explains all these things.

play04:21

Because, trust me, if I tell you're not a single person has been born with the ability

play04:24

to implement OpenAI APIs.

play04:26

And even the most advanced coders that have never dealt with this before.

play04:29

We will go into here and read up on how it's done.

play04:32

And I would recommend you do the same.

play04:33

This is exactly where you get a better understanding of what's going on.

play04:36

Again, link below.

play04:37

But now, let's complete this app, and let's try and run this.

play04:39

But before I do that, we need to address one more thing in here, which is this print command.

play04:43

And if you start learning coding, the first thing they will always teach you is a print

play04:47

command.

play04:48

Every language has this, and it's essentially just a way to display some text in the terminal,

play04:52

which we'll be entering this very second.

play04:54

I could do two things: I could press the play button here, run Python file, or I could go

play04:58

up to terminal, new terminal, and the terminal opens up for us.

play05:02

And before we run this, there's one last step to completing your first app in ChatGPT, and

play05:07

that is actually installing this package.

play05:09

And the way you do this is by saying 'pip install open AI', because obviously not every

play05:15

machine comes with OpenAI plugins pre-installed.

play05:17

You have to do it first, and that's usually the case with all the things that we import

play05:21

up here.

play05:22

Luckily, you only have to do this once, and every time you run a new app that uses the

play05:25

OpenAI package, it will be able to install the app.

play05:28

So because I already have this, it says 'requirement already satisfied', and I can move forward.

play05:32

Alternatively, if you run into problems, simply put, you can also do 'pip free install open

play05:37

AI'.

play05:38

And I have that one tool.

play05:39

And now, for real, we're actually set up.

play05:41

Everything is ready to go.

play05:42

I'll just delete everything in the terminal by pressing Command+K just to make this look

play05:45

nicer.

play05:46

And now we can do this and ask ChatGPT to write an essay about penguins by pressing

play05:51

play.

play05:52

As per usual with ChatGPT, it takes a few seconds.

play05:55

And there you go, we did it!

play05:57

Penguins are considered as one of the most fascinating creatures on the planet, yada

play06:01

yada yada, it worked!

play06:02

So, what happened here is we connected the script to our OpenAI account.

play06:05

Then we asked the GPT 3.5 Turbo model to give us a reply to the prompt, 'Write an essay

play06:10

about penguins'.

play06:11

And by including this line that prints the response from the GPT 3.5 Turbo model, it

play06:17

was actually shown in the terminal.

play06:19

Now, what you could do next is change the prompt to, let's say, 'Give me free ideas

play06:23

for apps I could build with OpenAI APIs'.

play06:26

And again, if I press play, this is almost identical to using ChatGPT in the browser.

play06:30

Number one, personalized health assistant.

play06:32

Number two, personal finance assistant.

play06:34

Number three, personalized education platform.

play06:36

With some explanations.

play06:37

And now, you could keep using this just like ChatGPT.

play06:40

But at this point, you might be asking yourself, "Hey Igor, what's the point of this?

play06:42

Why use Python inside of VS code and bother with the API key and change it in here instead

play06:47

of the browser?"

play06:48

And that's a fair question, but there's two things you must consider.

play06:51

First of all, this is 10 times cheaper than using the playground and way cheaper than

play06:54

paying 20 bucks a month for ChatGPT.

play06:56

If you only use this a few times a week.

play06:58

Simple answers are gonna cost you a fraction of a cent here.

play07:01

And also, now you understand how to go further with this, and that's all what number two

play07:06

is about, alright?

play07:07

The second app we'll be looking at here is built by Greg Baugues (I hope I'm pronouncing

play07:11

that correctly, Baugues, I think it's French).

play07:13

Either way, he wrote this extremely user-friendly blog post that shows you how to build that

play07:17

ChatGPT powered chatbot, where you can actually go back and forth and it remembers your answer,

play07:23

as opposed to what we just built, which is one prompt in, one answer out, in just 16

play07:28

lines of code (actually 14 if you remove the two spaces).

play07:31

This goes a little deeper and explaining all this is a little beyond the scope of this

play07:35

tutorial.

play07:36

But if you read through this blog post and you carefully consult the documentation from

play07:40

OpenAI here, I'm confident that you'll be able to figure all this out if you have some

play07:44

Python basics.

play07:45

And again, all we need to do here is copy over our API key.

play07:48

Now, all we have to do is press play, and it's gonna ask us a question, because that's

play07:53

what this is set up to do.

play07:54

"What type of chatbot would you like to create?"

play07:56

And we get to type in the terminal here.

play07:58

So we're just gonna say "A sassy and tired personal assistant" and hit enter.

play08:03

It replies with "Your new assistant is ready."

play08:05

Alright, now we can prompt this custom sassy and tired personal assistant ChatGPT to do

play08:11

anything that ChatGPT could do.

play08:13

Let's just say, "How can I start learning Python today?"

play08:16

and enter.

play08:17

And instead of giving us a classic helpful and neutral step-by-step tutorial, we'll get:

play08:21

"Well, darling, it's great to hear that you're interested in learning Python!

play08:24

Here are a few ways to get started."

play08:26

For all the Python intermediate people, a quick explanation on what's going on here

play08:29

would look something like this: We import the OpenAI package and then link

play08:33

our account and get access by inserting our custom API key.

play08:37

We create a list that is called "messages", and this is what the API wants to receive

play08:40

- you always need to send it a list as specified in the documentation.

play08:42

Then, we're going to set up a system message variable that takes our input, and then we're

play08:46

going to take the user's answer to this and append it to the "messages" variable in exactly

play08:50

the format that OpenAI is asking for.

play08:52

A simple print statement tells the user that the new assistant is ready, and to round everything

play08:56

out, we're going to run one while loop that runs until we tell it to quit (). All the

play09:02

magic here happens inside the while loop.

play09:04

We take a new input for the user's message, obviously, and again we append that to the

play09:08

"messages" list.

play09:09

Then, we start talking to the Chat GPT 3.5 Turbo API, and as mentioned before, we feed

play09:14

it the "messages" variable with the list that has been expanded with both the first inputs

play09:18

that happened previously and the new input that happened just now.

play09:22

Then, we create a brand new variable that saves the response that we just got back from

play09:26

the OpenAI API.

play09:27

This part is just copy-pasted from the documentation - it's essentially just the answer to the

play09:31

prompt that Chat GPT is giving you.

play09:33

Finally, we append the reply that we just got from ChatGPT to the list, so once the

play09:37

conversation continues, it remembers what we just talked about.

play09:40

In the very last step, we just print the reply, so the user knows what ChatGPT just replied.

play09:44

And now, it looks back, and we get to enter another input.

play09:47

This way, the conversation keeps going, and it always remembers the history because the

play09:50

list that we feed to the Chat GPT API gets longer and longer with every single time we

play09:54

type a prompt into the terminal.

play09:56

Alright, so I hope that made sense!

play09:57

If not, you can always go into ChatGPT and ask about some of the things that I talked

play10:01

about one by one.

play10:02

Right, and Chat GPT will explain.

play10:03

So for example, you could say "How to ask for an input in Python" It would show and

play10:07

explain the exact line that we used in here.

play10:09

Alright, so that's it.

play10:10

But now let's move on to App Number Three, which is the one I'm most excited about.

play10:14

So, as promised, with this, you're gonna be able to set up your own ChatGPT-powered chatbot

play10:19

inside of a browser and even share it with a friend, all in this super simple script.

play10:24

So, first things first, there's a new package here.

play10:26

Okay, up until now, we used OpenAI, but here we're using Gradio.

play10:29

So, what you want to do is either pip install Gradio because I already have it, it says

play10:33

requirement already satisfied, or you pip free install Gradio.

play10:37

Enter.

play10:38

With command K, I clear all this and let's get right into it.

play10:42

First of all, again, I'll need my API key.

play10:44

So, I'll just go ahead and copy-paste that into this part where it says API key, as we

play10:49

did before.

play10:50

Alright, and here we have the first messages variable, and this is where you customize

play10:54

your chatbot, okay?

play10:55

So here it says, "You are a psychologist," so let's just go with this to begin with.

play10:59

And that means this is going to be a custom ChatGPT language model that is a psychologist.

play11:03

Next up, we're going to be defining a function and explaining what a function is to a beginner

play11:07

goes beyond the scope of this tutorial.

play11:09

But again, you can always just go into ChatGPT and ask, "What is a function in Python?"

play11:13

as with any other part of this code, and it will help you out.

play11:15

And inside of the function, we're again going to be consulting the ChatGPT API, and it's

play11:19

going to use the user inputs that this function is based upon to generate a prompt reply,

play11:24

which it will feed back into Gradio.

play11:26

And down here, we have the simplest Gradio implementation.

play11:30

Now all of the things I just said don't have to make sense to you.

play11:33

Just copy-paste the script, install the OpenAI and Gradio package.

play11:36

So, let's just hit play here and see what happens.

play11:38

As I warned you, this is extremely simple.

play11:40

All you have to do is copy this link HTTP and then this IP address.

play11:45

And now what we get to do is open up a web browser and paste this.

play11:49

Voila!

play11:50

That is your custom web-based ChatGPT language model that we just made it happen in seconds,

play11:54

alright?

play11:55

And as we set this thing up to be a psychologist, we get to ask it, let's just say, "How do

play11:59

I deal with tiredness?"

play12:00

and press submit.

play12:01

Here's some tips to help with tiredness: get enough sleep, practice good sleep hygiene,

play12:06

exercise regularly, etc.

play12:08

And the cool thing about this is, if I go ahead and say, "Now write me a tweet about

play12:12

your qualifications and my problems," you'll immediately see that it remembers our entire

play12:17

conversation.

play12:18

As a qualified psychologist, I can help you tackle issues related to mental health and

play12:21

well-being, including dealing with tiredness, etc.

play12:24

Isn't that just great?

play12:25

So, I think this is really exciting because this is extremely convenient, and you could

play12:28

immediately show this off to anyone you know.

play12:31

And the way you do that is by going into the brackets in between "launch" and saying "share=True"

play12:36

with a capital "T".

play12:38

Another thing you could customize here is "title=Your Title".

play12:40

So, if we change the text inside the parenthesis to "Digital Psychologist", we can save this

play12:47

and press play again.

play12:48

Aha, there's a little issue.

play12:50

The thing with this is, every time I want to update it, we would need to include another

play12:52

part of the code which makes it a little more complicated.

play12:55

The easiest way is just quitting the app every time we update something and opening it back

play13:00

up.

play13:01

And now, if I press play, it provides me with the local URL as before, but also with one

play13:05

that ends with .gradio.live.

play13:07

And if I copy this one and I head on over to my phone, right, which I will disconnect

play13:11

from my local network.

play13:15

And I'll just paste this, you'll see you will get the brand new Digital Psychologist app

play13:21

right on our phone.

play13:22

Incredible, right?

play13:23

And now, it's infinitely customizable because if you go up here and change "Your app psychologist"

play13:28

to, let's say, "You are a financial expert that specializes in real estate investment

play13:33

and negotiation", and I'll change the title to "Real Estate Pro", we just built a ChatGPT

play13:38

web app in no time.

play13:39

Okay, but what if you run into problems somewhere along the way?

play13:42

Well, as I said, you can always consult ChatGPT.

play13:44

Just be aware it has not yet been updated to the new ChatGPT 3.5 Turbo API, alright?

play13:51

So every time you consult it on how to implement the API, it's going to be talking to you about

play13:56

the old DaVinci GPT API, which is still great, and some people argue that it's better for

play14:00

certain use cases, but it's 10 times more expensive.

play14:02

So, at the end of the day, your most reliable source of truth is always going to be the

play14:06

OpenAI documentation.

play14:07

So, we did it, and now I really want to hear from you guys.

play14:10

Do you want more coding tutorials like this?

play14:12

If so, leave a comment below, and I'll start making more guides and live streams like this

play14:17

one.

play14:18

Alright, so if you enjoyed this, check out this video, which will take you even further

play14:20

along on the journey of doing even more with ChatGPT.

Rate This
โ˜…
โ˜…
โ˜…
โ˜…
โ˜…

5.0 / 5 (0 votes)

Related Tags
Chatbot DevelopmentBeginner TutorialCustomization GuideAI TechnologyOpenAI IntegrationPython CodingVS CodeAPI KeyWeb HostingGradio ToolInteractive Apps