Skip to content

Commit

Permalink
replace \n with \n\n in llm feedback response
Browse files Browse the repository at this point in the history
  • Loading branch information
Yinnii committed May 13, 2024
1 parent 66f3cfc commit c695b3f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,15 @@ public void run() {
System.out.println("Response Text" + serviceResponse.body());
JSONParser parser = new JSONParser();
JSONObject responseBody = (JSONObject) parser.parse(serviceResponse.body());

String r = responseBody.get("response").toString();
String pattern = "\n(?!\\n)";
String r_new = r.replaceAll(pattern, "\n\n");

System.out.println("Write response to markdown.");
//store response as markdown
FileWriter writer = new FileWriter("tmitocar/comparison_" + label1 + "_vs_" + label2 + ".md");
writer.write(responseBody.get("response").toString());
writer.write(r_new);
writer.close();

System.out.println("Convert markdown to pdf.");
Expand Down

0 comments on commit c695b3f

Please sign in to comment.