61 lines
1.3 KiB
Go
61 lines
1.3 KiB
Go
package language
|
|
|
|
import "ai-operator/internal/dialogue/state"
|
|
|
|
type Language = state.Language
|
|
|
|
const (
|
|
LanguageUnknown Language = state.LanguageUnknown
|
|
LanguageRU Language = state.LanguageRU
|
|
LanguageKK Language = state.LanguageKK
|
|
)
|
|
|
|
type DetectionSource string
|
|
|
|
const (
|
|
SourceUserText DetectionSource = "user_text"
|
|
SourceToolArgs DetectionSource = "tool_args"
|
|
SourceTranscript DetectionSource = "transcript"
|
|
SourceCLI DetectionSource = "cli"
|
|
)
|
|
|
|
type DetectionIntent string
|
|
|
|
const (
|
|
IntentLanguageSelect DetectionIntent = "language_select"
|
|
IntentLanguageChange DetectionIntent = "language_change"
|
|
IntentNotLanguage DetectionIntent = "not_language"
|
|
IntentAmbiguous DetectionIntent = "ambiguous"
|
|
)
|
|
|
|
const (
|
|
HighConfidence = 0.90
|
|
MediumConfidence = 0.70
|
|
LowConfidence = 0.50
|
|
)
|
|
|
|
type DetectionResult struct {
|
|
Language Language
|
|
Intent DetectionIntent
|
|
Confidence float64
|
|
MatchedPhrase string
|
|
NormalizedText string
|
|
Source DetectionSource
|
|
ReasonCode string
|
|
NeedsClarification bool
|
|
}
|
|
|
|
type SelectionContext struct {
|
|
CurrentState state.ConversationState
|
|
CurrentLanguage Language
|
|
AllowChange bool
|
|
}
|
|
|
|
type LanguageDecision struct {
|
|
Apply bool
|
|
Language Language
|
|
NeedsClarification bool
|
|
ReasonCode string
|
|
MessageKey string
|
|
}
|