personality.go 1.5 KB

123456789101112131415161718192021
  1. package eliza
  2. // Personality defines whats in a bot script
  3. type Personality struct {
  4. Name string `json:"name" yaml:"name"`
  5. Version string `json:"version,omitempty" yaml:"version,omitempty"`
  6. Commands map[string][]string `json:"commands,omitempty" yaml:"commands,omitempty"`
  7. Introductions []string `json:"introductions,omitempty" yaml:"introductions,omitempty"`
  8. Goodbyes []string `json:"goodbyes,omitempty" yaml:"goodbyes,omitempty"`
  9. Psychobabble []SimilarQuestionResponse `json:"psychobabble,omitempty" yaml:"psychobabble,omitempty"`
  10. DefaultResponses []string `json:"defaultresponses,omitempty" yaml:"defaultresponses,omitempty"`
  11. QuitResponses []string `json:"quitresponses,omitempty" yaml:"quitresponses,omitempty"`
  12. ReflectedWords map[string]string `json:"reflectedwords,omitempty" yaml:"reflectedwords,omitempty"`
  13. }
  14. // SimilarQuestionResponse is a structure which defines questions and their responses ... maps to an actual response from the bot.
  15. // There are many ways to say "hello" and to respond to it. So we are changing from a map of string-*string to a list of *string->*string
  16. type SimilarQuestionResponse struct {
  17. SimilarQuestions []string `json:"similarQuestions,omitempty" yaml:"similarQuestions,omitempty"`
  18. Responses []string `json:"responses,omitempty" yaml:"responses,omitempty"`
  19. }