-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dimensions parameter support for bedrock titan embedding v2 model
Signed-off-by: zane-neo <[email protected]>
- Loading branch information
Showing
6 changed files
with
99 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
...main/java/org/opensearch/ml/common/connector/functions/preprocess/PreProcessFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* | ||
* * Copyright OpenSearch Contributors | ||
* * SPDX-License-Identifier: Apache-2.0 | ||
* | ||
*/ | ||
|
||
package org.opensearch.ml.common.connector.functions.preprocess; | ||
|
||
import java.util.Map; | ||
|
||
import org.opensearch.ml.common.dataset.remote.RemoteInferenceInputDataSet; | ||
import org.opensearch.ml.common.input.MLInput; | ||
|
||
/** | ||
* The PreProcessFunction interface defines methods for preprocessing {@link MLInput} data | ||
* before it is used for inference. It includes methods to apply preprocessing with or without | ||
* additional parameters and to validate the input data. | ||
*/ | ||
public interface PreProcessFunction { | ||
|
||
RemoteInferenceInputDataSet apply(Map<String, String> connectorParams, MLInput mlInput); | ||
|
||
RemoteInferenceInputDataSet apply(MLInput mlInput); | ||
|
||
/** | ||
* The default behavior of this method is to invoke process method with only the MLInput parameter, when the process | ||
* needs more parameters from the connector parameters, the concrete implementation should override this method. | ||
* @param connectorParams | ||
* @param mlInput | ||
* @return | ||
*/ | ||
default RemoteInferenceInputDataSet process(Map<String, String> connectorParams, MLInput mlInput) { | ||
return process(mlInput); | ||
} | ||
|
||
RemoteInferenceInputDataSet process(MLInput mlInput); | ||
|
||
void validate(MLInput mlInput); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters