Skip to content

Commit 1ba25d3

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent 8d1bd22 commit 1ba25d3

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/custom/CustomServiceSettings.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ public record TextEmbeddingSettings(
151151
@Nullable Integer maxInputTokens,
152152
@Nullable DenseVectorFieldMapper.ElementType elementType
153153
) implements ToXContentFragment, Writeable {
154+
154155
// This specifies float for the element type but null for all other settings
155156
public static final TextEmbeddingSettings DEFAULT_FLOAT = new TextEmbeddingSettings(
156157
null,

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/custom/CustomServiceTests.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,16 @@ private static Map<String, Object> createServiceSettingsMap(TaskType taskType) {
164164
);
165165

166166
if (taskType == TaskType.TEXT_EMBEDDING) {
167-
settingsMap.putAll(Map.of(ServiceFields.SIMILARITY,
168-
SimilarityMeasure.DOT_PRODUCT.toString(),
169-
ServiceFields.DIMENSIONS,
170-
1536,
171-
ServiceFields.MAX_INPUT_TOKENS,
172-
512));
167+
settingsMap.putAll(
168+
Map.of(
169+
ServiceFields.SIMILARITY,
170+
SimilarityMeasure.DOT_PRODUCT.toString(),
171+
ServiceFields.DIMENSIONS,
172+
1536,
173+
ServiceFields.MAX_INPUT_TOKENS,
174+
512
175+
)
176+
);
173177
}
174178

175179
return settingsMap;
@@ -233,12 +237,7 @@ private static CustomModel createInternalEmbeddingModel(
233237
TaskType.TEXT_EMBEDDING,
234238
CustomService.NAME,
235239
new CustomServiceSettings(
236-
new CustomServiceSettings.TextEmbeddingSettings(
237-
similarityMeasure,
238-
123,
239-
456,
240-
DenseVectorFieldMapper.ElementType.FLOAT
241-
),
240+
new CustomServiceSettings.TextEmbeddingSettings(similarityMeasure, 123, 456, DenseVectorFieldMapper.ElementType.FLOAT),
242241
url,
243242
Map.of("key", "value"),
244243
QueryParameters.EMPTY,

0 commit comments

Comments
 (0)