Skip to content

Commit

Permalink
Fix spotless
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Lee <[email protected]>
  • Loading branch information
austintlee committed Sep 1, 2023
1 parent 1eb9444 commit 8f4d90d
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ public Collection<Object> createComponents(

// TODO move this into MLFeatureEnabledSetting
this.ragSearchPipelineEnabled = ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED.get(clusterService.getSettings());
clusterService.getClusterSettings()
clusterService
.getClusterSettings()
.addSettingsUpdateConsumer(ML_COMMONS_RAG_PIPELINE_FEATURE_ENABLED, it -> ragSearchPipelineEnabled = it);

mlIndicesHandler = new MLIndicesHandler(clusterService, client);
Expand Down Expand Up @@ -677,31 +678,32 @@ public List<Setting<?>> getSettings() {

@Override
public List<SearchPlugin.SearchExtSpec<?>> getSearchExts() {
return ragSearchPipelineEnabled ? List
.of(
new SearchPlugin.SearchExtSpec<>(
GenerativeQAParamExtBuilder.PARAMETER_NAME,
input -> new GenerativeQAParamExtBuilder(input),
parser -> GenerativeQAParamExtBuilder.parse(parser)
return ragSearchPipelineEnabled
? List
.of(
new SearchPlugin.SearchExtSpec<>(
GenerativeQAParamExtBuilder.PARAMETER_NAME,
input -> new GenerativeQAParamExtBuilder(input),
parser -> GenerativeQAParamExtBuilder.parse(parser)
)
)
)
// Feature not enabled
: Collections.emptyList();
// Feature not enabled
: Collections.emptyList();
}

@Override
public Map<String, Processor.Factory<SearchRequestProcessor>> getRequestProcessors(Parameters parameters) {
return ragSearchPipelineEnabled ?
Map.of(GenerativeQAProcessorConstants.REQUEST_PROCESSOR_TYPE, new GenerativeQARequestProcessor.Factory())
// Feature not enabled
: Collections.emptyMap();
return ragSearchPipelineEnabled
? Map.of(GenerativeQAProcessorConstants.REQUEST_PROCESSOR_TYPE, new GenerativeQARequestProcessor.Factory())
// Feature not enabled
: Collections.emptyMap();
}

@Override
public Map<String, Processor.Factory<SearchResponseProcessor>> getResponseProcessors(Parameters parameters) {
return ragSearchPipelineEnabled ?
Map.of(GenerativeQAProcessorConstants.RESPONSE_PROCESSOR_TYPE, new GenerativeQAResponseProcessor.Factory(this.client))
// Feature not enabled
: Collections.emptyMap();
return ragSearchPipelineEnabled
? Map.of(GenerativeQAProcessorConstants.RESPONSE_PROCESSOR_TYPE, new GenerativeQAResponseProcessor.Factory(this.client))
// Feature not enabled
: Collections.emptyMap();
}
}

0 comments on commit 8f4d90d

Please sign in to comment.