Generalize and streamline model name retrieval in clients
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user