using Refit;
using CvMatcher.Models.Responses;
using CvMatcher.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);
}
