Refactor code and enhance API documentation

- Converted `Question.cs` and `Search.cs` records to `record class` syntax for clarity.
- Organized API endpoints with tags and added new GET and DELETE endpoints in `Program.cs`, including OpenAPI documentation improvements.
- Removed commented-out code in `Program.cs` for cleaner codebase.
- Introduced `WithTags` for better API operation categorization in Swagger UI.
- Added a TODO comment in `ChatService.cs` for future improvement on chunk length check.
- Clarified `using` directives in `VectorSearchService.cs` with namespace aliasing to improve readability.
- Refactored document deletion in `VectorSearchService.cs` to use a private helper method and expanded service capabilities with a new `GetDocumentsAsync` method.
- Introduced a new `Document` model in the `Models` namespace to support document fetching functionality.
- Simplified `appsettings.json` by removing `MaxTokens` configuration for `ChatCompletion` and `Embedding` services.
This commit is contained in:
Marco Minerva
2024-06-14 17:20:21 +02:00
parent db4646330f
commit b6c898a3f5
7 changed files with 52 additions and 61 deletions
+2 -4
View File
@@ -6,14 +6,12 @@
"ChatCompletion": {
"Endpoint": "",
"Deployment": "",
"ApiKey": "",
"MaxTokens": 32768
"ApiKey": ""
},
"Embedding": {
"Endpoint": "",
"Deployment": "",
"ApiKey": "",
"MaxTokens": 8191
"ApiKey": ""
}
},
"AppSettings": {