This directory contains basic starters for using the AI Chat Protocol. If you're interested in more in-depth, end-to-end samples hosted on Azure, visit this link.
If you'd like to run the samples, follow these steps:
- Clone the repository to your machine.
- In one terminal, navigate to the
frontend/js/react
directory. - In the
frontend/js/react
directory, runnpm install
to install your dependencies, including@microsoft/ai-chat-protocol
. - Next, run
npm run dev
to start your web application.
The backend directory has both a .NET and a JavaScript (Express) backend sample. Follow the steps below for the sample you'd like to run.
- In one terminal, navigate to the
backend/csharp
directory. - Set the following environment variables:
- UseAzureOpenAI - either
true
orfalse
- If using Azure OpenAI, set your
AzureDeployment
andAzureEndpoint
according to this guide. - Sign into Azure using the Azure CLI (
az login
) or Azure Developer CLI (azd auth login
).
- If using Azure OpenAI, set your
- If you're using OpenAI (not Azure OpenAI), set the environment variables
APIKey
andModel
.
- UseAzureOpenAI - either
- Next, run
dotnet restore
to restore your dependencies anddotnet run
to run the backend.
- In one terminal, navigate to the
backend/js
directory. - In the
.env
file, updateAZURE_OPENAI_ENDPOINT
andAZURE_OPENAI_DEPLOYMENT
according to this guide. - Run
npm install
to install your dependencies. - Run
npm run dev
to run the backend.