Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 5 additions & 0 deletions docs/changelog/119922.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 119922
summary: "[Inference API] fix spell words: covertToString to convertToString"
area: Machine Learning
type: enhancement
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
builder.startObject();
builder.field(TEXTS_FIELD, input);

String inputType = covertToString(taskSettings.getInputType());
String inputType = convertToString(taskSettings.getInputType());
if (inputType != null) {
builder.field(INPUT_TYPE_FIELD, inputType);
}
Expand All @@ -49,7 +49,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
}

// default for testing
static String covertToString(InputType inputType) {
static String convertToString(InputType inputType) {
if (inputType == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public record AlibabaCloudSearchSparseRequestEntity(List<String> input, AlibabaC
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field(TEXTS_FIELD, input);
String inputType = AlibabaCloudSearchEmbeddingsRequestEntity.covertToString(taskSettings.getInputType());
String inputType = AlibabaCloudSearchEmbeddingsRequestEntity.convertToString(taskSettings.getInputType());
if (inputType != null) {
builder.field(INPUT_TYPE_FIELD, inputType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
}

if (taskSettings.getInputType() != null) {
builder.field(INPUT_TYPE_FIELD, covertToString(taskSettings.getInputType()));
builder.field(INPUT_TYPE_FIELD, convertToString(taskSettings.getInputType()));
}

if (embeddingType != null) {
Expand All @@ -67,7 +67,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
}

// default for testing
static String covertToString(InputType inputType) {
static String convertToString(InputType inputType) {
return switch (inputType) {
case INGEST -> SEARCH_DOCUMENT;
case SEARCH -> SEARCH_QUERY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void testXContent_WritesNoOptionalFields_WhenTheyAreNotDefined() throws I
public void testConvertToString_ThrowsAssertionFailure_WhenInputTypeIsUnspecified() {
var thrownException = expectThrows(
AssertionError.class,
() -> AlibabaCloudSearchEmbeddingsRequestEntity.covertToString(InputType.UNSPECIFIED)
() -> AlibabaCloudSearchEmbeddingsRequestEntity.convertToString(InputType.UNSPECIFIED)
);
MatcherAssert.assertThat(thrownException.getMessage(), is("received invalid input type value [unspecified]"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void testXContent_WritesNoOptionalFields_WhenTheyAreNotDefined() throws I
}

public void testConvertToString_ThrowsAssertionFailure_WhenInputTypeIsUnspecified() {
var thrownException = expectThrows(AssertionError.class, () -> CohereEmbeddingsRequestEntity.covertToString(InputType.UNSPECIFIED));
var thrownException = expectThrows(AssertionError.class, () -> CohereEmbeddingsRequestEntity.convertToString(InputType.UNSPECIFIED));
MatcherAssert.assertThat(thrownException.getMessage(), is("received invalid input type value [unspecified]"));
}
}