Align prompts and strengthen validation context

This commit is contained in:
2026-09-25 12:23:10 +00:00
parent 3eb73e70fc
commit 325c4ea7d3
23 changed files with 329 additions and 133 deletions

View File

@@ -11,8 +11,6 @@ const (
LLMValidatorTypeSpokenFormPlausibility LLMValidatorType = "spoken_form_plausibility"
LLMValidatorTypeMeaningReversal LLMValidatorType = "meaning_reversal"
LLMValidatorTypeEditorialReview LLMValidatorType = "editorial_review"
LLMValidatorTypeGrammarReview LLMValidatorType = "grammar_review"
LLMValidatorTypeSpokenWordReview LLMValidatorType = "spoken_word_review"
)
type StructuredCompletionRequest = structuredoutput.Request
@@ -21,13 +19,15 @@ type StructuredLLMClient = structuredoutput.Client
// LLMValidationItem is one candidate correction payload passed to LLM validators.
type LLMValidationItem struct {
CorrectionIndex int `json:"correction_index"`
SegmentID int `json:"id"`
OriginalText string `json:"original_text"`
CorrectedText string `json:"corrected_text"`
OriginalSegmentText string `json:"original_segment_text"`
CorrectedSegmentText string `json:"corrected_segment_text"`
Categories []string `json:"categories,omitempty"`
CorrectionIndex int `json:"correction_index"`
SegmentID int `json:"id"`
OriginalText string `json:"original_text"`
CorrectedText string `json:"corrected_text"`
OriginalSegmentText string `json:"original_segment_text"`
CorrectedSegmentText string `json:"corrected_segment_text"`
Categories []string `json:"categories,omitempty"`
NeighboringSegments []schema.Segment `json:"neighboring_segments,omitempty"`
GlossaryEntries []schema.GlossaryEntry `json:"glossary_entries,omitempty"`
}
// LLMValidationRequest is the canonical request model for LLM-backed validators.