{"name":"AI Samples for .NET: Integrating AI into Your .NET Applications","description":"The AI Samples for .NET repository provides a comprehensive collection of samples demonstrating how to integrate artificial intelligence into .NET applications. It features examples using Microsoft.Extensions.AI for unified API access to AI services and Microsoft.Extensions.AI.Evaluation for assessing LLM response quality. This resource is ideal for .NET developers looking to leverage AI, including large language models, in their projects.","github":"https://github.com/dotnet/ai-samples","url":"https://osrepos.com/repo/dotnet-ai-samples","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/dotnet-ai-samples","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/dotnet-ai-samples.md","json":"https://osrepos.com/repo/dotnet-ai-samples.json","topics":["C#",".NET","AI","Machine Learning","OpenAI","Azure AI","LLM","Samples"],"keywords":["C#",".NET","AI","Machine Learning","OpenAI","Azure AI","LLM","Samples"],"stars":null,"summary":"The AI Samples for .NET repository provides a comprehensive collection of samples demonstrating how to integrate artificial intelligence into .NET applications. It features examples using Microsoft.Extensions.AI for unified API access to AI services and Microsoft.Extensions.AI.Evaluation for assessing LLM response quality. This resource is ideal for .NET developers looking to leverage AI, including large language models, in their projects.","content":"## Introduction\nThe `dotnet/ai-samples` repository is the official home for .NET samples that showcase how to effectively use AI in your .NET applications. Whether you are new to AI or looking to deepen your understanding, this repository offers a structured path to learning, starting from foundational concepts and progressing to more advanced topics. It primarily focuses on `Microsoft.Extensions.AI` and `Microsoft.Extensions.AI.Evaluation`, providing practical examples for various AI scenarios.\n\n### Microsoft.Extensions.AI\n`Microsoft.Extensions.AI` is a set of core .NET libraries developed in collaboration with the .NET ecosystem, including Semantic Kernel. These libraries offer a unified layer of C# abstractions for interacting with diverse AI services, such as small and large language models (SLMs and LLMs) and embeddings. Key benefits include a consistent API, flexibility to use any AI provider, ease of use for developers, and improved componentization.\n\n### Microsoft.Extensions.AI.Evaluation\n`Microsoft.Extensions.AI.Evaluation` provides .NET libraries with tools to evaluate the quality and efficacy of LLM responses in intelligent applications. Built upon the core AI abstractions from `Microsoft.Extensions.AI`, these libraries help ensure the reliability and performance of your AI-powered features.\n\n## Getting Started\nTo begin exploring the AI samples, you should clone the repository to your local machine. Each sample typically includes its own `README.md` file with specific instructions for setup and execution.\n\nbash\ngit clone https://github.com/dotnet/ai-samples.git\ncd ai-samples\n\n\nEnsure you have the necessary .NET SDK installed. Individual samples may require API keys for services like OpenAI or Azure OpenAI, which you will need to configure according to their respective documentation.\n\n## Examples and Quickstarts\nThe repository is rich with practical examples, categorized for easy navigation. Each link points directly to the relevant `README.md` within the GitHub repository for detailed instructions.\n\n### Microsoft.Extensions.AI Implementations\nExplore how to integrate with various AI providers using `Microsoft.Extensions.AI`:\n*   Abstraction implementations: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai/abstraction-implementations/README.md)\n*   Azure OpenAI: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai/azure-openai/README.md)\n*   OpenAI: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai/openai/README.md)\n*   Azure AI Inference: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai/azure-ai-inference/README.md)\n*   Ollama: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai/ollama/README.md)\n\n### Microsoft.Extensions.AI.Evaluation Examples\n*   API Usage Examples: [GitHub Link](https://github.com/dotnet/ai-samples/blob/main/src/microsoft-extensions-ai-evaluation/api/README.md)\n\n### Quickstarts using OpenAI\n*   Text Summary: [Hike Benefits Summary Project](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/openai/extensions-ai/01-HikeBenefitsSummary/README.md)\n*   Chat App: [Hiker AI Project](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/openai/extensions-ai/02-build-chat-app/openai/README.md)\n*   Function Calling: [Hiker AI Pro](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/openai/extensions-ai/04-function-calling/openai/README.md)\n\n### Quickstarts using the Azure OpenAI SDK\n*   Text Summary: [Hike Benefits Summary Project](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/azure-openai/extensions-ai/01-HikeBenefitsSummary/README.md)\n*   Chat App: [Hiker AI Project](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/azure-openai/extensions-ai/02-build-chat-app/openai/README.md)\n*   Function Calling: [Hiker AI Pro](https://github.com/dotnet/ai-samples/blob/main/src/quickstarts/azure-openai/extensions-ai/04-function-calling/openai/README.md)\n\n### Chat Samples\n*   Customer Support: [Customer Support Project](https://github.com/dotnet/ai-samples/blob/main/src/chat/CustomerSupport/README.md)\n\n### Build 2024 Tutorial\nFollow along with the \"Infusing your .NET Apps with AI: Practical Tools and Techniques\" session from Build 2024. This tutorial covers integrating LLMs and other AI capabilities into .NET applications.\n*   YouTube Video: [Infusing your .NET Apps with AI: Practical Tools and Techniques](https://www.youtube.com/watch?v=jrNfKeGSuCg)\n*   Tutorial steps, with links to both YouTube and GitHub:\n    *   Hello Semantic Kernel: [YouTube (3m 0s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=180s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/01%20-%20Hello%20Semantic%20Kernel)\n    *   Add Chat History: [YouTube (5m 40s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=340s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/02%20-%20Add%20Chat%20History)\n    *   Add Plugin - Function Call: [YouTube (7m 10s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=430s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/03%20-%20Add%20Plugin%20%28Function%20Call%29)\n    *   Add Logging: [YouTube (9m 24s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=565s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/04%20-%20Add%20Logging)\n    *   Add Plugin - Bing Search: [YouTube (11m 15s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=675s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/05%20-%20Add%20Plugin%20%28Bing%20Search%29)\n    *   Modify Kernel Behavior with Dependency Injection: [YouTube (12m 37s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=757s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/06%20-%20Modifying%20Kernel%20Behavior%20with%20Dependency%20Injection)\n    *   Using Semantic Kernel in a Web App: [YouTube (15m 57s)](https://www.youtube.com/watch?v=jrNfKeGSuCg&t=957s), [GitHub](https://github.com/dotnet/ai-samples/blob/main/src/build-2024/07%20-%20Using%20Semantic%20Kernel%20in%20WebApp)\n\n## Why Use AI Samples for .NET?\nThis repository is an invaluable resource for .NET developers for several reasons:\n*   **Practical Learning**: Provides hands-on examples to understand and implement AI concepts in C#.\n*   **Unified Abstractions**: Showcases `Microsoft.Extensions.AI`, which offers a consistent and standard set of APIs for integrating various AI services, reducing complexity.\n*   **Flexibility**: Demonstrates how to build AI applications that are provider-agnostic, allowing easy switching between different AI services like OpenAI, Azure OpenAI, and Ollama.\n*   **Evaluation Tools**: Introduces `Microsoft.Extensions.AI.Evaluation` for robust testing and quality assurance of AI application responses.\n*   **Community and Best Practices**: Aligns with the .NET ecosystem and promotes best practices for AI integration.\n\n## Useful Links\n*   **GitHub Repository**: [dotnet/ai-samples](https://github.com/dotnet/ai-samples)\n*   **Introducing Microsoft.Extensions.AI Preview blog post**: [Read the blog post](https://aka.ms/meai-preview-blog)\n*   **Evaluate the quality of your AI applications with ease blog post**: [Read the blog post](https://devblogs.microsoft.com/dotnet/evaluate-the-quality-of-your-ai-applications-with-ease/)\n*   **Build 2024 YouTube Video**: [Infusing your .NET Apps with AI: Practical Tools and Techniques](https://www.youtube.com/watch?v=jrNfKeGSuCg)\n*   **Code of Conduct**: [The .NET Foundation Code of Conduct](http://www.dotnetfoundation.org/code-of-conduct)","metrics":{"detailViews":6,"githubClicks":8},"dates":{"published":null,"modified":"2025-10-11T22:41:05.000Z"}}