Class ChatGPTAPI

java.lang.Object
de.presti.ree6.utils.apis.ChatGPTAPI

public class ChatGPTAPI extends Object
API Handler class for the ChatGPT API Wrapper.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.lilittlecat.chatgpt.offical.ChatGPT
    Instance of the ChatGPT API.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor to initialise.
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getResponse(List<com.lilittlecat.chatgpt.offical.entity.Message> messages)
    Get a response based on a list of messages.
    static String
    getResponse(net.dv8tion.jda.api.entities.Member member, String message)
    Method used to get a response from the AI and storing the message in the in-memory List.
    void
    Method to initialise and create the API Wrapper Instance.
    void
    Method used to add more information to the predefined text.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • chatGPT

      public static com.lilittlecat.chatgpt.offical.ChatGPT chatGPT
      Instance of the ChatGPT API.
  • Constructor Details

    • ChatGPTAPI

      public ChatGPTAPI()
      Constructor to initialise.
  • Method Details

    • updatePreDefinedText

      public void updatePreDefinedText(String addition)
      Method used to add more information to the predefined text.
      Parameters:
      addition - the addition.
    • initGPT

      public void initGPT()
      Method to initialise and create the API Wrapper Instance.
    • getResponse

      public static String getResponse(net.dv8tion.jda.api.entities.Member member, String message)
      Method used to get a response from the AI and storing the message in the in-memory List.
      Parameters:
      member - the Member who send it.
      message - the Message of the Member.
      Returns:
      the response by the Model.
    • getResponse

      public static String getResponse(List<com.lilittlecat.chatgpt.offical.entity.Message> messages)
      Get a response based on a list of messages.
      Parameters:
      messages - the messages.
      Returns:
      the response by the Model.