16bb195cb5
- Update CLAUDE.md: replace incorrect 'no XML doc on internal code' rule with the correct convention (XML doc on all public methods and non-trivial private/protected helpers) - Restore /// <summary> on FileDownloadController private helpers (HandleRangeRequest, StreamRangeAsync) - Add full XML doc to all service contracts: ICaptchaVerifier, IEmailSender, ICvMatcherService, IJobTextExtractor, IJobTokenService, IDocumentClassifier, IRagService, ITextChunker, ITextExtractor, IEmailTemplateService, ITemplateService - Add /// <summary> and /// <inheritdoc /> to all concrete service classes and their methods: RecaptchaVerifier, EmailApiEmailSender, SmtpEmailDispatcher, CvMatcherService, JobTextExtractor, JobTokenService, RagService, DocumentClassifier, TextChunker, TextExtractor, HtmlJobSearcher, CvSearchEmailSender, CvSearchJobTask, EmailTemplateService, DbTemplateService Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22 lines
1.1 KiB
C#
22 lines
1.1 KiB
C#
using Rag.Models;
|
|
|
|
namespace Api.Services.Contracts;
|
|
|
|
/// <summary>
|
|
/// Classifies a document into a known type (cv, job, contract, etc.) and extracts a title.
|
|
/// </summary>
|
|
public interface IDocumentClassifier
|
|
{
|
|
/// <summary>
|
|
/// Determines the document type and title from the provided text.
|
|
/// Uses <paramref name="providedType"/> and <paramref name="providedTitle"/> directly when supplied;
|
|
/// otherwise falls back to a keyword-frequency heuristic over the text.
|
|
/// </summary>
|
|
/// <param name="text">Full document text to classify.</param>
|
|
/// <param name="providedType">Caller-supplied document type hint; skips heuristic when non-empty.</param>
|
|
/// <param name="providedTitle">Caller-supplied document title; skips title extraction when non-empty.</param>
|
|
/// <param name="ct">Cancellation token.</param>
|
|
/// <returns>A <see cref="DocumentClassification"/> with type, confidence score, and title.</returns>
|
|
Task<DocumentClassification> ClassifyAsync(string text, string? providedType, string? providedTitle, CancellationToken ct);
|
|
}
|