Changes
Build and Push Docker Images / build (push) Failing after 28s

This commit is contained in:
2026-05-06 17:45:05 +03:00
parent 64b0219038
commit b154fe51c3
15 changed files with 50 additions and 110 deletions
+5 -4
View File
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Api.Services.Contracts;
using Rag.Models.Requests;
using Rag.Models.Responses;
namespace Api.Controllers;
@@ -19,7 +20,7 @@ public sealed class RagController : ControllerBase
[HttpPost("documents")]
[RequestSizeLimit(10 * 1024 * 1024)]
public async Task<IActionResult> IndexDocument(
public async Task<ActionResult<IndexDocumentResponse>> IndexDocument(
[FromForm] IFormFile? file,
[FromForm] string? text,
[FromForm] string? documentType,
@@ -59,7 +60,7 @@ public sealed class RagController : ControllerBase
}
[HttpPost("documents/json")]
public async Task<IActionResult> IndexJsonDocument([FromBody] IndexDocumentRequest request, CancellationToken ct)
public async Task<ActionResult<IndexDocumentResponse>> IndexJsonDocument([FromBody] IndexDocumentRequest request, CancellationToken ct)
{
try
{
@@ -78,7 +79,7 @@ public sealed class RagController : ControllerBase
}
[HttpPost("search")]
public async Task<IActionResult> Search([FromBody] SearchRequest request, CancellationToken ct)
public async Task<ActionResult<SearchResponse>> Search([FromBody] SearchRequest request, CancellationToken ct)
{
try
{
@@ -96,7 +97,7 @@ public sealed class RagController : ControllerBase
}
[HttpGet("documents/{id}")]
public async Task<IActionResult> GetDocument(string id, CancellationToken ct)
public async Task<ActionResult<RagDocumentDetailsResponse>> GetDocument(string id, CancellationToken ct)
{
_logger.LogInformation("Get document request received. DocumentId={DocumentId}", id);
var document = await _ragService.GetDocumentAsync(id, ct);
+1 -2
View File
@@ -1,4 +1,3 @@
using Rag.Models;
using Rag.Models.Requests;
using Rag.Models.Responses;
@@ -9,5 +8,5 @@ public interface IRagService
Task<IndexDocumentResponse> IndexTextAsync(IndexDocumentRequest request, CancellationToken ct);
Task<IndexDocumentResponse> IndexPdfAsync(IFormFile file, string? documentType, string? title, string? sourceUrl, CancellationToken ct);
Task<SearchResponse> SearchAsync(SearchRequest request, CancellationToken ct);
Task<RagDocumentDetails?> GetDocumentAsync(string documentId, CancellationToken ct);
Task<RagDocumentDetailsResponse?> GetDocumentAsync(string documentId, CancellationToken ct);
}
+2 -2
View File
@@ -97,10 +97,10 @@ public sealed class RagService : IRagService
return new SearchResponse { Results = results };
}
public async Task<RagDocumentDetails?> GetDocumentAsync(string documentId, CancellationToken ct)
public async Task<RagDocumentDetailsResponse?> GetDocumentAsync(string documentId, CancellationToken ct)
{
var document = await _repository.GetDocumentByIdAsync(documentId, ct);
return document is null ? null : new RagDocumentDetails
return document is null ? null : new RagDocumentDetailsResponse
{
Id = document.Id,
DocumentType = document.DocumentType,