A sample .NET application showcasing common use cases and development practices for build AI solutions in .NET (Generative AI, specifically). This sample demonstrates a customer support application for an e-commerce website using a services-based architecture with .NET Aspire. It includes support for the following AI use cases:
- Text classification, applying labels based on content
- Sentiment analysis based on message content
- Summarization of large sets of text
- Synthetic data generation, creating test content for the sample
- Chat bot interactions with chat history and suggested responses
![](https://private-user-images.githubusercontent.com/1101362/359407381-5a41493f-565b-4dd0-ae31-1b5c3c2f6d22.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzOTQ4NDEsIm5iZiI6MTcyNDM5NDU0MSwicGF0aCI6Ii8xMTAxMzYyLzM1OTQwNzM4MS01YTQxNDkzZi01NjViLTRkZDAtYWUzMS0xYjVjM2MyZjZkMjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjNUMDYyOTAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OThjNzdmMGNiMTE2MDlkYWFkMmQ4YTUzZTA4NThmYjk4ZTMyMTBhYTJkNTcyMTk3OGJmZjIyMzA4MjY5ZmQzYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.9rbdTVMNUtCd-YMydujWeHRt50voQn6R8pMRQaT8rn4)
![](https://private-user-images.githubusercontent.com/1101362/359407178-7930a940-bb31-4dc0-b5f6-738d43dfcfe5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQzOTQ4NDEsIm5iZiI6MTcyNDM5NDU0MSwicGF0aCI6Ii8xMTAxMzYyLzM1OTQwNzE3OC03OTMwYTk0MC1iYjMxLTRkYzAtYjVmNi03MzhkNDNkZmNmZTUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyMyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjNUMDYyOTAxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDIwOWNlM2ExNjY2ODkyODE3NDFhOTcwN2IyM2EyMTNkMmMzZmRiNGEyMGRkMmFiOTkxNWQ0MWEzNThkNTcyOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.lr2Il4XwFb_sIU45eyRqUpxDTvybj7CRCeMZjdBmuoY)
This sample also demonstrates the following development practices:
- Developing a solution locally, using small local models
- Evaluating the quality of AI responses using grounded Q&A data
- Leveraging Python projects as part of a .NET Aspire solution
- Deploying the application, including small local models, to the Cloud (coming soon)
- A device with an Nvidia GPU (see workaround for running on the CPU)
- Clone the eShopSupport repository: https://github.com/dotnet/eshopsupport
- Install & start Docker Desktop
- Install Python 3.12.5
- Install Visual Studio 2022 version 17.10 or newer
- Select the following workloads:
ASP.NET and web development
workload.Python Development
workload..NET Aspire SDK
component inIndividual components
.
- Select the following workloads:
-
Install the latest .NET 8 SDK
-
Install the .NET Aspire workload with the following commands:
dotnet workload update dotnet workload install aspire dotnet restore eShopSupport.sln
-
(Optionally) Install Visual Studio Code with the C# Dev Kit extension
From the Terminal, at the root of the cloned repo, run:
pip install -r src/PythonInference/requirements.txt
Note: If the above command doesn't work on Windows, use the following command:
py -m pip install -r src/PythonInference/requirements.txt
Warning
Remember to ensure that Docker is started.
-
(Windows only) Run the application from Visual Studio:
- Open the
eShopSupport.sln
file in Visual Studio - Ensure that
AppHost
is your startup project - Hit Ctrl-F5 to launch .NET Aspire
- Open the
-
Or run the application from your terminal:
dotnet run --project src/AppHost
then look for lines like this in the console output in order to find the URL to open the Aspire dashboard:
Login to the dashboard at: http://localhost:17191/login?t=uniquelogincodeforyou
You may need to install ASP.NET Core HTTPS development certificates first, and then close all browser tabs. Learn more at https://aka.ms/aspnet/https-trust-dev-cert
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
The sample data is defined in seeddata. All products/descriptions/brands, manuals, customers, and support tickets names are fictional and were generated using GPT-35-Turbo using the included DataGenerator project.