Skip to content

Commit

Permalink
fix: Application/Model listing API returns wrong value for max_retry_…
Browse files Browse the repository at this point in the history
…attemps #616
  • Loading branch information
astsiapanay committed Dec 13, 2024
1 parent 6b01926 commit 5691e1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.util.ArrayList;
import java.util.List;

import static com.epam.aidial.core.server.controller.ModelController.createModel;

@RequiredArgsConstructor
public class DeploymentController {

Expand All @@ -39,7 +41,7 @@ public Future<?> getDeployment(String deploymentId) {
return context.respond(HttpStatus.FORBIDDEN);
}

DeploymentData data = createDeployment(model);
DeploymentData data = createModel(model);
return context.respond(HttpStatus.OK, data);
}

Expand All @@ -49,7 +51,7 @@ public Future<?> getDeployments() {

for (Model model : config.getModels().values()) {
if (model.hasAccess(context.getUserRoles())) {
DeploymentData deployment = createDeployment(model);
DeploymentData deployment = createModel(model);
deployments.add(deployment);
}
}
Expand Down Expand Up @@ -95,13 +97,6 @@ public static Future<Deployment> selectDeployment(ProxyContext context, String i
}, false);
}

private static DeploymentData createDeployment(Model model) {
DeploymentData deployment = new DeploymentData();
deployment.setId(model.getName());
deployment.setModel(model.getName());
return deployment;
}

static FeaturesData createFeatures(Features features) {
FeaturesData data = new FeaturesData();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Future<?> getModels() {
return context.respond(HttpStatus.OK, list);
}

private static ModelData createModel(Model model) {
static ModelData createModel(Model model) {
ModelData data = new ModelData();
data.setId(model.getName());
data.setModel(model.getName());
Expand All @@ -68,6 +68,7 @@ private static ModelData createModel(Model model) {
data.setMaxInputAttachments(model.getMaxInputAttachments());
data.setReference(model.getName());
data.setDescriptionKeywords(model.getDescriptionKeywords());
data.setMaxRetryAttempts(model.getMaxRetryAttempts());

if (model.getType() == ModelType.EMBEDDING) {
data.getCapabilities().setEmbeddings(true);
Expand Down

0 comments on commit 5691e1b

Please sign in to comment.