b78ede23cf
Piggybacks keyword extraction onto the existing CV-to-job LLM call — no extra API calls. The system prompt now instructs the model to return 8-12 English job-search terms (job titles, technologies, skills, domains) in a new `keywords` field alongside the existing score/summary fields. Keywords flow: LLM JSON → JobMatchResponse.Keywords → CreateJobSearchTokenRequest → JobSearchTokenEntity.Keywords (stored comma-separated) → JobSearchSessionEntity.Keywords (copied at session-creation time, no RAG call needed). Changes: - Add Keywords to JobMatchResponse, CreateJobSearchTokenRequest, JobSearchTokenEntity - IJobTokenService.CreateTokenAsync now accepts IReadOnlyList<string> keywords - JobTokenService: store keywords on token; TriggerStartAsync reads token.Keywords instead of fetching CV text from RAG — removes IRagApiClient dependency - Remove heuristic ExtractKeywords method - Migration AddKeywordsToJobSearchTokens: adds Keywords column to cvSearch.JobSearchTokens - Migration UpdateCvMatchSystemPromptKeywords: updates ai.cv-match.system-prompt seed to include keywords in the JSON shape Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
1.7 KiB
C#
34 lines
1.7 KiB
C#
namespace Api.Services.Contracts;
|
|
|
|
/// <summary>
|
|
/// Manages one-time job search tokens and the sessions they trigger.
|
|
/// </summary>
|
|
public interface IJobTokenService
|
|
{
|
|
/// <summary>
|
|
/// Creates a new single-use job search token linked to the given CV document and user.
|
|
/// The token expires after the number of days configured in <c>JobSearch:TokenExpiryDays</c>.
|
|
/// </summary>
|
|
/// <param name="cvDocumentId">Identifier of the indexed CV document.</param>
|
|
/// <param name="email">Email address of the user who will receive the results.</param>
|
|
/// <param name="language">Preferred language for result emails (e.g. <c>"en"</c>, <c>"ro"</c>).</param>
|
|
/// <param name="keywords">Job search keywords extracted by the LLM during the match call.</param>
|
|
/// <param name="ct">Cancellation token.</param>
|
|
/// <returns>
|
|
/// The generated token ID to embed in the one-click job search link,
|
|
/// or <c>null</c> when no job providers are currently enabled (link should be suppressed).
|
|
/// </returns>
|
|
Task<string?> CreateTokenAsync(string cvDocumentId, string email, string language, IReadOnlyList<string> keywords, CancellationToken ct);
|
|
|
|
/// <summary>
|
|
/// Validates the token and, if valid, marks it as used and creates a <c>Pending</c> job search session.
|
|
/// </summary>
|
|
/// <param name="tokenId">The token ID from the one-click link.</param>
|
|
/// <param name="ct">Cancellation token.</param>
|
|
/// <returns>
|
|
/// One of the <c>StartJobSearchStatus</c> string constants:
|
|
/// <c>Started</c>, <c>AlreadyUsed</c>, <c>Expired</c>, or <c>NotFound</c>.
|
|
/// </returns>
|
|
Task<string> TriggerStartAsync(string tokenId, CancellationToken ct);
|
|
}
|