tweak displaying options

This commit is contained in:
Minecon724 2024-09-05 16:28:20 +02:00
parent fb5ffa99a0
commit 7cbe735c3c
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -35,6 +35,7 @@ class Main {
complainedApiKey = true; complainedApiKey = true;
} }
//ChatSource source = new ExampleSource();
ChatSource source = new OaiSource(apiKey); ChatSource source = new OaiSource(apiKey);
source.options().setValue("model", "chatgpt-4o-latest"); source.options().setValue("model", "chatgpt-4o-latest");
@ -140,15 +141,15 @@ class Main {
System.out.println("Available options:"); System.out.println("Available options:");
for (Option<?> option : options.getOptions()) { for (Option<?> option : options.getOptions()) {
String value = option.toString() + " (" + option.getType().getName() + ")"; String value = option.getValue().toString();
if (option.id.equals(chosenOption)) { if (option.id.equals(chosenOption)) {
System.out.printf("\033[1m%s (%s) = %s\033[0m\n", option.label, option.id, value); System.out.printf("\033[1m%s (%s) = %s (%s)\033[0m\n", option.label, option.id, value, option.getType().getName());
} else { } else {
if (option.label.toLowerCase().contains("key")) { if (option.label.toLowerCase().contains("key")) {
value = "(looks confidential, specify to see)"; value = "(looks confidential, specify to see)";
} }
System.out.printf("%s (%s) = %s\n", option.label, option.id, value); System.out.printf("%s (%s) = %s (%s)\n", option.label, option.id, value, option.getType().getSimpleName());
} }
} }
} }