diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..94aabdc4 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: hypercorn -b 0.0.0.0:$PORT main:app diff --git a/README.md b/README.md index 810c0ff6..fc82bd4c 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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 diff --git a/app.json b/app.json new file mode 100644 index 00000000..42cf528b --- /dev/null +++ b/app.json @@ -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"] +} \ No newline at end of file diff --git a/main.py b/main.py index a408731a..6bde116f 100644 --- a/main.py +++ b/main.py @@ -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. @@ -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()