From a51ece6cbb3b370439a1ae8b06c3238020d0f40b Mon Sep 17 00:00:00 2001 From: Presti Date: Sun, 4 Jun 2023 20:16:03 +0200 Subject: [PATCH] Updating config to also allow custom model. --- src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java | 2 +- src/main/java/de/presti/ree6/utils/data/Config.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java b/src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java index 065049fc0..220452d23 100644 --- a/src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java +++ b/src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java @@ -94,6 +94,6 @@ public static String getResponse(Member member, String message) { public static String getResponse(List messages) { if (!Data.isModuleActive("ai")) return "AI Module has been disabled!"; - return chatGPT.ask("ggml-gpt4all-j", messages); + return chatGPT.ask(Main.getInstance().getConfig().getConfiguration().getString("openai.model", "gpt-3.5-turbo-0301"), messages); } } diff --git a/src/main/java/de/presti/ree6/utils/data/Config.java b/src/main/java/de/presti/ree6/utils/data/Config.java index 15dc77e2d..d2611b3fe 100644 --- a/src/main/java/de/presti/ree6/utils/data/Config.java +++ b/src/main/java/de/presti/ree6/utils/data/Config.java @@ -132,7 +132,8 @@ public void init() { yamlFile.path("openai").path("apiToken").commentSide("Your OpenAI API-Token, for ChatGPT!") .addDefault("OpenAI API-Token") - .parent().path("apiUrl").addDefault("https://api.openai.com/v1/chat/completions").commentSide("The URL to the OpenAI API."); + .parent().path("apiUrl").addDefault("https://api.openai.com/v1/chat/completions").commentSide("The URL to the OpenAI API.") + .parent().path("model").addDefault("gpt-3.5-turbo-0301").commentSide("The Model used for the OpenAI API."); yamlFile.setBlankLine("openai");