Skip to content

Commit be1e9cf

Browse files
committed
Correcting due to comments
1 parent b94bc5f commit be1e9cf

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/external/request/voyageai/VoyageAIEmbeddingsRequestEntity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
4848
builder.field(INPUT_FIELD, input);
4949
builder.field(MODEL_FIELD, model);
5050

51-
if (taskSettings.getInputType() != null) {
52-
builder.field(INPUT_TYPE_FIELD, convertToString(taskSettings.getInputType()));
51+
var inputType = convertToString(taskSettings.getInputType());
52+
if (inputType != null) {
53+
builder.field(INPUT_TYPE_FIELD, inputType);
5354
}
5455

5556
if(taskSettings.getTruncation() != null) {

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/voyageai/embeddings/VoyageAIEmbeddingType.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,4 @@ public static VoyageAIEmbeddingType fromElementType(DenseVectorFieldMapper.Eleme
102102
public DenseVectorFieldMapper.ElementType toElementType() {
103103
return elementType;
104104
}
105-
106-
/**
107-
* Returns an embedding type that is known based on the transport version provided. If the embedding type enum was not yet
108-
* introduced it will be defaulted INT8.
109-
*
110-
* @param embeddingType the value to translate if necessary
111-
* @param version the version that dictates the translation
112-
* @return the embedding type that is known to the version passed in
113-
*/
114-
public static VoyageAIEmbeddingType translateToVersion(VoyageAIEmbeddingType embeddingType, TransportVersion version) {
115-
if (version.before(TransportVersions.V_8_14_0) && embeddingType == BYTE) {
116-
return INT8;
117-
}
118-
119-
return embeddingType;
120-
}
121105
}

0 commit comments

Comments
 (0)