-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Expose input_type option at root level for text_embedding task type in Perform Inference API
#122638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Expose input_type option at root level for text_embedding task type in Perform Inference API
#122638
Changes from 12 commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
3b418ae
wip
ymao1 5d020a7
wip
ymao1 cceb308
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 b515e84
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 625a5a2
[CI] Auto commit changes from spotless
c064e26
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 f6dbf51
Adding internal input types
ymao1 6a25d08
Merge branch 'es-117856' of github.com:ymao1/elasticsearch into es-11β¦
ymao1 b7c2481
[CI] Auto commit changes from spotless
2d2b6db
Throwing validation exception for services that don't support input type
ymao1 3dc38f7
Merge branch 'es-117856' of github.com:ymao1/elasticsearch into es-11β¦
ymao1 356d546
linting
ymao1 a143af1
hugging face
ymao1 7f20d32
voyage ai
ymao1 d6c2464
google ai studio
ymao1 f63e852
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 f9962ce
bedrock updates
ymao1 2905643
Fixing tests
ymao1 f47538c
Fixing tests
ymao1 5b4ee68
Fixing tests
ymao1 be17339
bedrock updates
ymao1 bba8ac5
elasticsearch
ymao1 bf32efd
azure openai
ymao1 3dbeaff
Merge
ymao1 c3c9cef
[CI] Auto commit changes from spotless
cc96e9a
Refactoring all the things
ymao1 fbc8791
Merge branch 'es-117856' of github.com:ymao1/elasticsearch into es-11β¦
ymao1 e6e877e
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 215b4b7
[CI] Auto commit changes from spotless
de1f8fc
Everything compiles
ymao1 4838727
Merge branch 'es-117856' of github.com:ymao1/elasticsearch into es-11β¦
ymao1 1946d49
spotless
ymao1 f1bbcc6
external actions tests
ymao1 ea4ad64
external request tests
ymao1 3a3e946
service tests
ymao1 20c28b0
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 84bc649
Fixing integration tests
ymao1 4ad3214
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 9f744db
Cleanup
ymao1 4564680
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 aef7da8
Update docs/changelog/122638.yaml
ymao1 6cbd41e
Merge
ymao1 f364ad3
Merge branch 'es-117856' of github.com:ymao1/elasticsearch into es-11β¦
ymao1 113cf3d
Merging in main
ymao1 cb8d337
Cleanup
ymao1 ef6074b
Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/β¦
ymao1 61c8d7b
Update x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/β¦
ymao1 61091c3
PR feedback
ymao1 588c6fb
Merge branch 'main' of github.com:elastic/elasticsearch into es-117856
ymao1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -11,6 +11,8 @@ | |
|
|
||
| import java.util.Locale; | ||
|
|
||
| import static org.elasticsearch.core.Strings.format; | ||
|
|
||
| /** | ||
| * Defines the type of request, whether the request is to ingest a document or search for a document. | ||
| */ | ||
|
|
@@ -19,7 +21,9 @@ public enum InputType { | |
| SEARCH, | ||
| UNSPECIFIED, | ||
| CLASSIFICATION, | ||
| CLUSTERING; | ||
| CLUSTERING, | ||
| INTERNAL_SEARCH, | ||
| INTERNAL_INGEST; | ||
|
|
||
| @Override | ||
| public String toString() { | ||
|
|
@@ -29,4 +33,12 @@ public String toString() { | |
| public static InputType fromString(String name) { | ||
| return valueOf(name.trim().toUpperCase(Locale.ROOT)); | ||
| } | ||
|
|
||
| public static InputType fromRestString(String name) { | ||
| var inputType = InputType.fromString(name); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check that the values passed from the REST API do not include the internal values |
||
| if (inputType == InputType.INTERNAL_INGEST || inputType == InputType.INTERNAL_SEARCH) { | ||
| throw new IllegalArgumentException(format("Unrecognized input_type [%s]", inputType)); | ||
| } | ||
| return inputType; | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π