Skip to content

Conversation

@jonathan-buttner
Copy link
Contributor

This PR addresses the feedback item from the original PR: #127939

This PR adds support for input_type, top_n, and return_documents.

Comments:
#127939 (comment)

@jonathan-buttner jonathan-buttner added >refactoring :ml Machine learning Team:ML Meta label for the ML team auto-backport Automatically create backport pull requests when merged v8.19.0 v9.1.0 labels Jun 13, 2025
@jonathan-buttner jonathan-buttner marked this pull request as ready for review June 18, 2025 14:23
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Strings.format(
"Input type translation value for key [%s] must be a String that is not null and not empty, received: [%s].",
key,
value.getClass().getSimpleName()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can value be null?

Suggested change
value.getClass().getSimpleName()
value == null ? "null" : value.getClass().getSimpleName()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, thank you.

Strings.format(
"Invalid input type translation for key: [%s], is not a valid value. Must be one of %s",
key,
EnumSet.of(InputType.CLASSIFICATION, InputType.CLUSTERING, InputType.INGEST, InputType.SEARCH)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
EnumSet.of(InputType.CLASSIFICATION, InputType.CLUSTERING, InputType.INGEST, InputType.SEARCH)
SUPPORTED_REQUEST_VALUES

* @param inputTypeTranslation the map of input type translations to validate
* @param validationException a ValidationException to which errors will be added
*/
public static Map<InputType, String> validateInputTypeTranslationValues(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this

entity.toXContent(builder, null);
String xContentResult = Strings.toString(builder);

var expected = XContentHelper.stripWhitespace("""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

@jonathan-buttner jonathan-buttner merged commit d9b34d4 into elastic:main Jun 20, 2025
27 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 129441

@jonathan-buttner
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Questions ?

Please refer to the Backport tool documentation

elasticsearchmachine pushed a commit that referenced this pull request Jun 23, 2025
…uments (#129441) (#129860)

* Making progress on different request parameters

* Working tests

* Adding custom service validator for rerank

* Fixing embedding bug

* Adding transport version check

* Fixing tests

* Fixing license header

* Fixing writeTo

* Moving file and removing commented code

* Fixing test

* Fixing tests

* Refactoring and tests

* Fixing test

(cherry picked from commit d9b34d4)

# Conflicts:
#	server/src/main/java/org/elasticsearch/TransportVersions.java
kderusso pushed a commit to kderusso/elasticsearch that referenced this pull request Jun 23, 2025
…uments (elastic#129441)

* Making progress on different request parameters

* Working tests

* Adding custom service validator for rerank

* Fixing embedding bug

* Adding transport version check

* Fixing tests

* Fixing license header

* Fixing writeTo

* Moving file and removing commented code

* Fixing test

* Fixing tests

* Refactoring and tests

* Fixing test
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jun 25, 2025
…uments (elastic#129441)

* Making progress on different request parameters

* Working tests

* Adding custom service validator for rerank

* Fixing embedding bug

* Adding transport version check

* Fixing tests

* Fixing license header

* Fixing writeTo

* Moving file and removing commented code

* Fixing test

* Fixing tests

* Refactoring and tests

* Fixing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged backport pending :ml Machine learning >refactoring Team:ML Meta label for the ML team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants