-
Notifications
You must be signed in to change notification settings - Fork 729
Add dev container to open in GitHub Codespace #14
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Josh Spicer <josh@joshspicer.com>
Co-authored-by: Josh Spicer <josh@joshspicer.com>
Co-authored-by: Josh Spicer <josh@joshspicer.com>
Co-authored-by: Josh Spicer <josh@joshspicer.com>
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
I wrote this DEV post to explain the changes that I made and help create awareness around Codespaces + ChatGPT plugins : https://dev.to/github/chatgpt-meets-github-codespaces-how-im-optimizing-chatgpt-quickstart-plugins-for-remote-development-5bc8 Hopefully this will be helpful for the OpenAI team and the Codespaces team. |
@@ -0,0 +1,13 @@ | |||
#!/bin/bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, we can update the file to have $host placeholder and then replace with host header. For codespaces, the original host is in x-forwarded-host.
"api": {
"type": "openapi",
"is_user_authenticated": "false",
"url": "$host/.well-known/openapi.yaml"
},
"logo_url": "$host/.well-known/logo.png",
@app.get("/.well-known/ai-plugin.json")
async def plugin_manifest(request: Request):
"""
Returns the ai-plugin.json from .well-known location
"""
host_header = request.headers.get("X-Forwarded-Host") or request.headers.get("Host")
with open(".well-known/ai-plugin.json") as f:
return Response(
content=Template(f.read()).substitute(host=f"https://{host_header}"),
media_type="application/json",
)
I added a devcontainer to this repository along with instructions in the README for how a user can get started.
To test out this implementation, follow the steps for the README using either of the following:
It should work in the two indicated above.
What's happening in this PR?
Questions/Concerns
Looking for review
I am looking for review from Logan and anyone on the Open AI team. I am also looking for review from anyone on the GitHub side, especially folks within the Codespaces team.
Thank you so much for this opportunity. It was fun!
cc: @logankilpatrick