Class Bot

Direct Known Subclasses:
BotLibre, OllamaBot

public abstract class Bot extends User
A Bot is a Client that has no session. It does have own scene, and observes all events in the scene. It also responds to something that user(s) write. Bots are configured in application.properties file, and instantiated by BotManager on server startup.
Author:
joe
  • Constructor Details

    • Bot

      public Bot()
  • Method Details

    • getParameter

      public String getParameter(String key)
      Returns a parameter from parameter map
    • selfTest

      public abstract void selfTest() throws Exception
      Self test runs on server startup. Exceptions are logged but otherwise ignored.
      Throws:
      Exception
    • getResponseAsync

      public abstract reactor.core.publisher.Mono<String> getResponseAsync(Client c, String query)
    • respondTo

      public void respondTo(Client c, String what)
      Get response to something that a client "said", and write it
    • write

      public void write(String what)
      Utility method - "say" something, notify all listeners. Null is silently ignored, as in no response from the bot.
    • processEvent

      public void processEvent(VREvent event)
      Process an event. If that's something that a user wrote, calls respondTo method. Other events are ignored.
      Overrides:
      processEvent in class Client
      Parameters:
      event - Whatever has changed
    • objectsAdded

      public void objectsAdded(List<VRObject> objects)
      New objects in the scene, typically a client that has arrived. This implementation does nothing, utility method for subclasses.
    • objectsRemoved

      public void objectsRemoved(List<Map<String,String>> objects)
      Objects removed from the scene, typically a client that has left. This implementation does nothing, utility method for subclasses.
      Parameters:
      objects -
    • sendMessage

      public void sendMessage(Object o)
      Scene management method, called when the scene changes.
      Overrides:
      sendMessage in class Client
    • toString

      public String toString()
      Overrides:
      toString in class User
    • getGender

      public String getGender()
      Gender is advice for client, e.g. voice synthesis
    • getLang

      public String getLang()
      Bot language, e.g. in case it can speak more than one
    • getUrl

      public String getUrl()
      Configured URL of chatbot server, not published
    • getParameterMap

      public Map<String,String> getParameterMap()
      Configured bot parameters parameters, available through getParameter() method, not published
    • getAnimations

      public List<String> getAnimations()
      Available avatar animations, loaded from content/rpm-anim directory. Hint for the bot itself, not published.
    • setGender

      public void setGender(String gender)
      Gender is advice for client, e.g. voice synthesis
    • setLang

      public void setLang(String lang)
      Bot language, e.g. in case it can speak more than one
    • setUrl

      public void setUrl(String url)
      Configured URL of chatbot server, not published
    • setParameterMap

      public void setParameterMap(Map<String,String> parameterMap)
      Configured bot parameters parameters, available through getParameter() method, not published
    • setAnimations

      public void setAnimations(List<String> animations)
      Available avatar animations, loaded from content/rpm-anim directory. Hint for the bot itself, not published.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class User
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class User
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class User