Skip to content

Commit

Permalink
feat: added listing params for attachment support (#44) (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Nov 21, 2023
1 parent 5d7c839 commit e0a9549
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.idea/
.vscode/
build/
bin/
bin/
*.log
3 changes: 3 additions & 0 deletions src/main/java/com/epam/aidial/core/config/Deployment.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import lombok.Data;

import java.util.List;
import java.util.Set;

@Data
Expand All @@ -23,4 +24,6 @@ public abstract class Deployment {
*/
private boolean forwardApiKey = true;
private String rateEndpoint;
private List<String> inputAttachmentTypes;
private Integer maxInputAttachments;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ private static ApplicationData createApplication(Application application) {
data.setDisplayName(application.getDisplayName());
data.setIconUrl(application.getIconUrl());
data.setDescription(application.getDescription());
data.setInputAttachmentTypes(application.getInputAttachmentTypes());
data.setMaxInputAttachments(application.getMaxInputAttachments());
return data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ private static AssistantData createAssistant(Assistant assistant) {
data.setIconUrl(assistant.getIconUrl());
data.setDescription(assistant.getDescription());
data.setAddons(assistant.getAddons());
data.setInputAttachmentTypes(assistant.getInputAttachmentTypes());
data.setMaxInputAttachments(assistant.getMaxInputAttachments());
return data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ private static ModelData createModel(Model model) {
}

data.setLimits(createLimits(model.getLimits()));
data.setInputAttachmentTypes(model.getInputAttachmentTypes());
data.setMaxInputAttachments(model.getMaxInputAttachments());
return data;
}

Expand Down
4 changes: 4 additions & 0 deletions src/main/java/com/epam/aidial/core/data/DeploymentData.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import lombok.Data;

import java.util.List;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
Expand All @@ -23,4 +25,6 @@ public class DeploymentData {
private long createdAt = 1672534800;
private long updatedAt = 1672534800;
private ScaleSettingsData scaleSettings = new ScaleSettingsData();
private List<String> inputAttachmentTypes;
private Integer maxInputAttachments;
}
4 changes: 3 additions & 1 deletion src/main/resources/aidial.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"endpoint": "http://localhost:7001/openai/deployments/10k/chat/completions",
"displayName": "10k",
"iconUrl": "http://localhost:7001/logo10k.png",
"description": "Some description of the application for testing"
"description": "Some description of the application for testing",
"inputAttachmentTypes": ["*/*"],
"maxInputAttachments": 1
}
},
"models": {
Expand Down

0 comments on commit e0a9549

Please sign in to comment.