Files
Assistant/contracts/interaction/types.go
T
m caad0ae2d4
CI / test (push) Successful in 14s
CI / test (pull_request) Successful in 14s
DEV-000061 checkpoint interaction chat foundation
2026-08-17 14:15:07 +03:00

92 lines
3.3 KiB
Go

package interaction
import "git.cin.su/m/Assistant/contracts/identity"
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
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"
)
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 ChatMessageRequest struct {
ConversationID ConversationID
Message string
CorrelationID string
CorrectsUtteranceID HumanUtteranceID
}
type ChatMessageResponse struct {
ConversationID ConversationID
UtteranceID HumanUtteranceID
SpeechAct SpeechAct
InterpretationState InterpretationState
NeedsCognition bool
FallbackText string
}