Innovations Unleashed: 10 Step-By Step Guide on Creating ChatgGPT API Plug In
10 Step-By Step Guide on Creating ChatgGPT API Plug In

Innovations Unleashed: 10 Step-By Step Guide on Creating ChatgGPT API Plug In

There are three main ingredients to a ChatGPT plugin: the app

file (main.py), the plugin manifest file (ai-plugin.json) and

OpenAPI definition (openapi.yaml).





Step 1: Finding an API key

In order to create a ChatGPT, you need to first connect an API

key from an alternative platform.


Think of this more as the data set that you are pulling

information from - the same info that will be output to the

user.



No alt text provided for this image

You can see how the process works via the photo above.


Human Input -> ChatGPT -> API Key -> Info -> ChatGPT Output


So, find your API key!

In this picture below example, I use the NewsAPI, as I want my plugin to be a source that users can instantly get the newest news

No alt text provided for this image

Step 2: Fill Out the Plugin Template


Essentially, these are the assets that ChatGPT will need in

order to create the plugin:


$GENERAL_PROMPT_SCOPE


This will be the overall solution that your plugin will be used for. Think

of the problem that you want to solve, and work your way backwards.


$EXAMPLE_PROMPTS

These are the inputs that the user of your plugin would be expected

to say!

If your plugin was a weather predictor app, this would be something

like "Hey $Plugin_Name, what will the weather look like next week?"


$INFO_NEEDED_FOR_FUNCTIONALITY

All the info needed for your plugin to work!

In the weather example, this would be info such as: Dates, Times,

Location, etc.


***Find the plugin template in the Suffix***






$FUNCTIONALITY_LIMIT


Things that you don't want your users to be able to

search/input information into.

In the weather plugin example, this would be something like:

"Hey $Plugin_Name, what are your sources for this info?"


No alt text provided for this image



Once you've entered all the relevant info for your plugin, we can move to next step.



Step 3: Create a Replit Account

To free create code that works for API plugins, you'll need to

first create a Replit account.

No alt text provided for this image



As soon as you've done this, let's enter it back into the

template:

No alt text provided for this image



Step 4: Create the main.py code


From here, you will COPY THE WHOLE section from XXXX

Paste this into ChatGPT, and receive your first set of code.

No alt text provided for this image

Great, now let's put this back into Replit:

No alt text provided for this image



Step 5: Create the manifest file


These have been included in the prompt template for you

already.

Simply copy and paste these from Notion into your Replit.

No alt text provided for this image
No alt text provided for this image



Step 6: Enter the OpenAI API Key Info


For this, you'll need to get your own API key.


Search up "OpenAI API Key" on your search browser, and

find the information below:

No alt text provided for this image



Enter your info into the template, and then step 7.



Step 7: Create your OpenAPI definition


Copying the highlighted section of the Notion template,

paste this into ChatGPT to create your OpenAPI definition.

No alt text provided for this image




Step 8: Paste OpenAPI definition into Replit


After you've created the main.py, the manifest file, and the

OpenAPI definition, you are ready to upload.



Step 9: Upload your new plugin.


To upload your new plugin, click "New Chat" while on

ChatGPT.

Go to the right hand side, and click "Plugins."

***If you don't have access to ChatGPT's plugins yet, this

won't be visible from your side***


From "Plugins" , go to "Plugin Store".

Click "Create New"!

Enter the url from your Replit code:

No alt text provided for this image

and upload your files




Step 10: Enjoy your plugin!


After you've done the previous steps, play with your plugin!


You created this piece of art - now put it to the test!

No alt text provided for this image

要查看或添加评论,请登录

Roman A. Kayum的更多文章

社区洞察