Skip to content

Commit

Permalink
Added Predict and SearchRequest workflow step
Browse files Browse the repository at this point in the history
Signed-off-by: Owais Kazi <[email protected]>
  • Loading branch information
owaiskazi19 committed Mar 27, 2024
1 parent 8820d89 commit 4a2d752
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/main/java/org/opensearch/flowframework/common/CommonValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ private CommonValue() {}
/** Pipeline Configurations */
public static final String CONFIGURATIONS = "configurations";

/** Indexes for knn query **/
public static final String INPUT_INDEX = "input_index";

/** Query for knn Search Request*/
public static final String INCLUDES = "includes";

/** Vectors field */
public static final String VECTORS = "vectors";

/** Search request */
public static final String SEARCH_REQUEST = "search_request";
/** Search response */
public static final String SEARCH_RESPONSE = "search_response";

/*
* Constants associated with resource provisioning / state
*/
Expand Down
147 changes: 147 additions & 0 deletions src/main/java/org/opensearch/flowframework/workflow/PredictStep.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.flowframework.workflow;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.ExceptionsHelper;
import org.opensearch.action.support.PlainActionFuture;
import org.opensearch.core.action.ActionListener;
import org.opensearch.flowframework.exception.WorkflowStepException;
import org.opensearch.flowframework.util.ParseUtils;
import org.opensearch.index.query.QueryBuilders;
import org.opensearch.ml.client.MachineLearningNodeClient;
import org.opensearch.ml.common.FunctionName;
import org.opensearch.ml.common.dataset.MLInputDataset;
import org.opensearch.ml.common.dataset.SearchQueryInputDataset;
import org.opensearch.ml.common.input.MLInput;
import org.opensearch.ml.common.output.MLOutput;
import org.opensearch.ml.common.output.model.ModelTensor;
import org.opensearch.ml.common.output.model.ModelTensorOutput;
import org.opensearch.ml.common.output.model.ModelTensors;
import org.opensearch.search.builder.SearchSourceBuilder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import static org.opensearch.flowframework.common.CommonValue.INCLUDES;
import static org.opensearch.flowframework.common.CommonValue.INPUT_INDEX;
import static org.opensearch.flowframework.common.CommonValue.VECTORS;
import static org.opensearch.flowframework.common.WorkflowResources.MODEL_ID;

/**
* Step to predict data
*/
public class PredictStep implements WorkflowStep {

private static final Logger logger = LogManager.getLogger(PredictStep.class);

Check warning on line 48 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L48

Added line #L48 was not covered by tests

/** The name of this step, used as a key in the template and the {@link WorkflowStepFactory} */
public static final String NAME = "predict";
private MachineLearningNodeClient mlClient;

/**
* Instantiate this class
* @param mlClient client to instantiate MLClient
*/
public PredictStep(MachineLearningNodeClient mlClient) {
this.mlClient = mlClient;
}

Check warning on line 60 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L58-L60

Added lines #L58 - L60 were not covered by tests

@Override
public PlainActionFuture<WorkflowData> execute(
String currentNodeId,
WorkflowData currentNodeInputs,
Map<String, WorkflowData> outputs,
Map<String, String> previousNodeInputs,
Map<String, String> params
) {
PlainActionFuture<WorkflowData> predictFuture = PlainActionFuture.newFuture();

Check warning on line 70 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L70

Added line #L70 was not covered by tests

ActionListener<MLOutput> actionListener = new ActionListener<>() {

Check warning on line 72 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L72

Added line #L72 was not covered by tests

@Override
public void onResponse(MLOutput mlOutput) {
logger.info("Prediction done. Storing vectors");
final List<List<Float>> vector = buildVectorFromResponse(mlOutput);

Check warning on line 77 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L76-L77

Added lines #L76 - L77 were not covered by tests

predictFuture.onResponse(
new WorkflowData(Map.ofEntries(Map.entry(VECTORS, vector)), currentNodeInputs.getWorkflowId(), currentNodeId)

Check warning on line 80 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L79-L80

Added lines #L79 - L80 were not covered by tests
);
}

Check warning on line 82 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L82

Added line #L82 was not covered by tests

@Override
public void onFailure(Exception e) {
String errorMessage = "Failed to predict the data";
logger.error(errorMessage, e);
predictFuture.onFailure(new WorkflowStepException(errorMessage, ExceptionsHelper.status(e)));
}

Check warning on line 89 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L86-L89

Added lines #L86 - L89 were not covered by tests
};

Set<String> requiredKeys = Set.of(MODEL_ID, INPUT_INDEX, INCLUDES);

Check warning on line 92 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L92

Added line #L92 was not covered by tests

Set<String> optionalKeys = Collections.emptySet();

Check warning on line 94 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L94

Added line #L94 was not covered by tests

try {
Map<String, Object> inputs = ParseUtils.getInputsFromPreviousSteps(

Check warning on line 97 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L97

Added line #L97 was not covered by tests
requiredKeys,
optionalKeys,
currentNodeInputs,
outputs,
previousNodeInputs,
params
);

String modelId = (String) inputs.get(MODEL_ID);
List<String> indexes = (List<String>) inputs.get(INPUT_INDEX);
String[] includes = (String[]) inputs.get(INCLUDES);

Check warning on line 108 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L106-L108

Added lines #L106 - L108 were not covered by tests

MLInputDataset inputDataset = new SearchQueryInputDataset(indexes, generateQuery(includes));

Check warning on line 110 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L110

Added line #L110 was not covered by tests

MLInput mlInput = new MLInput(FunctionName.KMEANS, null, inputDataset);

Check warning on line 112 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L112

Added line #L112 was not covered by tests

mlClient.predict(modelId, mlInput, actionListener);

Check warning on line 114 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L114

Added line #L114 was not covered by tests

} catch (Exception e) {
predictFuture.onFailure(e);
}
return predictFuture;

Check warning on line 119 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L116-L119

Added lines #L116 - L119 were not covered by tests
}

private List<List<Float>> buildVectorFromResponse(MLOutput mlOutput) {
final List<List<Float>> vector = new ArrayList<>();
final ModelTensorOutput modelTensorOutput = (ModelTensorOutput) mlOutput;
final List<ModelTensors> tensorOutputList = modelTensorOutput.getMlModelOutputs();

Check warning on line 125 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L123-L125

Added lines #L123 - L125 were not covered by tests
for (final ModelTensors tensors : tensorOutputList) {
final List<ModelTensor> tensorsList = tensors.getMlModelTensors();

Check warning on line 127 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L127

Added line #L127 was not covered by tests
for (final ModelTensor tensor : tensorsList) {
vector.add(Arrays.stream(tensor.getData()).map(value -> (Float) value).collect(Collectors.toList()));
}
}
return vector;

Check warning on line 132 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L129-L132

Added lines #L129 - L132 were not covered by tests
}

private SearchSourceBuilder generateQuery(String[] includes) {
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.size(1000);
searchSourceBuilder.fetchSource(includes, null);
searchSourceBuilder.query(QueryBuilders.matchAllQuery());
return searchSourceBuilder;

Check warning on line 140 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L136-L140

Added lines #L136 - L140 were not covered by tests
}

@Override
public String getName() {
return NAME;

Check warning on line 145 in src/main/java/org/opensearch/flowframework/workflow/PredictStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/PredictStep.java#L145

Added line #L145 was not covered by tests
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.flowframework.workflow;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.ExceptionsHelper;
import org.opensearch.action.search.SearchRequest;
import org.opensearch.action.support.PlainActionFuture;
import org.opensearch.client.Client;
import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.core.action.ActionListener;
import org.opensearch.core.common.bytes.BytesArray;
import org.opensearch.core.common.bytes.BytesReference;
import org.opensearch.core.rest.RestStatus;
import org.opensearch.core.xcontent.DeprecationHandler;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.core.xcontent.XContentParser;
import org.opensearch.flowframework.exception.WorkflowStepException;
import org.opensearch.flowframework.util.ParseUtils;
import org.opensearch.search.builder.SearchSourceBuilder;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Map;
import java.util.Set;

import static org.opensearch.flowframework.common.CommonValue.CONFIGURATIONS;
import static org.opensearch.flowframework.common.CommonValue.SEARCH_REQUEST;
import static org.opensearch.flowframework.common.CommonValue.SEARCH_RESPONSE;
import static org.opensearch.flowframework.common.WorkflowResources.INDEX_NAME;

/**
* Step for search request
*/
public class SearchRequestStep implements WorkflowStep {

private static final Logger logger = LogManager.getLogger(SearchRequestStep.class);

Check warning on line 45 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L45

Added line #L45 was not covered by tests
private final Client client;

/** The name of this step, used as a key in the template and the {@link WorkflowStepFactory} */
public static final String NAME = "search_request";

/**
* Instantiate this class
*
* @param client Client to search on an index
*/
public SearchRequestStep(Client client) {
this.client = client;
}

Check warning on line 58 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L56-L58

Added lines #L56 - L58 were not covered by tests

@Override
public PlainActionFuture<WorkflowData> execute(
String currentNodeId,
WorkflowData currentNodeInputs,
Map<String, WorkflowData> outputs,
Map<String, String> previousNodeInputs,
Map<String, String> params
) {
PlainActionFuture<WorkflowData> searchIndexFuture = PlainActionFuture.newFuture();

Check warning on line 68 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L68

Added line #L68 was not covered by tests

Set<String> requiredKeys = Set.of(INDEX_NAME, CONFIGURATIONS);
Set<String> optionalKeys = Collections.emptySet();

Check warning on line 71 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L70-L71

Added lines #L70 - L71 were not covered by tests

try {
Map<String, Object> inputs = ParseUtils.getInputsFromPreviousSteps(

Check warning on line 74 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L74

Added line #L74 was not covered by tests
requiredKeys,
optionalKeys,
currentNodeInputs,
outputs,
previousNodeInputs,
params
);

String indexName = (String) inputs.get(INDEX_NAME);

Check warning on line 83 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L83

Added line #L83 was not covered by tests

String configurations = (String) inputs.get(CONFIGURATIONS);

Check warning on line 85 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L85

Added line #L85 was not covered by tests

byte[] byteArr = configurations.getBytes(StandardCharsets.UTF_8);
BytesReference configurationsBytes = new BytesArray(byteArr);
SearchRequest searchRequest = new SearchRequest(indexName);

Check warning on line 89 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L87-L89

Added lines #L87 - L89 were not covered by tests

try {
if (!configurations.isEmpty()) {
XContentParser parser = JsonXContent.jsonXContent.createParser(

Check warning on line 93 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L93

Added line #L93 was not covered by tests
NamedXContentRegistry.EMPTY,
DeprecationHandler.THROW_UNSUPPORTED_OPERATION,
configurationsBytes.streamInput()

Check warning on line 96 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L96

Added line #L96 was not covered by tests
);
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
searchSourceBuilder.parseXContent(parser);
searchRequest.source(searchSourceBuilder);

Check warning on line 100 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L98-L100

Added lines #L98 - L100 were not covered by tests
}
} catch (IOException ex) {
String errorMessage = "Failed to search for the index based on the query;";
logger.error(errorMessage, ex);
searchIndexFuture.onFailure(new WorkflowStepException(errorMessage, RestStatus.BAD_REQUEST));
}

Check warning on line 106 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L102-L106

Added lines #L102 - L106 were not covered by tests

client.search(searchRequest, ActionListener.wrap(searchResponse -> {
searchIndexFuture.onResponse(

Check warning on line 109 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L108-L109

Added lines #L108 - L109 were not covered by tests
new WorkflowData(
Map.ofEntries(Map.entry(SEARCH_RESPONSE, searchResponse), Map.entry(SEARCH_REQUEST, searchRequest)),
currentNodeInputs.getWorkflowId(),

Check warning on line 112 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L111-L112

Added lines #L111 - L112 were not covered by tests
currentNodeId
)
);
}, exception -> {
String errorMessage = "Failed to search on the index";
logger.error(errorMessage, exception);
searchIndexFuture.onFailure(new WorkflowStepException(errorMessage, ExceptionsHelper.status(exception)));
}));

Check warning on line 120 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L116-L120

Added lines #L116 - L120 were not covered by tests

} catch (Exception e) {
searchIndexFuture.onFailure(e);
}

Check warning on line 124 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L122-L124

Added lines #L122 - L124 were not covered by tests

return searchIndexFuture;

Check warning on line 126 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L126

Added line #L126 was not covered by tests
}

@Override
public String getName() {
return null;

Check warning on line 131 in src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/workflow/SearchRequestStep.java#L131

Added line #L131 was not covered by tests
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import static org.opensearch.flowframework.common.CommonValue.EMBEDDING_DIMENSION;
import static org.opensearch.flowframework.common.CommonValue.FRAMEWORK_TYPE;
import static org.opensearch.flowframework.common.CommonValue.FUNCTION_NAME;
import static org.opensearch.flowframework.common.CommonValue.INCLUDES;
import static org.opensearch.flowframework.common.CommonValue.INPUT_INDEX;
import static org.opensearch.flowframework.common.CommonValue.MODEL_CONTENT_HASH_VALUE;
import static org.opensearch.flowframework.common.CommonValue.MODEL_FORMAT;
import static org.opensearch.flowframework.common.CommonValue.MODEL_GROUP_STATUS;
Expand All @@ -47,10 +49,13 @@
import static org.opensearch.flowframework.common.CommonValue.PIPELINE_ID;
import static org.opensearch.flowframework.common.CommonValue.PROTOCOL_FIELD;
import static org.opensearch.flowframework.common.CommonValue.REGISTER_MODEL_STATUS;
import static org.opensearch.flowframework.common.CommonValue.SEARCH_REQUEST;
import static org.opensearch.flowframework.common.CommonValue.SEARCH_RESPONSE;
import static org.opensearch.flowframework.common.CommonValue.SUCCESS;
import static org.opensearch.flowframework.common.CommonValue.TOOLS_FIELD;
import static org.opensearch.flowframework.common.CommonValue.TYPE;
import static org.opensearch.flowframework.common.CommonValue.URL;
import static org.opensearch.flowframework.common.CommonValue.VECTORS;
import static org.opensearch.flowframework.common.CommonValue.VERSION_FIELD;
import static org.opensearch.flowframework.common.WorkflowResources.AGENT_ID;
import static org.opensearch.flowframework.common.WorkflowResources.CONNECTOR_ID;
Expand Down Expand Up @@ -104,6 +109,8 @@ public WorkflowStepFactory(
);
stepMap.put(UndeployModelStep.NAME, () -> new UndeployModelStep(mlClient));
stepMap.put(CreateConnectorStep.NAME, () -> new CreateConnectorStep(mlClient, flowFrameworkIndicesHandler));
stepMap.put(PredictStep.NAME, () -> new PredictStep(mlClient));
stepMap.put(SearchRequestStep.NAME, () -> new SearchRequestStep(client));
stepMap.put(DeleteConnectorStep.NAME, () -> new DeleteConnectorStep(mlClient));
stepMap.put(RegisterModelGroupStep.NAME, () -> new RegisterModelGroupStep(mlClient, flowFrameworkIndicesHandler));
stepMap.put(ToolStep.NAME, ToolStep::new);
Expand Down Expand Up @@ -226,6 +233,20 @@ public enum WorkflowSteps {
List.of(PIPELINE_ID),
Collections.emptyList(),
null
),

/** Predict Step */
PREDICT(PredictStep.NAME, List.of(MODEL_ID, INPUT_INDEX, INCLUDES), List.of(VECTORS), Collections.emptyList(), null),

/** Create Search Request Step */
SEARCH_REQUEST_STEP(
SearchRequestStep.NAME,
List.of(INDEX_NAME, CONFIGURATIONS),
// temporary for POC
List.of(SEARCH_REQUEST, SEARCH_RESPONSE),
Collections.emptyList(),
null

);

private final String workflowStepName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void testParseWorkflowValidator() throws IOException {

WorkflowValidator validator = new WorkflowValidator(workflowStepValidators);

assertEquals(17, validator.getWorkflowStepValidators().size());
assertEquals(19, validator.getWorkflowStepValidators().size());

assertTrue(validator.getWorkflowStepValidators().keySet().contains("create_connector"));
assertEquals(7, validator.getWorkflowStepValidators().get("create_connector").getInputs().size());
Expand Down

0 comments on commit 4a2d752

Please sign in to comment.