This commit renames the CopilotChatApi project and related files to CopilotChatWebApi, to avoid confusion with the CopilotChatApp project and to follow the naming convention of other webapi projects in the solution. It also updates the launch and task configurations in VSCode to reflect the new name. Co-authored-by: Lee Miller <[email protected]>
3.6 KiB
Semantic Kernel Service - CopilotChat
This ASP.Net web application exposes the Semantic Kernel through a REST-like interface.
Configure your environment
Before you get started, make sure you have the following requirements in place:
-
.NET 6.0 for building and deploying .NET 6 projects.
-
Update the properties in
./appsettings.jsonto configure your Azure OpenAI resource or OpenAI account. -
Generate and trust a localhost developer certificate.
- For Windows and Mac run
dotnet dev-certs https --trust`Select
Yeswhen asked if you want to install this certificate. - For Linux run
dotnet dev-certs https
To verify the certificate has been installed and trusted, run
dotnet run dev-certs https --checkTo clean your system of the developer certificate, run
dotnet run dev-certs https --clean - For Windows and Mac run
-
(Optional) Visual Studio Code or Visual Studio.
Start the WebApi Service
You can start the WebApi service using the command-line, Visual Studio Code, or Visual Studio.
Command-line
- Open a terminal
- Change directory to the Copilot Chat webapi project directory.
cd semantic-kernel/samples/apps/copilot-chat-app/webapi - (Optional) Build the service and verify there are no errors.
dotnet build - Run the service
dotnet run - Early in the startup, the service will provide a probe endpoint you can use in a web browser to verify
the service is running.
info: Microsoft.SemanticKernel.Kernel[0] Health probe: https://localhost:40443/probe
Visual Studio Code
- build (CopilotChatWebApi)
- run (CopilotChatWebApi)
- [optional] watch (CopilotChatWebApi)
Visual Studio (2022 or newer)
- Open the solution file in Visual Studio 2022 or newer (
semantic-kernel/dotnet/SK-dotnet.sln). - In the solution explorer expand the
samplesfolder. - Right-click on the
CopilotChatWebApiand selectSet as Startup Project. - Start debugging by pressing
F5or selecting the menu itemDebug->Start Debugging.
(Optional) Enabling the Qdrant Memory Store
By default, the service uses an in-memory volatile memory store that, when the service stops or restarts, forgets all memories. Qdrant is a persistent scalable vector search engine that can be deployed locally in a container or at-scale in the cloud.
To enable the Qdrant memory store, you must first deploy Qdrant locally and then configure the Copilot Chat API service to use it.
1. Configure your environment
Before you get started, make sure you have the following additional requirements in place:
- Docker Desktop for hosting the Qdrant vector search engine.
2. Deploy Qdrant VectorDB locally
-
Open a terminal and use Docker to pull down the container image.
docker pull qdrant/qdrant -
Change directory to this repo and create a
./data/qdrantdirectory to use as persistent storage. Then start the Qdrant container on port6333using the./data/qdrantfolder as the persistent storage location.cd /src/semantic-kernel mkdir ./data/qdrant docker run --name copilotchat -p 6333:6333 -v "$(pwd)/data/qdrant:/qdrant/storage" qdrant/qdrantTo stop the container, in another terminal window run
docker container stop copilotchat; docker container rm copilotchat;.