I am doing local dev at the moment and I have my endpoints hosted on localhost:8000. After I installed my plugin and sent a prompt to ChatGPT, I see that it correctly constructs the arguments and calls the correct endpoint, but it’s trying to go HTTPS instead of HTTP which obviously fails. Is there any way to prevent it from doing that?
You’ve made quite some progress, my friend. I couldn’t get past the first stage. I’m getting an error in the YAML file. Do you have any ideas?
@mustafa.ergisi looks like it can’t find openapi.yaml. Have you generated and uploaded this file to the location you specified in ai-plugin.json?
@matrix_cat I have used ngrok locally to test the plugin. It provides https and it worked really well
@rlamasb thanks, that’s what I’d do if there is no fix. The documentation says they allow HTTP for localhost so I expected that to work.
What hosting service do you use? I tried Azure and GoDaddy. The .well-known directory is not visible. It says access forbidden. Should the yaml file also be publicly accessible?
@mustafa.ergisi yaml file should be publically accessible for the production version of your plugin. While you are still developing, you can host those files locally. You will have to spin up a web server on your machine and host those files and endpoints there. ChatGPT will be able to access those files by making HTTP calls via Javascript. I use FastAPI to host my endpoints and files like ai-plugin.json and openapi.json, but you may use something else. When you are ready to ship your plugin to public you’d have to deploy it somewhere. I use AWS but if you are not familiar with it, it might be an overkill. You can use something simple like heroku, digital ocean or Firebase.
Same issue here. I am serving my api with FastAPI. My plugin.json and openapi.json are properly served and validated. I loaded my plugin into the browser, and when it sends a request it tries to use HTTPS which my local server rejects. I have validated that my server works fine if i call the endpoint myself using HTTP. This seems like an error on OpenAI’s end, as i dont see a way to specify in a config somewhere that it should use http and not https.
Sounds like you’re all using the “Install an unverified plugin” link. For localhost, you should be using the “develop your own plugin” link.
@dnakov no this is with the “Develop” link. I think i figured it out. If you aren’t using a versioned api, then FastAPI doesn’t put anything in the servers
part of the openapi spec. And it seems that OpenAI is using that to determine the root url to use. So when developing locally, you need to have an entry in servers
in the api spec that has the http:// url. For example i added this to my get_openapi
call when i get the api spec. Or you could add it to the FastApi app instantiation part.
servers=[{"url": "http://localhost:8000"}],
Now my plugin is successful from ChatGPT browser.
Nice! I just solved this problem with ngrok but glad to find out there is a better solution.