Getting started with Chat Copilot
Chat Copilot is an AI chat application sample created for educational purposes. It is built on Microsoft Semantic Kernel and has two components:
- A frontend React web app that provides a user interface for interacting with the Semantic Kernel.
- A backend .NET web service that provides an API for the React web app to interact with the Semantic Kernel.
In this article, we'll walk through the steps to run these two components locally on your machine. The Chat Copilot reference app is located in the Chat Copilot GitHub repository.
Important
Each chat interaction will call Azure OpenAI/OpenAI which will use tokens that you may be billed for.
Requirements
You will need the following items to run the sample:
- Git
- .NET 7.0 SDK (via Setup script)
- Node.js (via Setup script)
- Yarn (via Setup script)
- AI Service:
AI Service | Requirement |
---|---|
Azure OpenAI | - Access - Resource - Deployed models ( gpt-35-turbo and text-embedding-ada-002 )- Endpoint - API key |
OpenAI | - Account - API key |
Instructions
Install .NET 7.0 SDK, Node.js, and Yarn on your machine.
Open a PowerShell terminal as an administrator and navigate to the \scripts directory in the Chat Copilot project.
cd .\scripts\
Next, run the following command to install the required dependencies. This script will also install Chocolatey:
.\Install.ps1
Configure Chat Copilot.
Replace the values in brackets below before running the command:
.\Configure.ps1 -AIService {AI_SERVICE} -APIKey {API_KEY} -Endpoint {AZURE_OPENAI_ENDPOINT}
AI_SERVICE
:AzureOpenAI
orOpenAI
.API_KEY
: The API key for Azure OpenAI or for OpenAI.AZURE_OPENAI_ENDPOINT
: The Azure OpenAI resource Endpoint address. Omit-Endpoint
if using OpenAI.
Important
For Azure OpenAI, if you deployed models
gpt-35-turbo
andtext-embedding-ada-002
with custom names (instead of each own's given name), also use the parameters:-CompletionModel {DEPLOYMENT_NAME} -EmbeddingModel {DEPLOYMENT_NAME} -PlannerModel {DEPLOYMENT_NAME}
Run the start script.
.\Start.ps1
It may take a few minutes for Yarn packages to install on the first run.
Confirm pop-ups are not bocked and you are logged in with the same account used to register the application.
Congrats! A browser should automatically launch and navigate to https://localhost:3000 with the sample app running.
Next step
Now that you've gotten Chat Copilot running locally, you can learn how to customize it to your needs.