Skip to content

Conversation

@jonathan-buttner
Copy link
Contributor

This PR improves the error message that we return in the REST api call when performing inference using the inference API.

It also removes the URL from the message just in case it's getting logged.

@jonathan-buttner jonathan-buttner added >non-issue :ml Machine learning Team:ML Meta label for the ML team Feature:GenAI Features around GenAI v8.19.0 v9.1.0 auto-backport Automatically create backport pull requests when merged v9.0.1 labels Feb 27, 2025
l.onFailure(
createInternalServerError(
unwrappedException,
Strings.format("%s. Cause: %s", errorMessage, unwrappedException.getMessage())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the exception is not an ElasticsearchException we'll grab the cause to return to the API call. We've noticed in the case of apache timeout exceptions it would have been useful to return that information directly to the client instead of only logging it.

this.model = Objects.requireNonNull(model);
this.sender = Objects.requireNonNull(sender);
this.account = new AlibabaCloudSearchAccount(this.model.getSecretSettings().apiKey());
this.failedToSendRequestErrorMessage = constructFailedToSendRequestMessage(null, "AlibabaCloud Search completion");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes are to remove the URL parameter.


doAnswer(invocation -> {
@SuppressWarnings("unchecked")
ActionListener<InferenceServiceResults> listener = (ActionListener<InferenceServiceResults>) invocation.getArguments()[2];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that we are including the cause I noticed that these tests where retrieving the wrong parameter.

@jonathan-buttner jonathan-buttner marked this pull request as ready for review February 27, 2025 21:24
@elasticsearchmachine
Copy link
Collaborator

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

@jonathan-buttner jonathan-buttner merged commit 4dcc81f into elastic:main Feb 28, 2025
17 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.18 Commit could not be cherrypicked due to conflicts
8.x Commit could not be cherrypicked due to conflicts
9.0 Commit could not be cherrypicked due to conflicts

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

@jonathan-buttner
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x
9.0
8.18

Questions ?

Please refer to the Backport tool documentation

jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Feb 28, 2025
(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java
jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Feb 28, 2025
(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java
jonathan-buttner added a commit to jonathan-buttner/elasticsearch that referenced this pull request Feb 28, 2025
(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 28, 2025
(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 28, 2025
(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java
elasticsearchmachine pushed a commit that referenced this pull request Feb 28, 2025
)

* Removing url and adding cause REST api response (#123638)

(cherry picked from commit 4dcc81f)

# Conflicts:
#	x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIActionCreator.java
#	x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/external/action/voyageai/VoyageAIEmbeddingsActionTests.java

* Fixing errors
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 Feature:GenAI Features around GenAI :ml Machine learning >non-issue Team:ML Meta label for the ML team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants