Skip to content

Commit

Permalink
Updating config to also allow custom model.
Browse files Browse the repository at this point in the history
  • Loading branch information
DxsSucuk committed Jun 4, 2023
1 parent 50e7407 commit a51ece6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/de/presti/ree6/utils/apis/ChatGPTAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,6 @@ public static String getResponse(Member member, String message) {
public static String getResponse(List<Message> 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);
}
}
3 changes: 2 additions & 1 deletion src/main/java/de/presti/ree6/utils/data/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit a51ece6

Please sign in to comment.