Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
remove { and } from content
Browse files Browse the repository at this point in the history
  • Loading branch information
ramide1 authored Aug 8, 2024
1 parent 4f2ecb7 commit c9b7861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/ramide1/mcgemini/Gemini.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private String sendRequestToGeminiApi(String instructions, String sender, String
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(response.toString());
if (matcher.find()) {
content = matcher.group(1).replace("\\n", "").replace("\\", "").replace("\"", "");
content = matcher.group(1).replace("\\n", "").replace("\\", "").replace("\"", "").replace("{", "").replace("}", "");
newHistory = newHistory + "," + "{\"role\": \"model\",\"parts\": [" + "{\"text\": \"" + content
+ "\"}" + "]}";
saveHistory(sender, newHistory);
Expand Down Expand Up @@ -130,4 +130,4 @@ private boolean saveHistory(String sender, String history) {
private String getHistory(String sender) {
return plugin.dataConfig.contains(sender) ? plugin.dataConfig.getString(sender) : "";
}
}
}

0 comments on commit c9b7861

Please sign in to comment.