feat: add application package generation and grouped readiness workflows
This commit is contained in:
@@ -35,6 +35,7 @@ namespace JobTrackerApi.Services
|
||||
public interface ISummarizerService
|
||||
{
|
||||
Task<string?> SummarizeAsync(string text, int maxLength = 150, int minLength = 30);
|
||||
Task<string?> SummarizeSectionAsync(string instruction, string text, int maxLength = 180, int minLength = 40);
|
||||
Task RunProbeAsync(CancellationToken cancellationToken = default);
|
||||
Task<SummarizerMetrics> GetMetricsAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
@@ -75,6 +76,19 @@ namespace JobTrackerApi.Services
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(text)) return null;
|
||||
|
||||
return await SummarizeCoreAsync(text, maxLength, minLength);
|
||||
}
|
||||
|
||||
public Task<string?> SummarizeSectionAsync(string instruction, string text, int maxLength = 180, int minLength = 40)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(instruction) || string.IsNullOrWhiteSpace(text)) return Task.FromResult<string?>(null);
|
||||
|
||||
var composed = $"{instruction.Trim()}\n\n{text.Trim()}";
|
||||
return SummarizeCoreAsync(composed, maxLength, minLength);
|
||||
}
|
||||
|
||||
private async Task<string?> SummarizeCoreAsync(string text, int maxLength, int minLength)
|
||||
{
|
||||
// Use a deterministic content hash instead of string.GetHashCode() so cache keys
|
||||
// are collision-resistant and stable across process restarts.
|
||||
var key = BuildCacheKey(text, maxLength, minLength);
|
||||
|
||||
Reference in New Issue
Block a user