Skip to content

Add deploy to Heroku support #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: hypercorn -b 0.0.0.0:$PORT main:app
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Get a Todo list ChatGPT plugin up and running in under 5 minutes using Python. If you do not already have plugin developer access, please [join the waitlist](https://openai.com/waitlist/plugins).

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/openai/plugins-quickstart)

## Setup

To install the required packages for this plugin, run the following command:
Expand All @@ -18,13 +20,13 @@ python main.py

Once the local server is running:

1. Navigate to https://chat.openai.com.
1. Navigate to https://chat.openai.com.
2. In the Model drop down, select "Plugins" (note, if you don't see it there, you don't have access yet).
3. Select "Plugin store"
4. Select "Develop your own plugin"
5. Enter in `localhost:5003` since this is the URL the server is running on locally, then select "Find manifest file".

The plugin should now be installed and enabled! You can start with a question like "What is on my todo list" and then try adding something to it as well!
The plugin should now be installed and enabled! You can start with a question like "What is on my todo list" and then try adding something to it as well!

## Getting help

Expand Down
7 changes: 7 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

{
"name": "ChatGPT Plugin QuickStart",
"description": "Get a ChatGPT plugin up and running in under 5 minutes!",
"repository": "https://github.com/openai/plugins-quickstart",
"keywords": ["openai", "plugin", "python"]
}
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import json

import os
import quart
import quart_cors
from quart import request


port = int(os.environ.get('PORT', 5003))
app = quart_cors.cors(quart.Quart(__name__), allow_origin="https://chat.openai.com")

# Keep track of todo's. Does not persist if Python session is restarted.
Expand Down Expand Up @@ -50,7 +53,7 @@ async def openapi_spec():
return quart.Response(text, mimetype="text/yaml")

def main():
app.run(debug=True, host="0.0.0.0", port=5003)
app.run(debug=True, host="0.0.0.0", port=port)

if __name__ == "__main__":
main()