$ show MayDay-wpf/AIBotPublic
AIBotPublic is a full-stack ASP.NET Core MVC web application that provides a comprehensive AI chatbot platform. It integrates multiple AI providers (OpenAI, Baidu, custom endpoints) and offers features such as real-time chat, role-playing, AI assistants, knowledge base with vector search (Milvus), plugin marketplace, workflow automation, AI book generation, deep research, and a community forum. The system includes user management, payment processing (WeChat/Alipay), VIP tiers, and an admin panel for configuration and monitoring. The frontend is built with jQuery and Bootstrap, with a bundled Monaco Editor for code editing capabilities. The architecture follows a service layer pattern with dependency injection, Entity Framework Core for data access, Redis for caching, and SignalR for real-time communication. The repository also contains a custom OpenAI SDK wrapper (Betalgo.Ranul.OpenAI) that covers completions, embeddings, assistants, fine-tuning, and vector stores. While the codebase is feature-rich and functional, it exhibits signs of technical debt such as duplicated frontend pagination logic, hardcoded API URLs in JavaScript, and a large vendored third-party dependency (Monaco Editor v0.45.0). The project is actively maintained with recent commits and no open issues, but the reliance on .NET 6 and an older version of Monaco Editor indicates moderate technical drift.
The LLM identified 4 files worth highlighting for reuse:
A complete, self-contained .NET client library for the OpenAI API. It provides interfaces, request/response models, and manager classes for all major OpenAI endpoints including chat completions, embeddings, images, assistants, fine-tuning, batches, and vector stores. The SDK uses a consistent HTTP client pattern and supports both Azure and standard OpenAI endpoints. It can be extracted and used in any .NET project with minimal modification.
A clean abstraction over Redis operations supporting string and hash field manipulations with three modes: overwrite, append, and numeric add. It encapsulates connection management and provides a simple interface (IRedisService) for common caching patterns. The implementation is self-contained and can be reused in any .NET application requiring Redis caching with atomic operations.
A thread-safe manager for handling cancellation of streaming AI chat responses. Uses a ConcurrentDictionary mapping user IDs to a tuple of SemaphoreSlim and CancellationTokenSource. This pattern allows multiple concurrent chat sessions with proper cancellation support and is reusable in any real-time streaming scenario where per-user cancellation is needed.
A generic workflow engine that chains AI calls and plugin executions based on a node-based configuration. It processes WorkFlowNodeData to execute sequential or parallel steps, supporting branching and conditional logic. The engine is decoupled from specific AI providers and can be extracted to build custom automation pipelines in other projects.