Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All notable changes to this project will be documented in this file.
- Plugin no longer crashes on update check failure; logs a warning instead
- Exception causes are now properly chained rather than stringified
- Automatic config migration on startup: upgraded installs from 1.2.0 will have their configuration keys silently updated to the current format (no manual edits required)

- A temperature value of 0 is now passed to the AI model for deterministic filtering

### 🐛 Fixed

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {

// Project metadata
group = 'de.pixelmindmc'
version = '1.2.0'
version = '1.3.0'
description = 'AI-powered chat moderation featuring smart filtering, anti-spam and rich chat formatting including emojis and colors'

// Dependency versions
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/de/pixelmindmc/pixelchat/utils/APIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ public APIHelper(@NotNull PixelChat plugin) {
* @throws IOException If any issue happens, an exception is thrown
*/
private void sendRequest(@NotNull HttpURLConnection connection, @NotNull String message) throws IOException {
Map<String, Object> json = Map.of("model", configHelper.getString(ConfigConstants.API.MODEL), "messages", new Map[]{Map.of("role", "system", APIConstants.General.CONTENT, configHelper.getString(ConfigConstants.API.SYSTEM_PROMPT) + "Language: " + configHelper.getString(ConfigConstants.General.LANGUAGE)), Map.of("role", "user", APIConstants.General.CONTENT, message)}, "response_format", Map.of("type", "json_object"));

Map<String, Object> json = Map.of(
"model", configHelper.getString(ConfigConstants.API.MODEL),
"messages", new Map[]{Map.of("role", "system", APIConstants.General.CONTENT, configHelper.getString(ConfigConstants.API.SYSTEM_PROMPT) + "Language: " + configHelper.getString(ConfigConstants.General.LANGUAGE)), Map.of("role", "user", APIConstants.General.CONTENT, message)},
"response_format", Map.of("type", "json_object"),
"temperature", 0
);
String jsonInputString = new Gson().toJson(json);

// Debug logger message
Expand Down
Loading