Skip to content

Latest commit

 

History

History

samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Microsoft AI Chat Protocol Samples

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:

Frontend

  1. Clone the repository to your machine.
  2. In one terminal, navigate to the frontend/js/react directory.
  3. In the frontend/js/react directory, run npm install to install your dependencies, including @microsoft/ai-chat-protocol.
  4. Next, run npm run dev to start your web application.

Backend

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.

.NET (with Semantic Kernel)

  1. In one terminal, navigate to the backend/csharp directory.
  2. Set the following environment variables:
    1. UseAzureOpenAI - either true or false
      1. If using Azure OpenAI, set your AzureDeployment and AzureEndpoint according to this guide.
      2. Sign into Azure using the Azure CLI (az login) or Azure Developer CLI (azd auth login).
    2. If you're using OpenAI (not Azure OpenAI), set the environment variables APIKey and Model.
  3. Next, run dotnet restore to restore your dependencies and dotnet run to run the backend.

JavaScript (Express)

  1. In one terminal, navigate to the backend/js directory.
  2. In the .env file, update AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_DEPLOYMENT according to this guide.
  3. Run npm install to install your dependencies.
  4. Run npm run dev to run the backend.