Example #1
0
  public String talkToSelf(String input) {
    try {

      ChatterBot bot1 = factory.create(ChatterBotType.CLEVERBOT);
      ChatterBotSession bot1session = bot1.createSession();

      ChatterBot bot2 = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
      ChatterBotSession bot2session = bot2.createSession();

      while (continueToTalkToSelf) {

        System.out.println("bot1> " + input);

        input = bot2session.think(input);
        log.info(input);
        System.out.println("bot2> " + input);
        log.info(input);

        input = bot1session.think(input);
      }
    } catch (Exception e) {
      Logging.logException(e);
    }

    return input;
  }
Example #2
0
  public String chat(String toSay) {

    try {
      return session.think(toSay);
    } catch (Exception e) {
      Logging.logException(e);
    }

    return null;
  }