feat: initial commit
This commit is contained in:
28
internal/domain/entity/intent.go
Normal file
28
internal/domain/entity/intent.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package entity
|
||||
|
||||
type Intent struct {
|
||||
Name string
|
||||
Confidence float64
|
||||
Entities map[string]any
|
||||
}
|
||||
|
||||
type RouteTargetType string
|
||||
|
||||
const (
|
||||
RouteTargetN8n RouteTargetType = "n8n"
|
||||
RouteTargetAIAgent RouteTargetType = "ai_agent"
|
||||
RouteTargetBuiltin RouteTargetType = "builtin"
|
||||
)
|
||||
|
||||
type RouteTarget struct {
|
||||
Type RouteTargetType
|
||||
WorkflowID string
|
||||
Endpoint string
|
||||
}
|
||||
|
||||
type Route struct {
|
||||
Pattern string
|
||||
IntentName string
|
||||
Target RouteTarget
|
||||
Priority int
|
||||
}
|
||||
29
internal/domain/entity/message.go
Normal file
29
internal/domain/entity/message.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type MessageType string
|
||||
|
||||
const (
|
||||
MessageTypeText MessageType = "text"
|
||||
MessageTypeVoice MessageType = "voice"
|
||||
)
|
||||
|
||||
type Message struct {
|
||||
MessageID int64
|
||||
ChatID int64
|
||||
UserID int64
|
||||
Username string
|
||||
Type MessageType
|
||||
Text string
|
||||
VoiceFileID string
|
||||
Timestamp time.Time
|
||||
Metadata map[string]any
|
||||
}
|
||||
|
||||
type VoiceMessage struct {
|
||||
FileID string
|
||||
Duration int
|
||||
MimeType string
|
||||
FileSize int
|
||||
}
|
||||
22
internal/domain/entity/user.go
Normal file
22
internal/domain/entity/user.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
TelegramID int64
|
||||
Username string
|
||||
FirstName string
|
||||
LastName string
|
||||
Language string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type Session struct {
|
||||
UserID int64
|
||||
ChatID int64
|
||||
CurrentWorkflow string
|
||||
History []Message
|
||||
Data map[string]any
|
||||
UpdatedAt time.Time
|
||||
TTL int // hours
|
||||
}
|
||||
29
internal/domain/entity/workflow.go
Normal file
29
internal/domain/entity/workflow.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
type WorkflowRequest struct {
|
||||
RequestID string
|
||||
ChatID int64
|
||||
UserID int64
|
||||
Username string
|
||||
MessageText string
|
||||
Intent Intent
|
||||
Session Session
|
||||
Timestamp time.Time
|
||||
Metadata map[string]any
|
||||
}
|
||||
|
||||
type Action struct {
|
||||
Type string
|
||||
Key string
|
||||
Value any
|
||||
}
|
||||
|
||||
type WorkflowResponse struct {
|
||||
RequestID string
|
||||
ReplyText string
|
||||
Actions []Action
|
||||
NextWorkflow string
|
||||
Error error
|
||||
}
|
||||
Reference in New Issue
Block a user