From a1d6785de07ed52511cfb97ef43eee5d8af8412f Mon Sep 17 00:00:00 2001 From: Dan Rubinstein Date: Tue, 24 Sep 2024 16:50:03 -0400 Subject: [PATCH] Fixing naming inconsistency --- .../elasticsearch/xpack/inference/services/ServiceUtils.java | 2 +- .../services/googleaistudio/GoogleAiStudioService.java | 2 +- .../inference/services/huggingface/HuggingFaceService.java | 2 +- .../xpack/inference/services/mistral/MistralService.java | 2 +- .../xpack/inference/services/openai/OpenAiService.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java index 246071424e0e1..2418191e51ae7 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/ServiceUtils.java @@ -202,7 +202,7 @@ public static ElasticsearchStatusException unknownSettingsError(Map invalidModelType) { + public static ElasticsearchStatusException invalidModelTypeForUpdateModelWithEmbeddingDetails(Class invalidModelType) { throw new ElasticsearchStatusException( Strings.format("Can't update embedding details for model with unexpected type %s", invalidModelType), RestStatus.BAD_REQUEST diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java index a5ab5b0c73d7f..422fc5b0ed720 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googleaistudio/GoogleAiStudioService.java @@ -209,7 +209,7 @@ public Model updateModelWithEmbeddingDetails(Model model, int embeddingSize) { return new GoogleAiStudioEmbeddingsModel(embeddingsModel, updatedServiceSettings); } else { - throw ServiceUtils.invalidModelTypeForUpdateEmbeddingsModelDetails(model.getClass()); + throw ServiceUtils.invalidModelTypeForUpdateModelWithEmbeddingDetails(model.getClass()); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java index bda599141a763..6b142edca80aa 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/huggingface/HuggingFaceService.java @@ -89,7 +89,7 @@ public Model updateModelWithEmbeddingDetails(Model model, int embeddingSize) { return new HuggingFaceEmbeddingsModel(embeddingsModel, updatedServiceSettings); } else { - throw ServiceUtils.invalidModelTypeForUpdateEmbeddingsModelDetails(model.getClass()); + throw ServiceUtils.invalidModelTypeForUpdateModelWithEmbeddingDetails(model.getClass()); } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java index 0e69a8eb2081a..221951f7a621e 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/mistral/MistralService.java @@ -236,7 +236,7 @@ public Model updateModelWithEmbeddingDetails(Model model, int embeddingSize) { ); return new MistralEmbeddingsModel(embeddingsModel, updatedServiceSettings); } else { - throw ServiceUtils.invalidModelTypeForUpdateEmbeddingsModelDetails(model.getClass()); + throw ServiceUtils.invalidModelTypeForUpdateModelWithEmbeddingDetails(model.getClass()); } } } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/openai/OpenAiService.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/openai/OpenAiService.java index c7b9d494601f0..18c417545b4f2 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/openai/OpenAiService.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/openai/OpenAiService.java @@ -269,7 +269,7 @@ public Model updateModelWithEmbeddingDetails(Model model, int embeddingSize) { return new OpenAiEmbeddingsModel(embeddingsModel, updatedServiceSettings); } else { - throw ServiceUtils.invalidModelTypeForUpdateEmbeddingsModelDetails(model.getClass()); + throw ServiceUtils.invalidModelTypeForUpdateModelWithEmbeddingDetails(model.getClass()); } }