Simple & light weighted chatGPT (openAi API-based library), chat with openai for free and endlessly..
Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.smith8h:SGPT:1.0.0'
}
Step 1. got to this website here and get your api-token to use it in this library Step 2. create new instance of SGPT class and pass your token:
SGPT chat = new SGPT("token here");
Step 3. now you can chat with AI by:
// create a callback to interact with chat
SGPT.ChatCallBack callback = new SGPT.ChatCallBack() {
@Override public void onResponse(String response) {
// do your stuff on response
}
@Override public void onFailure(String message) {
// do your stuff on failure
}
};
// now chat with AI
chat.chat("your message/question", callback);
And that's it!
If you would like to support this project's further development, the creator of this projects or the continuous maintenance of the project feel free to donate. Your donation is highly appreciated. Thank you!
You can choose what you want to donate, all donations are awesome!