Bound song evidence vector chunks
This commit is contained in:
parent
37c580c800
commit
7d5ae1368e
3 changed files with 28 additions and 2 deletions
|
|
@ -1229,7 +1229,7 @@ static IEnumerable<EvidenceChunk> BuildEvidenceChunks(IReadOnlyList<IpaTrialResu
|
|||
content_type {document.ContentType}
|
||||
content_hash {document.ContentHash}
|
||||
source {document.SourcePath}
|
||||
{document.Content}
|
||||
{EvidenceIndexText(document)}
|
||||
""",
|
||||
store);
|
||||
}
|
||||
|
|
@ -1237,6 +1237,27 @@ static IEnumerable<EvidenceChunk> BuildEvidenceChunks(IReadOnlyList<IpaTrialResu
|
|||
}
|
||||
}
|
||||
|
||||
static string EvidenceIndexText(SongChallengeEvidenceDocument document)
|
||||
{
|
||||
const int maxIndexedChars = 32768;
|
||||
if (document.Content.Length <= maxIndexedChars)
|
||||
{
|
||||
return document.Content;
|
||||
}
|
||||
|
||||
var builder = new StringBuilder();
|
||||
builder.AppendLine($"indexed_excerpt_only true");
|
||||
builder.AppendLine($"full_content_hash {document.ContentHash}");
|
||||
builder.AppendLine($"full_content_chars {document.Content.Length.ToString(CultureInfo.InvariantCulture)}");
|
||||
if (document.Kind.Contains("spectrogram", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
builder.AppendLine("spectrogram evidence is stored in full in CultCache; vector index carries a bounded CSV excerpt.");
|
||||
}
|
||||
|
||||
builder.Append(document.Content.AsSpan(0, maxIndexedChars));
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
static string[] EvidenceTags(IpaTrialResult result, SearchDocument document)
|
||||
{
|
||||
var tags = new List<string>();
|
||||
|
|
|
|||
|
|
@ -371,7 +371,9 @@ Return a short final summary naming the patch and report.
|
|||
"--store",
|
||||
$storePath,
|
||||
"--output",
|
||||
(Join-Path $passDir "vector-index-after.md")
|
||||
(Join-Path $passDir "vector-index-after.md"),
|
||||
"--timeout-seconds",
|
||||
"300"
|
||||
) `
|
||||
-LogPath (Join-Path $logRoot "$passId-index-after.log")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue