tut-aiagents
is a .NET project designed as a tutorial to demonstrate the use of AI agents for various tasks. The project integrates several libraries and packages to provide a robust framework for AI-driven functionalities.
This tutorial serves as an example to demonstrate how an AI agents system can be built using .NET and the Semantic Kernel Agent Framework, which is still in preview. It provides a hands-on approach to understanding the implementation and usage of AI agents. By following this tutorial, you will learn how to:
- Set up and configure AI agents using .NET.
- Integrate with Azure OpenAI services.
- Extend AI agent functionalities with custom plugins.
- Utilize the Semantic Kernel Agent Framework for handling semantic data and AI-driven tasks.
- Implement best practices for logging and diagnostics in AI-driven applications.
The main entry point of the application, which includes logic for handling various types of content such as annotations, file references, images, function calls, and function results. It sets up the AI agents and defines their roles and tasks.
Contains plugin implementations that extend the functionality of the AI agents. This includes network monitoring and host metrics functionalities.
The project relies on several key packages, including but not limited to:
Azure.AI.OpenAI
Microsoft.Extensions.Logging
System.Text.Json
Microsoft.SemanticKernel
microsoft.semantickernel.agents.abstractions
microsoft.semantickernel.agents.core
(preview)microsoft.semantickernel.agents.openai
(preview)
- AI Integration: Integrates with Azure's AI services, specifically the OpenAI API.
- Logging: Utilizes
Microsoft.Extensions.Logging
for robust logging. - Configuration: Supports configuration through various
Microsoft.Extensions
packages. - Semantic Kernel: Leverages the
Microsoft.SemanticKernel
for handling semantic data and AI-driven tasks.
To get started with the project, follow these steps:
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd tut-aiagents
-
Set the apikey via user-secrets
cd tut-aiagents dotnet user-secrets init dotnet user-secrets set "AZURE_OPENAI_API_KEY" "<your-api-key>" dotnet user-secrets set "AZURE_OPENAI_MODEL_ID" "<your-model-id>" dotnet user-secrets set "AZURE_OPENAI_ENDPOINT" "<your-endpoint>"
Alternatively you could also create a appsettings.json and set the values there. Ensure that the appsettings.json is copied to the build output if you decide to take this route. Do not commit your apikey to source control.
-
Restore dependencies:
dotnet restore
-
Build the project:
dotnet build
-
Run the project:
dotnet run
By working through this tutorial, you will learn:
- How to set up and configure AI agents using .NET.
- How to integrate with Azure OpenAI services.
- How to extend AI agent functionalities with custom plugins.
- Best practices for logging and diagnostics in AI-driven applications.
Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.