Generalize and streamline model name retrieval in clients

This commit is contained in:
extio-de
2026-04-03 15:40:51 +02:00
parent 31cf959d10
commit 1ce646edb2
10 changed files with 95 additions and 250 deletions

View File

@@ -32,6 +32,11 @@ public class ClientService {
return this.getClient(modelProfile);
}
public List<String> getModelNames(final ModelCategory category, final boolean forceReload) {
final var modelProfile = this.modelProfileService.getModelProfile(category.getModelProfile(), category);
return this.getModelNames(modelProfile, forceReload);
}
public boolean supportsToolCalling(final ModelCategory category) {
return this.getClient(category).supportsToolCalling();
}
@@ -46,6 +51,10 @@ public class ClientService {
.orElseThrow(() -> new IllegalStateException("No client found for model profile " + modelProfile.modelName()));
}
public List<String> getModelNames(final ModelProfile modelProfile, final boolean forceReload) {
return this.getClient(modelProfile).getModelNames(modelProfile, forceReload);
}
public boolean supportsToolCalling(final ModelProfile modelProfile) {
return this.getClient(modelProfile).supportsToolCalling();
}
@@ -101,6 +110,11 @@ public class ClientService {
}
return completion;
}
@Override
public List<String> getModelNames(final ModelProfile modelProfile, final boolean forceReload) {
return this.client.getModelNames(modelProfile, forceReload);
}
@Override
public ModelProvider getModelProvider() {