-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements inheritance pattern to break down inference request
Signed-off-by: Fen Qin <mfenqin@amazon.com>
- Loading branch information
Showing
14 changed files
with
196 additions
and
132 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
25 changes: 25 additions & 0 deletions
25
src/main/java/org/opensearch/neuralsearch/processor/MapInferenceRequest.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,25 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.opensearch.neuralsearch.processor; | ||
|
||
import java.util.Map; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* Implementation of InferenceRequest for inputObjects based inference requests. | ||
* Use this class when the input data consists of key-value pairs. | ||
* | ||
* @see InferenceRequest | ||
*/ | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
public class MapInferenceRequest extends InferenceRequest { | ||
private Map<String, String> inputObjects; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/org/opensearch/neuralsearch/processor/SimilarityInferenceRequest.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,23 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.opensearch.neuralsearch.processor; | ||
|
||
import lombok.NoArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* Implementation of InferenceRequest for similarity based text inference requests. | ||
* | ||
* @see TextInferenceRequest | ||
*/ | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
public class SimilarityInferenceRequest extends TextInferenceRequest { | ||
private String queryText; | ||
} |
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
Oops, something went wrong.