Collect optional validation context only when it can fit
This commit is contained in:
@@ -133,7 +133,8 @@ func TestValidationContextIncludesEachSharedDefinition(t *testing.T) {
|
||||
{Collection: "items", ID: "bow", Name: "Bow", Category: "item"},
|
||||
}
|
||||
segments := []schema.Segment{{ID: 1, Text: "Shield Shield"}}
|
||||
_, selected := prepareGlossaryContext(entries).validationContext(segments, 0, "Sword")
|
||||
context := validationContextFor(Request{WorkingTranscript: &schema.Transcript{Segments: segments}, Glossary: entries})
|
||||
_, selected := context(LLMValidationItem{CorrectedSegmentText: "Sword"})
|
||||
if len(selected) != 3 || selected[0].ID != "sword" || selected[1].Category != "spell" || selected[2].ID != "shield" || selected[2].Collection != "items" {
|
||||
t.Fatalf("selected=%+v", selected)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user