Skip to content

Commit 90aac5f

Browse files
committed
feat: Implement centralized logging with ServiceLogMessages and fix all warnings
- Create ServiceLogMessages.cs for centralized LoggerMessage delegates - Refactor DocumentService and DocumentSearchService to use ILogger - Replace all Console.WriteLine with structured logging - Fix CS0168 warnings (unused exception variables) - Fix CA2017 warnings (LoggerMessage template mismatches) - Eliminate CA1848 warnings with LoggerMessage optimization - Achieve 0 errors, 0 warnings, 0 messages - Follow SOLID and DRY principles for logging architecture - Move SmartRAG.API to examples/WebAPI/ directory - Add XML documentation summaries to all interfaces
1 parent 1bd104c commit 90aac5f

19 files changed

+883
-256
lines changed

β€ŽSmartRAG.slnβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ VisualStudioVersion = 17.0.31903.59
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartRAG", "src\SmartRAG\SmartRAG.csproj", "{DECA885F-8815-4A0F-A12C-30563827C255}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartRAG.API", "src\SmartRAG.API\SmartRAG.API.csproj", "{E7606EAF-F26D-441F-B5A4-34A72A70DD6C}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SmartRAG.API", "examples\WebAPI\SmartRAG.API.csproj", "{E7606EAF-F26D-441F-B5A4-34A72A70DD6C}"
88
EndProject
99
Global
1010
GlobalSection(SolutionConfigurationPlatforms) = preSolution

β€Žexamples/README.mdβ€Ž

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SmartRAG Examples
2+
3+
This directory contains example projects demonstrating how to use SmartRAG in different scenarios.
4+
5+
## πŸ“ Available Examples
6+
7+
### **WebAPI** - ASP.NET Core Web API Example
8+
- **Location**: `WebAPI/`
9+
- **Description**: Complete web API implementation showing document upload, search, and RAG operations
10+
- **Features**:
11+
- Multi-document upload
12+
- AI-powered question answering
13+
- Smart query intent detection
14+
- Multiple storage providers
15+
- Comprehensive API documentation
16+
17+
## πŸš€ Running Examples
18+
19+
### WebAPI Example
20+
```bash
21+
cd examples/WebAPI
22+
dotnet restore
23+
dotnet run
24+
```
25+
26+
Browse to `https://localhost:5001/scalar/v1` for interactive API documentation.
27+
28+
## πŸ”§ Configuration
29+
30+
Each example includes its own configuration files. Copy and modify the template files as needed:
31+
32+
```bash
33+
# Copy development configuration template
34+
cp appsettings.Development.template.json appsettings.Development.json
35+
36+
# Edit with your API keys and configuration
37+
```
38+
39+
## πŸ“š Documentation
40+
41+
- **Main Documentation**: [SmartRAG README](../../README.md)
42+
- **API Reference**: [API Documentation](../../docs/api-reference.md)
43+
- **Configuration Guide**: [Configuration Guide](../../docs/configuration.md)
44+
45+
## 🀝 Contributing
46+
47+
Want to add more examples? Create a new directory and submit a pull request!
48+
49+
### Example Types to Consider:
50+
- **Console Application** - Command-line interface
51+
- **Blazor WebAssembly** - Client-side web app
52+
- **WPF Application** - Desktop application
53+
- **Azure Functions** - Serverless implementation
54+
- **Minimal API** - Lightweight web API
File renamed without changes.

β€Žsrc/SmartRAG.API/SmartRAG.API.csprojβ€Ž renamed to β€Žexamples/WebAPI/SmartRAG.API.csprojβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="..\SmartRAG\SmartRAG.csproj" />
10+
<ProjectReference Include="..\..\src\SmartRAG\SmartRAG.csproj" />
1111
</ItemGroup>
1212

1313
<ItemGroup>
File renamed without changes.

0 commit comments

Comments
Β (0)