Skip to content

Commit

Permalink
feat: Create feature flag for the support of content parts #513 (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
astsiapanay authored Nov 6, 2024
1 parent 82e5256 commit 7dcf05e
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ public class Features {
@JsonAlias({"allowResume", "allow_resume"})
private Boolean allowResume;
private Boolean accessibleByPerRequestKey;
private Boolean contentPartsSupported;
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,8 @@ private static void setMissingFeatures(Deployment model, Features features) {
if (modelFeatures.getAccessibleByPerRequestKey() == null) {
modelFeatures.setAccessibleByPerRequestKey(features.getAccessibleByPerRequestKey());
}
if (modelFeatures.getContentPartsSupported() == null) {
modelFeatures.setContentPartsSupported(features.getContentPartsSupported());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ static FeaturesData createFeatures(Features features) {
data.setAccessibleByPerRequestKey(features.getAccessibleByPerRequestKey());
}

if (features.getContentPartsSupported() != null) {
data.setContentPartsSupported(features.getContentPartsSupported());
}

return data;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ public class FeaturesData {
private boolean folderAttachments = false;
private boolean allowResume = true;
private boolean accessibleByPerRequestKey = true;
private boolean contentPartsSupported = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,8 @@ void testOpenAiApi() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume" : true,
"accessible_by_per_request_key" : true
"accessible_by_per_request_key" : true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords" : [ ],
Expand Down Expand Up @@ -814,7 +815,8 @@ void testOpenAiApi() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume" : true,
"accessible_by_per_request_key" : true
"accessible_by_per_request_key" : true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords" : [ ]
Expand Down Expand Up @@ -842,7 +844,8 @@ void testOpenAiApi() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume" : true,
"accessible_by_per_request_key" : true
"accessible_by_per_request_key" : true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords" : [ ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ void testApplicationSharing() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords":[]
Expand Down Expand Up @@ -369,7 +370,8 @@ void testApplicationSharing() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -398,7 +400,8 @@ void testApplicationSharing() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords":[]
Expand Down Expand Up @@ -436,7 +439,8 @@ void testApplicationSharing() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -465,7 +469,8 @@ void testApplicationSharing() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords":[]
Expand Down Expand Up @@ -576,7 +581,8 @@ void testApplicationPublication() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -605,7 +611,8 @@ void testApplicationPublication() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume":true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords":[]
Expand Down Expand Up @@ -646,7 +653,8 @@ void testOpenAiApplicationListing() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume": true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -699,7 +707,8 @@ void testOpenAiApplicationListing() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume": true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -734,7 +743,8 @@ void testOpenAiApplicationListing() {
"url_attachments":false,
"folder_attachments":false,
"allow_resume": true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults":{},
"description_keywords":[]
Expand Down Expand Up @@ -763,7 +773,8 @@ void testOpenAiApplicationListing() {
"url_attachments" : false,
"folder_attachments" : false,
"allow_resume": true,
"accessible_by_per_request_key": true
"accessible_by_per_request_key": true,
"content_parts_supported": false
},
"defaults" : { },
"description_keywords":[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ void testFeaturesEmbedding(Vertx vertx, VertxTestContext context) {
{ "rate": false, "tokenize": false, "truncate_prompt": false
, "system_prompt": true, "tools": false, "seed": false
, "url_attachments": false, "folder_attachments": false
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true,
"content_parts_supported": false
}
"""));
}
Expand All @@ -62,7 +63,8 @@ void testFeaturesModel(Vertx vertx, VertxTestContext context) {
{ "rate": true, "tokenize": true, "truncate_prompt": true
, "system_prompt": true, "tools": true, "seed": true
, "url_attachments": true, "folder_attachments": false
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true,
"content_parts_supported": false
}
"""));
}
Expand All @@ -73,7 +75,8 @@ void testFeaturesApplication(Vertx vertx, VertxTestContext context) {
{ "rate": true, "tokenize": false, "truncate_prompt": false
, "system_prompt": false, "tools": false, "seed": false
, "url_attachments": false, "folder_attachments": false
, "configuration": true, "allow_resume": true, "accessible_by_per_request_key": true
, "configuration": true, "allow_resume": true, "accessible_by_per_request_key": true,
"content_parts_supported": false
}
"""));
}
Expand All @@ -84,7 +87,8 @@ void testFeaturesAssistant(Vertx vertx, VertxTestContext context) {
{ "rate": true, "tokenize": false, "truncate_prompt": false
, "system_prompt": true, "tools": false, "seed": false
, "url_attachments": false, "folder_attachments": false
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true
, "configuration": false, "allow_resume": true, "accessible_by_per_request_key": true,
"content_parts_supported": false
}
"""));
}
Expand Down

0 comments on commit 7dcf05e

Please sign in to comment.