mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
[ML] Remove ChunkingOptions parameter (#117235)
This commit is contained in:
parent
04dd9c22da
commit
d7737e7306
39 changed files with 13 additions and 146 deletions
5
docs/changelog/117235.yaml
Normal file
5
docs/changelog/117235.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
pr: 117235
|
||||
summary: "Deprecate `ChunkingOptions` parameter"
|
||||
area: ES|QL
|
||||
type: enhancement
|
||||
issues: []
|
|
@ -1,19 +0,0 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the "Elastic License
|
||||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
|
||||
* Public License v 1"; you may not use this file except in compliance with, at
|
||||
* your election, the "Elastic License 2.0", the "GNU Affero General Public
|
||||
* License v3.0 only", or the "Server Side Public License, v 1".
|
||||
*/
|
||||
|
||||
package org.elasticsearch.inference;
|
||||
|
||||
import org.elasticsearch.core.Nullable;
|
||||
|
||||
public record ChunkingOptions(@Nullable Integer windowSize, @Nullable Integer span) {
|
||||
|
||||
public boolean settingsArePresent() {
|
||||
return windowSize != null || span != null;
|
||||
}
|
||||
}
|
|
@ -112,16 +112,11 @@ public interface InferenceService extends Closeable {
|
|||
);
|
||||
|
||||
/**
|
||||
* Chunk long text according to {@code chunkingOptions} or the
|
||||
* model defaults if {@code chunkingOptions} contains unset
|
||||
* values.
|
||||
*
|
||||
* @param model The model
|
||||
* @param query Inference query, mainly for re-ranking
|
||||
* @param input Inference input
|
||||
* @param taskSettings Settings in the request to override the model's defaults
|
||||
* @param inputType For search, ingest etc
|
||||
* @param chunkingOptions The window and span options to apply
|
||||
* @param timeout The timeout for the request
|
||||
* @param listener Chunked Inference result listener
|
||||
*/
|
||||
|
@ -131,7 +126,6 @@ public interface InferenceService extends Closeable {
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
);
|
||||
|
|
|
@ -18,7 +18,6 @@ import org.elasticsearch.core.Nullable;
|
|||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceExtension;
|
||||
|
@ -140,7 +139,6 @@ public class TestDenseInferenceServiceExtension implements InferenceServiceExten
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceExtension;
|
||||
|
@ -128,7 +127,6 @@ public class TestRerankingServiceExtension implements InferenceServiceExtension
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceExtension;
|
||||
|
@ -131,7 +130,6 @@ public class TestSparseInferenceServiceExtension implements InferenceServiceExte
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.xcontent.ChunkedToXContent;
|
|||
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceExtension;
|
||||
|
@ -160,7 +159,6 @@ public class TestStreamingCompletionServiceExtension implements InferenceService
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.core.Nullable;
|
|||
import org.elasticsearch.core.Releasable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.InferenceService;
|
||||
import org.elasticsearch.inference.InferenceServiceRegistry;
|
||||
import org.elasticsearch.inference.InputType;
|
||||
|
@ -337,16 +336,7 @@ public class ShardBulkInferenceActionFilter implements MappedActionFilter {
|
|||
}
|
||||
};
|
||||
inferenceProvider.service()
|
||||
.chunkedInfer(
|
||||
inferenceProvider.model(),
|
||||
null,
|
||||
inputs,
|
||||
Map.of(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
TimeValue.MAX_VALUE,
|
||||
completionListener
|
||||
);
|
||||
.chunkedInfer(inferenceProvider.model(), null, inputs, Map.of(), InputType.INGEST, TimeValue.MAX_VALUE, completionListener);
|
||||
}
|
||||
|
||||
private FieldInferenceResponseAccumulator ensureResponseAccumulatorSlot(int id) {
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.elasticsearch.core.IOUtils;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.InferenceService;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
import org.elasticsearch.inference.InputType;
|
||||
|
@ -76,13 +75,12 @@ public abstract class SenderService implements InferenceService {
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
init();
|
||||
// a non-null query is not supported and is dropped by all providers
|
||||
doChunkedInfer(model, new DocumentsOnlyInput(input), taskSettings, inputType, chunkingOptions, timeout, listener);
|
||||
doChunkedInfer(model, new DocumentsOnlyInput(input), taskSettings, inputType, timeout, listener);
|
||||
}
|
||||
|
||||
protected abstract void doInfer(
|
||||
|
@ -99,7 +97,6 @@ public abstract class SenderService implements InferenceService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
);
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -289,7 +288,6 @@ public class AlibabaCloudSearchService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.core.IOUtils;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -114,7 +113,6 @@ public class AmazonBedrockService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -220,7 +219,6 @@ public class AnthropicService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -107,7 +106,6 @@ public class AzureAiStudioService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -261,7 +260,6 @@ public class AzureOpenAiService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -260,7 +259,6 @@ public class CohereService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -109,7 +108,6 @@ public class ElasticInferenceService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceResults;
|
||||
|
@ -676,11 +675,10 @@ public class ElasticsearchInternalService extends BaseElasticsearchInternalServi
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
chunkedInfer(model, null, input, taskSettings, inputType, chunkingOptions, timeout, listener);
|
||||
chunkedInfer(model, null, input, taskSettings, inputType, timeout, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -690,7 +688,6 @@ public class ElasticsearchInternalService extends BaseElasticsearchInternalServi
|
|||
List<String> input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -315,7 +314,6 @@ public class GoogleAiStudioService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -213,7 +212,6 @@ public class GoogleVertexAiService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -116,7 +115,6 @@ public class HuggingFaceService extends HuggingFaceBaseService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -88,7 +87,6 @@ public class HuggingFaceElserService extends HuggingFaceBaseService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -283,7 +282,6 @@ public class IbmWatsonxService extends SenderService {
|
|||
DocumentsOnlyInput input,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -95,7 +94,6 @@ public class MistralService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.util.LazyInitializable;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -264,7 +263,6 @@ public class OpenAiService extends SenderService {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -291,7 +291,7 @@ public class ShardBulkInferenceActionFilterTests extends ESTestCase {
|
|||
StaticModel model = (StaticModel) invocationOnMock.getArguments()[0];
|
||||
List<String> inputs = (List<String>) invocationOnMock.getArguments()[2];
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener = (ActionListener<
|
||||
List<ChunkedInferenceServiceResults>>) invocationOnMock.getArguments()[7];
|
||||
List<ChunkedInferenceServiceResults>>) invocationOnMock.getArguments()[6];
|
||||
Runnable runnable = () -> {
|
||||
List<ChunkedInferenceServiceResults> results = new ArrayList<>();
|
||||
for (String input : inputs) {
|
||||
|
@ -310,7 +310,7 @@ public class ShardBulkInferenceActionFilterTests extends ESTestCase {
|
|||
}
|
||||
return null;
|
||||
};
|
||||
doAnswer(chunkedInferAnswer).when(inferenceService).chunkedInfer(any(), any(), any(), any(), any(), any(), any(), any());
|
||||
doAnswer(chunkedInferAnswer).when(inferenceService).chunkedInfer(any(), any(), any(), any(), any(), any(), any());
|
||||
|
||||
Answer<Model> modelAnswer = invocationOnMock -> {
|
||||
String inferenceId = (String) invocationOnMock.getArguments()[0];
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.elasticsearch.action.ActionListener;
|
|||
import org.elasticsearch.action.support.PlainActionFuture;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySettingsConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -126,7 +125,6 @@ public class SenderServiceTests extends ESTestCase {
|
|||
DocumentsOnlyInput inputs,
|
||||
Map<String, Object> taskSettings,
|
||||
InputType inputType,
|
||||
ChunkingOptions chunkingOptions,
|
||||
TimeValue timeout,
|
||||
ActionListener<List<ChunkedInferenceServiceResults>> listener
|
||||
) {
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -401,7 +400,6 @@ public class AlibabaCloudSearchServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
@ -420,16 +418,7 @@ public class AlibabaCloudSearchServiceTests extends ESTestCase {
|
|||
var model = createModelForTaskType(taskType, chunkingSettings);
|
||||
|
||||
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
|
||||
service.chunkedInfer(
|
||||
model,
|
||||
null,
|
||||
input,
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
service.chunkedInfer(model, null, input, new HashMap<>(), InputType.INGEST, InferenceAction.Request.DEFAULT_TIMEOUT, listener);
|
||||
|
||||
var results = listener.actionGet(TIMEOUT);
|
||||
assertThat(results, instanceOf(List.class));
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -1559,7 +1558,6 @@ public class AmazonBedrockServiceTests extends ESTestCase {
|
|||
List.of("abc", "xyz"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -1194,7 +1193,6 @@ public class AzureAiStudioServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -1343,7 +1342,6 @@ public class AzureOpenAiServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -21,7 +21,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
|
|||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -1451,7 +1450,6 @@ public class CohereServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.UNSPECIFIED,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
@ -1543,7 +1541,6 @@ public class CohereServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.UNSPECIFIED,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.EmptySecretSettings;
|
||||
import org.elasticsearch.inference.EmptyTaskSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -461,7 +460,6 @@ public class ElasticInferenceServiceTests extends ESTestCase {
|
|||
List.of("input text"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
|
|||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptyTaskSettings;
|
||||
import org.elasticsearch.inference.InferenceResults;
|
||||
|
@ -902,7 +901,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
latchedListener
|
||||
);
|
||||
|
@ -973,7 +971,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
latchedListener
|
||||
);
|
||||
|
@ -1044,7 +1041,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
latchedListener
|
||||
);
|
||||
|
@ -1090,7 +1086,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
null,
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
ActionListener.wrap(r -> fail("unexpected result"), e -> fail(e.getMessage()))
|
||||
);
|
||||
|
@ -1102,7 +1097,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(256, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
ActionListener.wrap(r -> fail("unexpected result"), e -> fail(e.getMessage()))
|
||||
);
|
||||
|
@ -1155,7 +1149,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar", "baz"),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
latchedListener
|
||||
);
|
||||
|
@ -1228,7 +1221,6 @@ public class ElasticsearchInternalServiceTests extends ESTestCase {
|
|||
List.of(input),
|
||||
Map.of(),
|
||||
InputType.SEARCH,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
latchedListener
|
||||
);
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
|
|||
import org.elasticsearch.core.Strings;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptyTaskSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -870,16 +869,7 @@ public class GoogleAiStudioServiceTests extends ESTestCase {
|
|||
webServer.enqueue(new MockResponse().setResponseCode(200).setBody(responseJson));
|
||||
|
||||
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
|
||||
service.chunkedInfer(
|
||||
model,
|
||||
null,
|
||||
input,
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
service.chunkedInfer(model, null, input, new HashMap<>(), InputType.INGEST, InferenceAction.Request.DEFAULT_TIMEOUT, listener);
|
||||
|
||||
var results = listener.actionGet(TIMEOUT);
|
||||
assertThat(results, hasSize(2));
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InputType;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
|
@ -98,7 +97,6 @@ public class HuggingFaceElserServiceTests extends ESTestCase {
|
|||
List.of("abc"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -782,7 +781,6 @@ public class HuggingFaceServiceTests extends ESTestCase {
|
|||
List.of("abc"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
@ -838,7 +836,6 @@ public class HuggingFaceServiceTests extends ESTestCase {
|
|||
List.of("abc"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.EmptyTaskSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
|
@ -686,16 +685,7 @@ public class IbmWatsonxServiceTests extends ESTestCase {
|
|||
getUrl(webServer)
|
||||
);
|
||||
PlainActionFuture<List<ChunkedInferenceServiceResults>> listener = new PlainActionFuture<>();
|
||||
service.chunkedInfer(
|
||||
model,
|
||||
null,
|
||||
input,
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
service.chunkedInfer(model, null, input, new HashMap<>(), InputType.INGEST, InferenceAction.Request.DEFAULT_TIMEOUT, listener);
|
||||
|
||||
var results = listener.actionGet(TIMEOUT);
|
||||
assertThat(results, hasSize(2));
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
|
|||
import org.elasticsearch.core.Nullable;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -673,7 +672,6 @@ public class MistralServiceTests extends ESTestCase {
|
|||
List.of("abc", "def"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.core.TimeValue;
|
||||
import org.elasticsearch.inference.ChunkedInferenceServiceResults;
|
||||
import org.elasticsearch.inference.ChunkingOptions;
|
||||
import org.elasticsearch.inference.ChunkingSettings;
|
||||
import org.elasticsearch.inference.InferenceServiceConfiguration;
|
||||
import org.elasticsearch.inference.InferenceServiceResults;
|
||||
|
@ -1558,7 +1557,6 @@ public class OpenAiServiceTests extends ESTestCase {
|
|||
List.of("foo", "bar"),
|
||||
new HashMap<>(),
|
||||
InputType.INGEST,
|
||||
new ChunkingOptions(null, null),
|
||||
InferenceAction.Request.DEFAULT_TIMEOUT,
|
||||
listener
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue