-
Notifications
You must be signed in to change notification settings - Fork 21
Automatically choose the copilot endpoint in the codespace if it's available #44
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Uncomment the endpoint that you want to use: | ||
| #AI_API_ENDPOINT=https://models.github.ai/inference | ||
| AI_API_ENDPOINT=https://api.githubcopilot.com | ||
| #AI_API_ENDPOINT=https://api.openai.com/v1 | ||
|
|
||
| # Uncomment to set the model temperature | ||
| #MODEL_TEMP=1.0 | ||
|
|
||
| # Optional data storage directories. By default, ~/.local is used. | ||
| #MEMCACHE_STATE_DIR=/app/data | ||
| #CODEQL_DBS_BASE_PATH=/app/data | ||
| #DATA_DIR=/app/data | ||
| #LOG_DIR=/app/logs | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,15 @@ fi | |
| # Create .env file if it doesn't exist | ||
| if [ ! -f .env ]; then | ||
| echo "📝 Creating .env template..." | ||
| cp .devcontainer/env-default .env || { echo "Error creating .env"; exit 1; } | ||
| # Test whether a simple curl command to api.githubcopilot.com works. If so | ||
| # install the Copilot version of .env, otherwise install the default version. | ||
| ENV_VERSION="env-default" | ||
| if [ -v AI_API_TOKEN ]; then | ||
| if curl --fail --silent --show-error https://api.githubcopilot.com/models -H "Authorization: Bearer $AI_API_TOKEN" -H "Copilot-Integration-Id: vscode-chat" > /dev/null; then | ||
| ENV_VERSION="env-copilot" | ||
|
Comment on lines
+21
to
+23
|
||
| fi | ||
| fi | ||
|
kevinbackhouse marked this conversation as resolved.
|
||
| cp ".devcontainer/${ENV_VERSION}" .env || { echo "Error creating .env"; exit 1; } | ||
| code .env || echo "ℹ️ Unable to open .env in VS Code. Please open and review the .env file manually." | ||
| echo "⚠️ Defaults can be changed by editing the auto-generated .env file." | ||
| fi | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.