AI prompts
base on ---
page_type: sample
languages:
- azdeveloper
- bicep
- csharp
- powershell
products:
- azure
- ai-services
- azure-openai
urlFragment: ai-samples
name: AI Samples for .NET
description: .NET samples demonstrating how to use AI in your .NET applications.
---
<!-- YAML front-matter schema: https://review.learn.microsoft.com/en-us/help/contribute/samples/process/onboarding?branch=main#supported-metadata-fields-for-readmemd -->
# AI Samples for .NET
Welcome to the official home for .NET samples demonstrating how to use AI in your .NET applications. If you're new to AI, start at the top and work your way down. Otherwise, jump in wherever suits your interests.
### Microsoft.Extensions.AI (preview)
Microsoft.Extensions.AI is a set of core .NET libraries developed in collaboration with the .NET ecosystem, including Semantic Kernel. These libraries provide a unified layer of C# abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs) and embeddings.
Core benefits:
- *Unified API:* Offers a consistent and standard set of APIs and conventions for integrating AI services into .NET applications.
- *Flexibility:* Allows .NET library authors to use AI services without forcing a specific AI provider, making it parameterizable with any provider.
- *Ease of Use:* Enables .NET application developers to experiment with different packages using the same underlying abstractions and to utilize a single API throughout their application.
- *Componentization:* Facilitates the addition of new capabilities and simplifies the componentization and testing of applications.
For more details, see the [Introducing Microsoft.Extensions.AI Preview blog post](https://aka.ms/meai-preview-blog).
|Topic | GitHub Link |
| --- | --- |
| Abstraction implementations | [GitHub Link](./src/microsoft-extensions-ai/abstraction-implementations/README.md) |
| Azure OpenAI | [GitHub Link](./src/microsoft-extensions-ai/azure-openai/README.md) |
OpenAI | [GitHub Link](./src/microsoft-extensions-ai/openai/README.md) |
Azure AI Inference | [GitHub Link](./src/microsoft-extensions-ai/azure-ai-inference/.md) |
| Ollama | [GitHub Link](./src/microsoft-extensions-ai/ollama/README.md) |
### Build 2024 - Infusing your .NET Apps with AI: Practical Tools and Techniques
Discover how to bring AI into your .NET application! This session covers the tools, libraries, and best practices for incorporating LLMs or other AI capabilities to create an "intelligent app". We'll explore practical examples, including how to leverage Azure AI services and the .NET AI ecosystem, to enhance your apps with AI.
[![Infusing your .NET Apps with AI: Practical Tools and Techniques Youtube Preview](./images/Build2024Preview.png)](https://www.youtube.com/watch?v=jrNfKeGSuCg)
[Youtube: Infusing your .NET Apps with AI: Practical Tools and Techniques](https://www.youtube.com/watch?v=jrNfKeGSuCg)
#### Tutorial: Infusing your .NET Apps with AI: Practical Tools and Techniques
| # | Topic | YouTube Link and Time | GitHub Link |
|-----|--------------------------------------------------|----------------------------------------------------------------|-------------------------|
| 1 | Hello Semantic Kernel | [3m 0s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=180s) | [Hello Semantic Kernel](./src/build-2024/01%20-%20Hello%20Semantic%20Kernel) |
| 2 | Add Chat History | [5m 40s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=340s) | [Add Chat History](./src/build-2024/02%20-%20Add%20Chat%20History) |
| 3 | Add Plugin - Function Call | [7m 10s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=430s) | [Add Plugin - Function Call](./src/build-2024/03%20-%20Add%20Plugin%20%28Function%20Call%29) |
| 4 | Add Logging | [9m 24s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=565s) | [Add Logging](./src/build-2024/04%20-%20Add%20Logging) |
| 5 | Add Plugin - Bing Search | [11m 15s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=675s) | [Add Plugin - Bing Search](./src/build-2024/05%20-%20Add%20Plugin%20%28Bing%20Search%29) |
| 6 | Modify Kernel Behavior with Dependency Injection | [12m 37s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=757s) | [Modifying Kernel Behavior with Dependency Injection](./src/build-2024/06%20-%20Modifying%20Kernel%20Behavior%20with%20Dependency%20Injection) |
| 7 | Using Semantic Kernel in a Web App | [15m 57s](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=957s) | [Using Semantic Kernel in a Web App](./src/build-2024/07%20-%20Using%20Semantic%20Kernel%20in%20WebApp) |
### Quickstarts using OpenAI
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------------------------------------|
| 1 | Text Summary | [Hike Benefits Summary Project](./src/quickstarts/openai/01-HikeBenefitsSummary/README.md)
| 2 | Hiker AI | [Hiker AI Project](./src/quickstarts/openai/02-HikerAI/README.md)
| 3 | Chat Context/Data | [Chatting About my Previous Hikes Project](./src/quickstarts/openai/03-ChattingAboutMyHikes/README.md)
| 4 | Hiker AI Pro (Tool extension) | [Hiker AI Pro](./src/quickstarts/openai/04-HikerAIPro/README.md)
| 5 | Generating images | [Hike Images Project](./src/quickstarts/openai/05-HikeImages/README.md)
| REF | Using Milvus | [Coming Soon](.)
| REF | Using Qdrant | [Coming Soon](.)
### Quickstarts using the Azure OpenAI SDK
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------------------------------------|
| 1 | Text Summary | [Hike Benefits Summary Project](./src/quickstarts/azure-openai/01-HikeBenefitsSummary/README.md)
| 2 | Hiker AI | [Hiker AI Project](./src/quickstarts/azure-openai/02-HikerAI/README.md)
| 3 | Chat Context/Data | [Chatting About my Previous Hikes Project](./src/quickstarts/azure-openai/03-ChattingAboutMyHikes/README.md)
| 4 | Hiker AI Pro (Tool extension) | [Hiker AI Pro](./src/quickstarts/azure-openai/04-HikerAIPro/README.md)
| 5 | Generating images | [Hike Images Project](./src/quickstarts/azure-openai/05-HikeImages/README.md)
### Chat samples
|# | Topic | GitHub Link |
|--- | --- | --- |
| 1 | Customer Support | [Customer Support Project](./src/chat/CustomerSupport/README.md) |
### LLM Core Concepts
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------------------------------------|
| REF | Tokenizer | [Coming Soon](.)
| REF | Embeddings | [Coming Soon](.)
| REF | RAG | [Coming Soon](.)
| REF | Prompts / Prompt Engineering | [Coming Soon](.)
### End to End Examples
| # | Topic | GitHub Link |
|-----|---------------------------------------------|--------------|
| E2E | Azure Search . | [Azure Search Repository](https://github.com/Azure-Samples/azure-search-openai-demo-csharp)
| E2E | E-Shop Sample | [E-Shop Repository](https://github.com/dotnet/eshop)
### ML.NET GenAI
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------|
| REF | Phi | [Phi](./src/mlnet-gen-ai/Phi)
| REF | LLaMA | [LLaMA](./src/mlnet-gen-ai/LLaMA)
### Local Embedding Models
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------|
| REF | Clip | [Coming Soon](.)
### Tokenizers
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------|
| REF | TikToken | [Coming Soon](.)
### Vector Databases
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------|
| REF | Azure AI Search | [Coming Soon](.)
| REF | PostgreSQL + pgvector | [Coming Soon](.)
| REF | Milvus | [Coming Soon](.)
| REF | Qdrant | [Coming Soon](.)
### Reference Examples
| # | Topic | GitHub Link |
|-----|---------------------------------------------|-------------|
| REF | Vector\<T\> | [Coming Soon](.)
## .NET Foundation
There are many .NET related projects on GitHub.
- [.NET home repo](https://github.com/Microsoft/dotnet) - links to 100s of .NET projects, from Microsoft and the community.
- [ASP.NET Core home](https://docs.microsoft.com/aspnet/core/) - the best place to start learning about ASP.NET Core.
This project has adopted the code of conduct defined by the [Contributor Covenant](http://contributor-covenant.org/) to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](http://www.dotnetfoundation.org/code-of-conduct).
## License
.NET (including the csharp-notebooks repo) is licensed under the [MIT](LICENSE) license.
", Assign "at most 3 tags" to the expected json: {"id":"10352","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"