data.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package eliza
  2. // InteractiveBot This is the interface to comunicate with the bot
  3. type InteractiveBot interface {
  4. ReplyTo(statement string) (string, *Personality)
  5. }
  6. // Chatbot Defines data to be used by a chatbot personality - essentially
  7. // Its personality script and execution context
  8. type Chatbot struct {
  9. Personality *Personality
  10. Context *ChatbotContext
  11. }
  12. // ChatbotContext is the white board structure
  13. type ChatbotContext struct {
  14. EngineVersion string
  15. Session SessionData
  16. }
  17. // ChatbotInteraction defines a individual question/answer interaction with a caller
  18. // The raw answer is the response selected before any substitution
  19. type ChatbotInteraction struct {
  20. Time string `json:"time,omitempty" yaml:"time,omitempty"`
  21. Question string `json:"question,omitempty" yaml:"question,omitempty"`
  22. PatternGroup string `json:"patternGroup,omitempty" yaml:"patternGroup,omitempty"`
  23. Pattern string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
  24. RawAnswer string `json:"rawAnswer,omitempty" yaml:"rawAnswer,omitempty"`
  25. Answer string `json:"answer,omitempty" yaml:"answer,omitempty"`
  26. }
  27. // SessionData defines information about the current bot and its interaction within a specific session
  28. type SessionData struct {
  29. SessionID string `json:"sessionID" yaml:"sessionID"`
  30. StartTime string `json:"startTime,omitempty" yaml:"startTime,omitempty"`
  31. User string `json:"user,omitempty" yaml:"user,omitempty"`
  32. Bot string `json:"bot,omitempty" yaml:"bot,omitempty"`
  33. BotVersion string `json:"botVersion,omitempty" yaml:"botVersion,omitempty"`
  34. Conversation []ChatbotInteraction `json:"conversation,omitempty" yaml:"conversation,omitempty"`
  35. }