这是一个newBing API的Java实现
<dependency>
<groupId>io.github.heartalborada-del</groupId>
<artifactId>newBingAPI</artifactId>
<version>latest</version>
</dependency>
import io.github.heartalborada_del.newBingAPI.interfaces.Callback;
import com.google.gson.JsonObject;
public class Main {
public static void main(String[] args) {
new Chat(
"Your cookies(or you can set it empty)",
"Set new bing mode(Creative/Balanced/Precise)"
).newChat().newQuestion("Your question", new Callback() {
@Override
public void onSuccess(JsonObject rawData) {
//TODO
}
@Override
public void onFailure(JsonObject rawData, String cause) {
//TODO
}
@Override
public void onUpdate(JsonObject rawData){
//TODO
}
});
}
}