|
5 | 5 |
|
6 | 6 | package org.opensearch.ml.engine.algorithms.remote;
|
7 | 7 |
|
8 |
| -import static org.opensearch.core.xcontent.XContentParserUtils.ensureExpectedToken; |
9 |
| -//import static org.opensearch.ml.common.dataset.SearchQueryInputDataset.xContentRegistry; |
10 | 8 | import static org.opensearch.ml.engine.algorithms.remote.ConnectorUtils.SKIP_VALIDATE_MISSING_PARAMETERS;
|
11 | 9 | import static org.opensearch.ml.engine.algorithms.remote.ConnectorUtils.escapeRemoteInferenceInputData;
|
12 | 10 | import static org.opensearch.ml.engine.algorithms.remote.ConnectorUtils.processInput;
|
13 | 11 |
|
14 | 12 | import java.io.IOException;
|
15 |
| -import java.lang.reflect.Field; |
16 | 13 | import java.util.*;
|
17 | 14 | import java.util.concurrent.atomic.AtomicBoolean;
|
18 |
| -import java.util.regex.Matcher; |
19 |
| -import java.util.regex.Pattern; |
20 | 15 |
|
21 | 16 | import com.fasterxml.jackson.databind.ObjectMapper;
|
22 | 17 | import org.apache.logging.log4j.Logger;
|
|
30 | 25 | import org.opensearch.common.unit.TimeValue;
|
31 | 26 | import org.opensearch.common.util.TokenBucket;
|
32 | 27 | import org.opensearch.common.xcontent.XContentFactory;
|
33 |
| -import org.opensearch.common.xcontent.XContentType; |
34 | 28 | import org.opensearch.commons.ConfigConstants;
|
35 | 29 | import org.opensearch.commons.authuser.User;
|
36 | 30 | import org.opensearch.core.action.ActionListener;
|
|
46 | 40 | import org.opensearch.ml.common.dataset.remote.RemoteInferenceInputDataSet;
|
47 | 41 | import org.opensearch.ml.common.input.MLInput;
|
48 | 42 | import org.opensearch.ml.common.input.parameter.MLAlgoParams;
|
49 |
| -//import org.opensearch.ml.common.input.parameter.textembedding.SparseEmbeddingFormat; |
50 | 43 | import org.opensearch.ml.common.model.MLGuard;
|
51 | 44 | import org.opensearch.ml.common.output.model.ModelTensorOutput;
|
52 | 45 | import org.opensearch.ml.common.output.model.ModelTensors;
|
@@ -88,7 +81,7 @@ default void executeAction(String action, MLInput mlInput, ActionListener<MLTask
|
88 | 81 | MLInput
|
89 | 82 | .builder()
|
90 | 83 | .algorithm(FunctionName.TEXT_EMBEDDING)
|
91 |
| - .parameters(mlInput.getParameters()) |
| 84 | +// .parameters(mlInput.getParameters()) |
92 | 85 | .inputDataset(TextDocsInputDataSet.builder().docs(textDocs).build())
|
93 | 86 | .build(),
|
94 | 87 | new ExecutionContext(sequence++),
|
@@ -203,23 +196,6 @@ default void preparePayloadAndInvoke(
|
203 | 196 | actionListener.onFailure(e);
|
204 | 197 | }
|
205 | 198 | }
|
206 |
| -// if (algoParams != null) { |
207 |
| -// Map<String, String> parametersMap = new HashMap<>(); |
208 |
| -// String algoParamsStr = algoParams.toString(); |
209 |
| -// Pattern pattern = Pattern.compile("\\(([^)]+)\\)"); |
210 |
| -// Matcher matcher = pattern.matcher(algoParamsStr); |
211 |
| -// if (matcher.find()) { |
212 |
| -// String bracketContent = matcher.group(1); |
213 |
| -// pattern = Pattern.compile("(\\w+)=([^,\\s]+)"); |
214 |
| -// matcher = pattern.matcher(bracketContent); |
215 |
| -// while (matcher.find()) { |
216 |
| -// String fieldName = matcher.group(1); |
217 |
| -// String fieldValue = matcher.group(2); |
218 |
| -// parametersMap.put(fieldName, fieldValue); |
219 |
| -// } |
220 |
| -// } |
221 |
| -// parameters.putAll(parametersMap); |
222 |
| -// } |
223 | 199 |
|
224 | 200 | RemoteInferenceInputDataSet inputData = processInput(action, mlInput, connector, parameters, getScriptService());
|
225 | 201 | if (inputData.getParameters() != null) {
|
|
0 commit comments