# MAF-Study-MooSQL **Repository Path**: rainlime/maf-study-moo-sql ## Basic Information - **Project Name**: MAF-Study-MooSQL - **Description**: 微软MAF框架学习和案例测试 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2026-04-04 - **Last Updated**: 2026-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: MAF, dotNET, AI ## README # MAF-Study-MooSQL ## Introduction MAF-Study-MooSQL is a learning and testing project based on the Microsoft.Agents.AI framework. This project demonstrates how to use the Microsoft.Agents.AI framework to build intelligent conversational applications, including core features such as basic chat, multi-turn conversations, memory management, and tool calling. ## Architecture This project adopts ASP.NET Core Web API architecture, integrated with Microsoft.Agents.AI framework: - **Controllers Layer**: Handles HTTP requests and provides AI chat test interfaces - **AI Layer**: Core AI functionality implementation - **Frags**: Implementation of various conversation modes (basic chat, multi-turn, memory, tool calling) - **Memory**: Custom memory components for storing and extracting user information - **Configuration Layer**: Manages LLM model configuration ### Core Components | Component | Description | |-----------|-------------| | `AIChatTestController` | AI chat test controller, providing multiple conversation mode test interfaces | | `AICash` | AI client management class, responsible for creating and caching ChatClient instances | | `Frag` | Conversation function fragments, containing implementations for basic chat, multi-turn, memory, and tool calling | | `UserInfoMemory` | Custom memory component, implementing user information storage and extraction | | `UserInfo` | User information model, storing username and age | ## Tech Stack - .NET 10.0 - ASP.NET Core Web API - Microsoft.Agents.AI - Microsoft.Agents.AI.OpenAI - OpenAI SDK (compatible with Alibaba Cloud Bailian API) ## Quick Start ### Prerequisites - .NET 10.0 SDK or higher - Visual Studio 2022 / VS Code - Alibaba Cloud Bailian API Key ### Installation 1. Clone the repository: ```bash git clone https://gitee.com/rainlime/maf-study-moo-sql.git ``` 2. Navigate to the project directory: ```bash cd maf-study-moo-sql/src ``` 3. Configure API Key: Edit `Configration/llm.json` file and fill in your Alibaba Cloud Bailian API Key: ```json { "ModelProvider": { "Endpoint": "https://dashscope.aliyuncs.com/compatible-mode/v1", "ApiKey": "your-api-key-here", "ModelId": "qwen-plus" } } ``` 4. Restore dependencies: ```bash dotnet restore ``` 5. Run the project: ```bash dotnet run ``` ## API Reference ### AIChatTestController | Method | Path | Description | |--------|------|-------------| | GET | /qw/Heelo/QianWen | Basic chat test | | GET | /qw/Heelo/many | Multi-turn conversation test | | GET | /qw/Heelo/memory | Memory feature test | | GET | /qw/Heelo/tools | Tool calling test | ### Feature Description #### 1. Basic Chat (BasicChat) Demonstrates the most basic AI conversation functionality, creating an intelligent assistant and having a single conversation with it. #### 2. Multi-turn Conversation (ManyChat) Demonstrates multi-turn conversation functionality, supporting: - Session context preservation - Streaming response output - Role-playing (e.g., telling jokes, imitating specific tones) #### 3. Memory Management (MemoryChat) Demonstrates the use of custom memory components: - Automatic extraction of user information (name, age) - Session state serialization and deserialization - Cross-session memory sharing #### 4. Tool Calling (AddToolChat) Demonstrates AI function tool calling: - Define custom tool functions - Automatically recognize user intent and call corresponding tools - Support for streaming tool call responses ## Project Structure ``` ├── src/ │ ├── AI/ │ │ ├── Frags/ │ │ │ ├── Frag.Basis.cs # Basic chat implementation │ │ │ ├── Frag.MultiTurn.cs # Multi-turn conversation implementation │ │ │ ├── Frag.Memory.cs # Memory feature implementation │ │ │ └── Frag.AddTool.cs # Tool calling implementation │ │ ├── Memory/ │ │ │ ├── UserInfo.cs # User information model │ │ │ └── UserInfoMemory.cs # Custom memory component │ │ └── AICash.cs # AI client management │ ├── Configration/ │ │ └── llm.json # LLM configuration file │ ├── Controllers/ │ │ └── AIChatTestController.cs # AI test controller │ ├── Properties/ │ │ └── launchSettings.json # Launch configuration │ ├── Program.cs # Program entry │ ├── WeatherForecast.cs # Weather data model │ ├── appsettings.json # Application configuration │ └── apiALdemo.csproj # Project file ├── LICENSE ├── README.md └── README.en.md ``` ## Core Dependencies | Package | Version | Description | |---------|---------|-------------| | Microsoft.Agents.AI | 1.0.0 | Microsoft AI Agent framework core library | | Microsoft.Agents.AI.OpenAI | 1.0.0 | OpenAI compatible Agent implementation | | Microsoft.AspNetCore.OpenApi | 10.0.5 | OpenAPI support | ## Contributing 1. Fork the repository 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request ## License This project is open-sourced under the MIT license. ## Getting Help - Visit [Gitee Blog](https://blog.gitee.com) for latest updates - Explore [Gitee Open Source Projects](https://gitee.com/explore) to learn more - Check [Gitee Help Manual](https://gitee.com/help) for usage guidance