Skip to content

Commit 129c477

Browse files
committed
Define ChatGPT model in discord.properties
1 parent fb46929 commit 129c477

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/oakbot/discord/DiscordProperties.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class DiscordProperties extends PropertiesWrapper {
1616
private final String stabilityAIKey;
1717
private final int openAIMessageHistoryCount;
1818
private final String openAIPrompt;
19+
private final String openAIModel;
1920
private final List<Long> adminUsers;
2021
private final List<Long> ignoredChannels;
2122

@@ -26,6 +27,7 @@ public DiscordProperties(Path path) throws IOException {
2627
openAIKey = get("openai.key");
2728
openAIMessageHistoryCount = getInteger("openai.messageHistoryCount", 10);
2829
openAIPrompt = get("openai.prompt");
30+
openAIModel = get("openai.model");
2931
stabilityAIKey = get("stabilityai.key");
3032
adminUsers = getLongList("admins");
3133
ignoredChannels = getLongList("ignoredChannels");
@@ -55,6 +57,10 @@ public String getOpenAIPrompt() {
5557
return openAIPrompt;
5658
}
5759

60+
public String getOpenAIModel() {
61+
return openAIModel;
62+
}
63+
5864
public List<Long> getAdminUsers() {
5965
return adminUsers;
6066
}

src/main/java/oakbot/discord/MainDiscord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void main(String[] args) throws Exception {
3636
new ShutdownCommand()
3737
));
3838
var listeners = List.of(
39-
new ChatGPTListener(openAIClient, "gpt-5-mini", properties.getOpenAIPrompt(), 2000, properties.getOpenAIMessageHistoryCount()),
39+
new ChatGPTListener(openAIClient, properties.getOpenAIModel(), properties.getOpenAIPrompt(), 2000, properties.getOpenAIMessageHistoryCount()),
4040
new WaveListener(),
4141
new CommandListener(trigger, commands)
4242
);

0 commit comments

Comments
 (0)