File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Uncomment the endpoint that you want to use:
2+ #AI_API_ENDPOINT=https://models.github.ai/inference
3+ AI_API_ENDPOINT=https://api.githubcopilot.com
4+ #AI_API_ENDPOINT=https://api.openai.com/v1
5+
6+ # Uncomment to set the model temperature
7+ #MODEL_TEMP=1.0
8+
9+ # Optional data storage directories. By default, ~/.local is used.
10+ #MEMCACHE_STATE_DIR=/app/data
11+ #CODEQL_DBS_BASE_PATH=/app/data
12+ #DATA_DIR=/app/data
13+ #LOG_DIR=/app/logs
Original file line number Diff line number Diff line change 33#AI_API_ENDPOINT=https://api.githubcopilot.com
44#AI_API_ENDPOINT=https://api.openai.com/v1
55
6+ # Uncomment to set the model temperature
7+ #MODEL_TEMP=1.0
8+
69# Optional data storage directories. By default, ~/.local is used.
710#MEMCACHE_STATE_DIR=/app/data
811#CODEQL_DBS_BASE_PATH=/app/data
Original file line number Diff line number Diff line change 1515# Create .env file if it doesn't exist
1616if [ ! -f .env ]; then
1717 echo " 📝 Creating .env template..."
18- cp .devcontainer/env-default .env || { echo " Error creating .env" ; exit 1; }
18+ # Test whether a simple curl command to api.githubcopilot.com works. If so
19+ # install the Copilot version of .env, otherwise install the default version.
20+ ENV_VERSION=" env-default"
21+ if [ -v AI_API_TOKEN ]; then
22+ if curl --fail https://api.githubcopilot.com/models -H " Authorization: Bearer $AI_API_TOKEN " -H " Copilot-Integration-Id: vscode-chat" ; then
23+ ENV_VERSION=" env-copilot"
24+ fi
25+ fi
26+ cp .devcontainer/${ENV_VERSION} .env || { echo " Error creating .env" ; exit 1; }
1927 code .env || echo " ℹ️ Unable to open .env in VS Code. Please open and review the .env file manually."
2028 echo " ⚠️ Defaults can be changed by editing the auto-generated .env file."
2129fi
You can’t perform that action at this time.
0 commit comments