Skip to content

Commit

Permalink
0.9 update
Browse files Browse the repository at this point in the history
  • Loading branch information
HAV0X1014 committed Sep 18, 2024
1 parent 222c10b commit 46d6846
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/GeminiAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static String send(String dialog, String mainCharacter) {
JSONObject response = new JSONObject(responseContent);
output = response.getJSONArray("candidates").getJSONObject(0).getJSONObject("content").getJSONArray("parts").getJSONObject(0).getString("text");
} catch (Exception e) {
System.out.println("[Gemini API error.]\n\n" + responseContent);
System.out.println("[Gemini API error.]\n" + responseContent);
throw new RuntimeException(e);
}
return output;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/Summarize.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ public static void summarize(File[] files, String folderPath, String id, String
JSONArray allScenarios = new JSONArray();
for (int f = startingPoint; f < stoppingPoint; f++) {
File file = files[f];
String fileContents = FileHandler.read(folderPath + file.getName());
JSONObject scenario = new JSONObject(fileContents);
JSONObject scenario = new JSONObject(FileHandler.read(folderPath + file.getName()));
allScenarios.put(scenario);
}
//this loop gets the character names from the currently available scenarios and puts them in charaName
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/SummaryMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public static void main(String[] args) {
//setup process. if the config doesnt exist, make it. if the directories dont exist, make them.
if (!new File("config.json").exists()) {
ConfigHandler.createConfig();
System.out.println("**The config file has been created. Place your API key in config.json to use the summarizer!**\n");
System.out.println("**The config file has been created. Place your API key in config.json to use the summarizer!**\n" +
"Since your config file and folder have been created, I assume this is your first time using this summarizer.\n" +
"Place the folders named 'another,' 'char,' 'event,' 'login,' and 'main' in the *same directory* as this\n" +
"program. Place the file named 'CHARA_DATAS.json' in the same directory as this program as well.\n");
}
if (!SummaryDirs.exists()) {
SummaryDirs.mkdirs();
Expand All @@ -37,7 +40,7 @@ public static void main(String[] args) {
while (true) {
//user input and validation
System.out.println("Choose which story you want to summarize. Type \"main\", \"main2\", \"main3\", \"main4\", \"another\", \"event\" or a Friend ID.\n" +
"(To summarize a Friend story, input the ID of the Friend, format \"3\" or \"179\". \"event\" requires an ID for the event.)\n" +
"(To summarize a Friend story, input the ID of the Friend, format \"3\" or \"179\". \"event\" also requires an ID for the event.)\n" +
"[Use ctrl + c to quit]");
String choice = sc.nextLine();
while (!choice.equals("main") && !choice.equals("main2") && !choice.equals("main3") && !choice.equals("main4") && !choice.equals("another") && !choice.equals("event") && !isInt(choice)) {
Expand Down

0 comments on commit 46d6846

Please sign in to comment.