Updated gpt library
This commit is contained in:
parent
0fc08ced02
commit
c083650047
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'it.ohalee.minecraftgpt'
|
||||
version = '1.2.4'
|
||||
version = '1.2.5'
|
||||
|
||||
sourceCompatibility = 1.17
|
||||
targetCompatibility = 1.17
|
||||
@ -25,7 +25,7 @@ dependencies {
|
||||
|
||||
compileOnly("io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT")
|
||||
|
||||
implementation 'com.theokanning.openai-gpt3-java:client:0.8.1'
|
||||
implementation 'com.theokanning.openai-gpt3-java:service:0.12.0'
|
||||
|
||||
compileOnly 'org.checkerframework:checker-qual:3.21.2'
|
||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||
|
@ -1,10 +1,11 @@
|
||||
package it.ohalee.minecraftgpt;
|
||||
|
||||
import com.theokanning.openai.OpenAiService;
|
||||
import com.theokanning.openai.completion.CompletionRequest;
|
||||
import com.theokanning.openai.service.OpenAiService;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import retrofit2.HttpException;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@ -13,7 +14,7 @@ public class OpenAI {
|
||||
private static OpenAiService service;
|
||||
|
||||
public static CompletableFuture<Void> init(String key) {
|
||||
return CompletableFuture.runAsync(() -> service = new OpenAiService(key, 5));
|
||||
return CompletableFuture.runAsync(() -> service = new OpenAiService(key, Duration.ofSeconds(5)));
|
||||
}
|
||||
|
||||
public static CompletableFuture<String> getResponse(ConfigurationSection section, StringBuilder cached, String message) {
|
||||
|
Loading…
Reference in New Issue
Block a user