Skip to content
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

Copilot Chat setup script fixes #1039

Merged
merged 3 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ if ($IsWindows)
[System.Net.ServicePointManager]::SecurityProtocol = 3072

# Install chocolatey if not already installed
if (!(Test-Path -Path "$env:ProgramData\Chocolatey"))
$ChocoInstalled = $false
if (Get-Command choco.exe -ErrorAction SilentlyContinue) {
$ChocoInstalled = $true
}
if (!$ChocoInstalled)
{
Write-Host "Installing Chocolatey..."
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')
$env:PATH += ";%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
}

# Ensure required packages are installed
Expand Down
10 changes: 3 additions & 7 deletions samples/apps/copilot-chat-app/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
To run these scripts, you will need the following:
- *REACT_APP_CLIENT_ID*
- This is the client ID (also known as application ID) associated with your Azure Active Directory (AAD) application registration, which you can find in the Azure portal.
- *REACT_APP_TENANT*
- This is the tenant associated with your AAD app registration.
[Learn more about possible values for this parameter](https://learn.microsoft.com/en-us/azure/active-directory/develop/msal-client-application-configuration#authority).
- *MY_AZUREOPENAI_OR_OPENAI_KEY*
- This is your API key for Azure OpenAI or OpenAI

You also need to update [`appsettings.json`](../webapi/appsettings.json) with the relevant deployment or model information, as well as endpoint if you are using Azure OpenAI.
- An updated [`appsettings.json`](../webapi/appsettings.json) file. At a minimum, you must fill out the `Completion` and `Embedding` sections per the instructions in the comments.

For more information on how to prepare this data, [see the full instructions for Copilot Chat](../README.md).

Expand All @@ -33,7 +29,7 @@ The `Start` script initializes and runs both the backend and frontend for Copilo
Open a PowerShell window, navigate to this directory, and run the following command:

```powershell
.\Start.ps1 -ClientId REACT_APP_CLIENT_ID -Tenant REACT_APP_TENANT -AzureOpenAIOrOpenAIKey MY_AZUREOPENAI_OR_OPENAI_KEY
.\Start.ps1 -ClientId REACT_APP_CLIENT_ID -AzureOpenAIOrOpenAIKey MY_AZUREOPENAI_OR_OPENAI_KEY
```

### Bash
Expand All @@ -44,6 +40,6 @@ chmod +x Start.sh

Then run the following command:
```bash
./Start.sh REACT_APP_CLIENT_ID REACT_APP_TENANT MY_AZUREOPENAI_OR_OPENAI_KEY
./Start.sh REACT_APP_CLIENT_ID MY_AZUREOPENAI_OR_OPENAI_KEY
```
Note that this script starts `CopilotChatApi.exe` as a background process. Be sure to terminate it when you are finished.
4 changes: 2 additions & 2 deletions samples/apps/copilot-chat-app/scripts/Start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set -e

# Parameters
ClientId="$1"
Tenant="${2:-common}"
AzureOpenAIOrOpenAIKey="${3:-}"
Tenant="common"
AzureOpenAIOrOpenAIKey="${2:-}"

ScriptDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ScriptDir"
Expand Down