Use enum value to store selected service (#265)

This commit is contained in:
Carl-Robert 2023-11-08 19:17:25 +02:00 committed by GitHub
parent ff60d1eab5
commit cfa5ff7776
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 166 additions and 233 deletions

View file

@ -39,7 +39,7 @@ public class SettingsComponent {
cards.add(serviceSelectionForm.getLlamaServiceSectionPanel(), ServiceType.LLAMA_CPP.getCode());
var serviceComboBoxModel = new DefaultComboBoxModel<ServiceType>();
serviceComboBoxModel.addAll(Arrays.stream(ServiceType.values())
.filter(it -> !"LLAMA_CPP".equals(it.getCode()) || SystemInfoRt.isUnix)
.filter(it -> ServiceType.LLAMA_CPP != it || SystemInfoRt.isUnix)
.collect(toList()));
serviceComboBox = new ComboBox<>(serviceComboBoxModel);
serviceComboBox.setSelectedItem(ServiceType.OPENAI);