Files
audita/internal/framework/validators/llm_models.go

55 lines
2.1 KiB
Go

package validators
import (
"encoding/json"
"gitea.maximumdirect.net/eric/audita/v3/internal/core/glossary"
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/structuredoutput"
)
type LLMValidatorType string
const (
LLMValidatorTypeSpokenFormPlausibility LLMValidatorType = "spoken_form_plausibility"
LLMValidatorTypeMeaningReversal LLMValidatorType = "meaning_reversal"
LLMValidatorTypeEditorialReview LLMValidatorType = "editorial_review"
)
type StructuredCompletionRequest = structuredoutput.Request
type StructuredCompletionResponse = structuredoutput.Response
type StructuredLLMClient = structuredoutput.Client
// LLMValidationItem retains the internal proposal index until prompt encoding.
// BuildValidationVariables substitutes a one-based reference for each batch.
type LLMValidationItem struct {
segmentPosition int
CorrectionIndex int `json:"correction_index"`
Speaker string `json:"speaker"`
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"`
}
// LLMValidationDecision contains a request-local correction_index, not a proposal index.
type LLMValidationDecision struct {
CorrectionIndex json.Number `json:"correction_index"`
Approved bool `json:"approved"`
Reason string `json:"reason"`
}
type LLMValidationResponse struct {
Validations []LLMValidationDecision `json:"validations"`
}
// 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"`
}