Skip to content

Commit f92f348

Browse files
Apply suggestions
1 parent 78ab1da commit f92f348

18 files changed

+28
-28
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/cohere/rerank/CohereRerankModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public DefaultSecretSettings getSecretSettings() {
8787

8888
/**
8989
* Accepts a visitor to create an executable action. The returned action will not return documents in the response.
90-
* @param visitor _
91-
* @param taskSettings _
90+
* @param visitor Interface for creating {@link ExecutableAction} instances for Cohere models.
91+
* @param taskSettings Settings in the request to override the model's defaults
9292
* @return the rerank action
9393
*/
9494
@Override

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/IbmWatsonxCompletionResponseHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class IbmWatsonxCompletionResponseHandler extends OpenAiChatCompletionRes
1616
/**
1717
* Constructs a IbmWatsonxCompletionResponseHandler with the specified request type and response parser.
1818
*
19-
* @param requestType The type of request being handled (e.g., "Ibm WatsonX completions").
19+
* @param requestType The type of request being handled (e.g., "IBM Watsonx completions").
2020
* @param parseFunction The function to parse the response.
2121
*/
2222
public IbmWatsonxCompletionResponseHandler(String requestType, ResponseParser parseFunction) {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/IbmWatsonxEmbeddingsRequestManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public class IbmWatsonxEmbeddingsRequestManager extends IbmWatsonxRequestManager
3535
private static final ResponseHandler HANDLER = createEmbeddingsHandler();
3636

3737
private static ResponseHandler createEmbeddingsHandler() {
38-
return new IbmWatsonxResponseHandler("ibm watsonx embeddings", IbmWatsonxEmbeddingsResponseEntity::fromResponse);
38+
return new IbmWatsonxResponseHandler("IBM Watsonx embeddings", IbmWatsonxEmbeddingsResponseEntity::fromResponse);
3939
}
4040

4141
private final IbmWatsonxEmbeddingsModel model;

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/IbmWatsonxRerankRequestManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class IbmWatsonxRerankRequestManager extends IbmWatsonxRequestManager {
3131

3232
private static ResponseHandler createIbmWatsonxResponseHandler() {
3333
return new IbmWatsonxResponseHandler(
34-
"ibm watsonx rerank",
34+
"IBM Watsonx rerank",
3535
(request, response) -> IbmWatsonxRankedResponseEntity.fromResponse(response)
3636
);
3737
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/IbmWatsonxService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class IbmWatsonxService extends SenderService {
7979
TaskType.CHAT_COMPLETION
8080
);
8181
private static final ResponseHandler UNIFIED_CHAT_COMPLETION_HANDLER = new IbmWatsonUnifiedChatCompletionResponseHandler(
82-
"ibm watsonx chat completions",
82+
"IBM Watsonx chat completions",
8383
OpenAiChatCompletionResponseEntity::fromResponse
8484
);
8585

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/IbmWatsonxServiceFields.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class IbmWatsonxServiceFields {
1111

1212
/**
1313
* Taken from <a href="https://cloud.ibm.com/apidocs/watsonx-ai#text-embeddings">
14-
* Introduction to IBM watsonx.ai as a Service</a>
14+
* Introduction to IBM Watsonx.ai as a Service</a>
1515
*/
1616
static final int EMBEDDING_MAX_BATCH_SIZE = 1000;
1717
public static final String API_VERSION = "api_version";

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/action/IbmWatsonxActionCreator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class IbmWatsonxActionCreator implements IbmWatsonxActionVisitor {
4242
private final Sender sender;
4343
private final ServiceComponents serviceComponents;
4444

45-
static final String COMPLETION_REQUEST_TYPE = "IBM WatsonX completions";
45+
static final String COMPLETION_REQUEST_TYPE = "IBM Watsonx completions";
4646
static final String USER_ROLE = "user";
4747
static final ResponseHandler COMPLETION_HANDLER = new IbmWatsonxCompletionResponseHandler(
4848
COMPLETION_REQUEST_TYPE,
@@ -56,7 +56,7 @@ public IbmWatsonxActionCreator(Sender sender, ServiceComponents serviceComponent
5656

5757
@Override
5858
public ExecutableAction create(IbmWatsonxEmbeddingsModel model, Map<String, Object> taskSettings) {
59-
var failedToSendRequestErrorMessage = constructFailedToSendRequestMessage("IBM WatsonX embeddings");
59+
var failedToSendRequestErrorMessage = constructFailedToSendRequestMessage("IBM Watsonx embeddings");
6060
return new SenderExecutableAction(
6161
sender,
6262
getEmbeddingsRequestManager(model, serviceComponents.truncator(), serviceComponents.threadPool()),
@@ -95,13 +95,13 @@ protected IbmWatsonxEmbeddingsRequestManager getEmbeddingsRequestManager(
9595
}
9696

9797
/**
98-
* Builds an error message for Ibm Watsonx actions.
98+
* Builds an error message for IBM Watsonx actions.
9999
*
100100
* @param requestType The type of request (e.g. COMPLETION, EMBEDDING, RERANK).
101101
* @param inferenceId The ID of the inference entity.
102102
* @return A formatted error message.
103103
*/
104104
public static String buildErrorMessage(TaskType requestType, String inferenceId) {
105-
return format("Failed to send Ibm Watsonx %s request from inference entity id [%s]", requestType.toString(), inferenceId);
105+
return format("Failed to send IBM Watsonx %s request from inference entity id [%s]", requestType.toString(), inferenceId);
106106
}
107107
}

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/action/IbmWatsonxActionVisitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
import java.util.Map;
1616

1717
/**
18-
* Interface for creating {@link ExecutableAction} instances for Watsonx models.
18+
* Interface for creating {@link ExecutableAction} instances for IBM Watsonx models.
1919
* <p>
20-
* This interface is used to create {@link ExecutableAction} instances for different types of Watsonx models, such as
20+
* This interface is used to create {@link ExecutableAction} instances for different types of IBM Watsonx models, such as
2121
* {@link IbmWatsonxEmbeddingsModel} and {@link IbmWatsonxRerankModel} and {@link IbmWatsonxChatCompletionModel}.
2222
*/
2323
public interface IbmWatsonxActionVisitor {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/completion/IbmWatsonxChatCompletionModel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public URI uri() {
132132

133133
/**
134134
* Accepts a visitor to create an executable action. The returned action will not return documents in the response.
135-
* @param visitor _
135+
* @param visitor Interface for creating {@link ExecutableAction} instances for IBM Watsonx models.
136136
* @return the completion action
137137
*/
138138
public ExecutableAction accept(IbmWatsonxActionVisitor visitor, Map<String, Object> taskSettings) {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ibmwatsonx/completion/IbmWatsonxChatCompletionServiceSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class IbmWatsonxChatCompletionServiceSettings extends FilteredXContentObj
4444
/**
4545
* Rate limits are defined at
4646
* <a href="https://www.ibm.com/docs/en/watsonx/saas?topic=learning-watson-machine-plans">Watson Machine Learning plans</a>.
47-
* For Lite plan, you've 120 requests per minute.
47+
* For the Lite plan, the limit is 120 requests per minute.
4848
*/
4949
private static final RateLimitSettings DEFAULT_RATE_LIMIT_SETTINGS = new RateLimitSettings(120);
5050

0 commit comments

Comments
 (0)