Skip to content

Commit

Permalink
Merge branch 'main' into feature/synthtic-source-recovery-default
Browse files Browse the repository at this point in the history
  • Loading branch information
salvatore-campagna authored Jan 10, 2025
2 parents b5ddc28 + 25a0448 commit 570ee9c
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,29 +242,39 @@ public void testGetServicesWithRerankTaskType() throws IOException {
@SuppressWarnings("unchecked")
public void testGetServicesWithCompletionTaskType() throws IOException {
List<Object> services = getServices(TaskType.COMPLETION);
assertThat(services.size(), equalTo(10));
if ((ElasticInferenceServiceFeature.DEPRECATED_ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG.isEnabled()
|| ElasticInferenceServiceFeature.ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG.isEnabled())) {
assertThat(services.size(), equalTo(10));
} else {
assertThat(services.size(), equalTo(9));
}

String[] providers = new String[services.size()];
for (int i = 0; i < services.size(); i++) {
Map<String, Object> serviceConfig = (Map<String, Object>) services.get(i);
providers[i] = (String) serviceConfig.get("service");
}

assertArrayEquals(
providers,
var providerList = new ArrayList<>(
List.of(
"alibabacloud-ai-search",
"amazonbedrock",
"anthropic",
"azureaistudio",
"azureopenai",
"cohere",
"elastic",
"googleaistudio",
"openai",
"streaming_completion_test_service"
).toArray()
)
);

if ((ElasticInferenceServiceFeature.DEPRECATED_ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG.isEnabled()
|| ElasticInferenceServiceFeature.ELASTIC_INFERENCE_SERVICE_FEATURE_FLAG.isEnabled())) {
providerList.add(6, "elastic");
}

assertArrayEquals(providers, providerList.toArray());
}

@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 570ee9c

Please sign in to comment.