openai / plugins-quickstart

Get a ChatGPT plugin up and running in under 5 minutes!
https://platform.openai.com/docs/plugins
MIT License
4.25k stars 738 forks source link

Add remote deployment URL support for openapi.yaml and ai-plugin.json #64

Open that-one-arab opened 1 year ago

that-one-arab commented 1 year ago

Issue

When deploying the code remotely, the plugin fails to connect due to the plugin configuration-related files pointing at the wrong URL.

Description

This PR implements a REMOTE_URL environment variable inside the code which allows developers to seamlessly switch between a local environment and a production environment without needing to modify the openapi.yaml and ai-plugin.json files every time code changes are made and redeployed remotely.

This PR will also work very well with almost all future remote deployment integrations as the developer would only need to add a REMOTE_URL environment variable in the deployment service provider's project configuration resulting in a smooth CI/CD pipeline.

Usage

When running the code locally:

python main.py

When running the code remotely:

REMOTE_URL=https://your-website.com python main.py

@logankilpatrick @joedevon