Files
Assistant/contracts/interaction/types.go
T
m 976edccfd8
CI / test (push) Successful in 55s
CI / test (pull_request) Successful in 53s
feat: route factual questions through bounded research
2026-08-24 02:04:57 +03:00

188 lines
8.4 KiB
Go

package interaction
import (
"git.cin.su/m/Assistant/contracts/capability"
"git.cin.su/m/Assistant/contracts/continuity"
"git.cin.su/m/Assistant/contracts/identity"
"git.cin.su/m/Assistant/contracts/situation"
)
type ConversationID string
type HumanUtteranceID string
type OriginalHumanIntentID string
type InteractionRelationID string
type SpeechAct string
type Channel string
type ConversationState string
type InterpretationState string
type InteractionRelationKind string
type InterpretationID string
type SemanticCandidateID string
type ProjectReferenceID string
type ProjectReferenceRole string
type ClarificationState string
type SemanticApplicability string
type SemanticCandidateSource string
type SemanticCandidateSelectionState string
type InformationRequestKind string
const (
ChannelWebChat Channel = "WEB_CHAT"
ConversationOpen ConversationState = "OPEN"
ConversationArchived ConversationState = "ARCHIVED"
SpeechActDirective SpeechAct = "DIRECTIVE"
SpeechActAssertion SpeechAct = "ASSERTION"
SpeechActDecision SpeechAct = "DECISION"
SpeechActPreference SpeechAct = "PREFERENCE"
SpeechActQuestion SpeechAct = "QUESTION"
SpeechActHypothesis SpeechAct = "HYPOTHESIS"
SpeechActCorrection SpeechAct = "CORRECTION"
SpeechActRequestToInvestigate SpeechAct = "REQUEST_TO_INVESTIGATE"
SpeechActConfirmation SpeechAct = "CONFIRMATION"
SpeechActRejection SpeechAct = "REJECTION"
SpeechActCancellation SpeechAct = "CANCELLATION"
SpeechActConversational SpeechAct = "CONVERSATIONAL"
SpeechActUnknown SpeechAct = "UNKNOWN"
InterpretationRecorded InterpretationState = "RECORDED"
InterpretationInterpreted InterpretationState = "INTERPRETED"
RelationCorrects InteractionRelationKind = "CORRECTS"
RelationRespondsTo InteractionRelationKind = "RESPONDS_TO"
RelationRequestsCognition InteractionRelationKind = "REQUESTS_COGNITION"
RelationCognitionFallback InteractionRelationKind = "COGNITION_FALLBACK"
RelationSupersedes InteractionRelationKind = "SUPERSEDES"
RelationClarifies InteractionRelationKind = "CLARIFIES"
ProjectRolePrimary ProjectReferenceRole = "PRIMARY"
ProjectRoleRelated ProjectReferenceRole = "RELATED"
ProjectRoleReferenceSource ProjectReferenceRole = "REFERENCE_SOURCE"
ClarificationNotRequired ClarificationState = "NOT_REQUIRED"
ClarificationRequired ClarificationState = "REQUIRED"
SemanticApplicable SemanticApplicability = "APPLICABLE"
SemanticLowConfidence SemanticApplicability = "LOW_CONFIDENCE"
SemanticMixedIntent SemanticApplicability = "MIXED_INTENT"
SemanticNeedsBroaderInterpret SemanticApplicability = "NEEDS_BROADER_INTERPRETATION"
SemanticCandidateClarify SemanticApplicability = "CLARIFICATION_REQUIRED"
CandidateSourceDeterministic SemanticCandidateSource = "DETERMINISTIC_V2"
CandidateSourceCognitive SemanticCandidateSource = "COGNITIVE_V1"
CandidateSelected SemanticCandidateSelectionState = "SELECTED"
CandidateObserved SemanticCandidateSelectionState = "OBSERVED"
CandidateRejected SemanticCandidateSelectionState = "REJECTED"
InformationRequestCapabilityInventory InformationRequestKind = "CAPABILITY_INVENTORY"
InformationRequestCognitiveModelInventory InformationRequestKind = "COGNITIVE_MODEL_INVENTORY"
InformationRequestCognitiveChannelStatus InformationRequestKind = "COGNITIVE_CHANNEL_STATUS"
InformationRequestCognitiveRecovery InformationRequestKind = "COGNITIVE_RECOVERY"
)
type Conversation struct {
ID ConversationID
ActorID identity.ActorID
PrincipalID identity.PrincipalID
Channel Channel
State ConversationState
CreatedAtUnixMillis int64
UpdatedAtUnixMillis int64
}
type HumanUtterance struct {
ID HumanUtteranceID
ConversationID ConversationID
ActorID identity.ActorID
PrincipalID identity.PrincipalID
Channel Channel
ReceivedAtUnixMillis int64
CorrelationID string
Content string
ContentRef string
SpeechAct SpeechAct
InterpretationState InterpretationState
CorrectsUtteranceID HumanUtteranceID
}
type OriginalHumanIntent struct {
ID OriginalHumanIntentID
UtteranceID HumanUtteranceID
RecordedAtUnixMillis int64
Text string
}
type InteractionRelation struct {
ID InteractionRelationID
FromUtteranceID HumanUtteranceID
ToUtteranceID HumanUtteranceID
Kind InteractionRelationKind
RecordedAtUnixMillis int64
}
type UtteranceInterpretation struct {
ID InterpretationID
UtteranceID HumanUtteranceID
SpeechAct SpeechAct
SecondarySpeechAct SpeechAct
ConfidenceMillis int64
Source string
AssertionVerification string
RequestedOutcome string
Clarification ClarificationState
NeedsCognition bool
Applicability SemanticApplicability
SelectionReason string
RecordedAtUnixMillis int64
}
type SemanticCandidate struct {
ID SemanticCandidateID
UtteranceID HumanUtteranceID
Source SemanticCandidateSource
SelectionState SemanticCandidateSelectionState
PrimarySpeechAct SpeechAct
SecondarySpeechAct SpeechAct
ConfidenceMillis int64
Applicability SemanticApplicability
RequestedOutcome string
Clarification ClarificationState
NeedsCognition bool
SelectionReason string
CapabilityHints []string
RecordedAtUnixMillis int64
}
type ProjectReference struct {
ID ProjectReferenceID
UtteranceID HumanUtteranceID
ProjectID situation.ProjectID
ProjectDisplayName string
Role ProjectReferenceRole
Provenance situation.ProjectResolutionProvenance
ConfidenceMillis int64
RecordedAtUnixMillis int64
}
type ChatMessageRequest struct {
ConversationID ConversationID
Message string
CorrelationID string
CorrectsUtteranceID HumanUtteranceID
}
type ChatMessageResponse struct {
ConversationID ConversationID
UtteranceID HumanUtteranceID
OriginalIntentID OriginalHumanIntentID
SpeechAct SpeechAct
InterpretationState InterpretationState
NeedsCognition bool
FallbackText string
ActiveProjectName string
ProjectProvenance situation.ProjectResolutionProvenance
Clarification ClarificationState
WorkPlanned bool
PlanningReply string
ResearchBacked bool
CapabilityStatus capability.CapabilityResolutionStatus
CapabilityKind capability.CapabilityKind
CapabilityHints []capability.CapabilityKind
RequestedOutcome string
InformationRequestKind InformationRequestKind
InterpretationConfidenceMillis int64
CapabilityGapID capability.CapabilityGapID
DelegationID string
DelegationState string
Reminder *continuity.ProspectiveItem
}