This commit is contained in:
2026-05-06 12:19:31 +03:00
parent 17266730fc
commit 89cb5a10da
34 changed files with 198 additions and 226 deletions
@@ -0,0 +1,12 @@
using Api.Models.Requests;
using Api.Models.Responses;
namespace Api.Clients.Api.Contracts;
public interface IRagApiClient
{
Task<RagIndexResponse> IndexCvPdfAsync(IFormFile file, CancellationToken ct);
Task<RagIndexResponse> IndexJobTextAsync(string text, string? url, string? title, CancellationToken ct);
Task<RagDocumentDetails?> GetDocumentAsync(string documentId, CancellationToken ct);
Task<RagSearchResponse> SearchAsync(RagSearchRequest request, CancellationToken ct);
}
@@ -0,0 +1,30 @@
using Refit;
using Api.Models.Responses;
using Api.Models.Requests;
namespace Api.Clients.Api.Contracts;
[Headers("Accept: application/json")]
public interface IRefitRagApi
{
[Multipart]
[Post("/api/rag/documents")]
Task<RagIndexResponse> IndexDocumentAsync([AliasAs("file")] StreamPart file,
[AliasAs("documentType")] string documentType,
[AliasAs("title")] string title,
CancellationToken ct = default);
[Multipart]
[Post("/api/rag/documents")]
Task<RagIndexResponse> IndexDocumentWithTextAsync([AliasAs("text")] string text,
[AliasAs("documentType")] string documentType,
[AliasAs("title")] string title,
[AliasAs("sourceUrl")] string? sourceUrl = null,
CancellationToken ct = default);
[Get("/api/rag/documents/{documentId}")]
Task<RagDocumentDetails> GetDocumentAsync(string documentId, CancellationToken ct = default);
[Post("/api/rag/search")]
Task<RagSearchResponse> SearchAsync([Body] RagSearchRequest request, CancellationToken ct = default);
}