2026-05-12 01:25:52 +00:00
|
|
|
package validators
|
|
|
|
|
|
|
|
|
|
import (
|
2026-11-16 14:11:02 +00:00
|
|
|
"encoding/json"
|
|
|
|
|
|
2026-11-10 17:25:08 +00:00
|
|
|
"gitea.maximumdirect.net/eric/audita/v3/internal/core/glossary"
|
2026-10-11 01:40:38 +00:00
|
|
|
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/structuredoutput"
|
2026-05-12 01:25:52 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type LLMValidatorType string
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
LLMValidatorTypeSpokenFormPlausibility LLMValidatorType = "spoken_form_plausibility"
|
|
|
|
|
LLMValidatorTypeMeaningReversal LLMValidatorType = "meaning_reversal"
|
|
|
|
|
LLMValidatorTypeEditorialReview LLMValidatorType = "editorial_review"
|
|
|
|
|
)
|
|
|
|
|
|
2026-09-24 01:44:23 +00:00
|
|
|
type StructuredCompletionRequest = structuredoutput.Request
|
|
|
|
|
type StructuredCompletionResponse = structuredoutput.Response
|
|
|
|
|
type StructuredLLMClient = structuredoutput.Client
|
2026-05-12 01:25:52 +00:00
|
|
|
|
2026-09-25 12:38:23 +00:00
|
|
|
// LLMValidationItem retains the internal proposal index until prompt encoding.
|
|
|
|
|
// BuildValidationVariables substitutes a one-based reference for each batch.
|
2026-05-12 01:25:52 +00:00
|
|
|
type LLMValidationItem struct {
|
2026-11-10 17:25:08 +00:00
|
|
|
CorrectionIndex int `json:"correction_index"`
|
2026-11-11 17:42:30 +00:00
|
|
|
Speaker string `json:"speaker"`
|
2026-11-10 17:25:08 +00:00
|
|
|
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 []NeighboringSegment `json:"neighboring_segments,omitempty"`
|
|
|
|
|
GlossaryEntries []glossary.Entry `json:"glossary_entries,omitempty"`
|
2026-05-12 01:25:52 +00:00
|
|
|
}
|
|
|
|
|
|
2026-09-25 12:38:23 +00:00
|
|
|
// LLMValidationDecision contains a request-local correction_index, not a proposal index.
|
2026-05-12 01:25:52 +00:00
|
|
|
type LLMValidationDecision struct {
|
2026-11-16 14:11:02 +00:00
|
|
|
CorrectionIndex json.Number `json:"correction_index"`
|
|
|
|
|
Approved bool `json:"approved"`
|
|
|
|
|
Reason string `json:"reason"`
|
2026-05-12 01:25:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type LLMValidationResponse struct {
|
|
|
|
|
Validations []LLMValidationDecision `json:"validations"`
|
|
|
|
|
}
|
2026-09-25 12:38:23 +00:00
|
|
|
|
|
|
|
|
// NeighboringSegment carries semantic context without internal transcript identity.
|
|
|
|
|
type NeighboringSegment struct {
|
|
|
|
|
Position string `json:"position"`
|
|
|
|
|
Speaker string `json:"speaker"`
|
|
|
|
|
Text string `json:"text"`
|
|
|
|
|
Categories []string `json:"categories,omitempty"`
|
|
|
|
|
}
|