Skip to content

Commit 80af6d3

Browse files
committed
Fixed GoogleVertexAiServiceTest for Service configuration
1 parent a9df8e3 commit 80af6d3

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiSecretSettings.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ public static Map<String, SettingsConfiguration> get() {
124124
var configurationMap = new HashMap<String, SettingsConfiguration>();
125125
configurationMap.put(
126126
SERVICE_ACCOUNT_JSON,
127-
new SettingsConfiguration.Builder(EnumSet.of(TaskType.TEXT_EMBEDDING, TaskType.RERANK, TaskType.CHAT_COMPLETION))
128-
.setDescription("API Key for the provider you're connecting to.")
127+
new SettingsConfiguration.Builder(
128+
EnumSet.of(TaskType.TEXT_EMBEDDING, TaskType.RERANK, TaskType.CHAT_COMPLETION, TaskType.COMPLETION)
129+
).setDescription("API Key for the provider you're connecting to.")
129130
.setLabel("Credentials JSON")
130131
.setRequired(true)
131132
.setSensitive(true)

x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiService.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,11 @@ public static InferenceServiceConfiguration get() {
408408

409409
configurationMap.put(
410410
LOCATION,
411-
new SettingsConfiguration.Builder(EnumSet.of(TaskType.TEXT_EMBEDDING, TaskType.CHAT_COMPLETION)).setDescription(
412-
"Please provide the GCP region where the Vertex AI API(s) is enabled. "
413-
+ "For more information, refer to the {geminiVertexAIDocs}."
414-
)
411+
new SettingsConfiguration.Builder(EnumSet.of(TaskType.TEXT_EMBEDDING, TaskType.CHAT_COMPLETION, TaskType.COMPLETION))
412+
.setDescription(
413+
"Please provide the GCP region where the Vertex AI API(s) is enabled. "
414+
+ "For more information, refer to the {geminiVertexAIDocs}."
415+
)
415416
.setLabel("GCP Region")
416417
.setRequired(true)
417418
.setSensitive(false)

x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/services/googlevertexai/GoogleVertexAiServiceTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ public void testGetConfiguration() throws Exception {
974974
{
975975
"service": "googlevertexai",
976976
"name": "Google Vertex AI",
977-
"task_types": ["text_embedding", "rerank", "chat_completion"],
977+
"task_types": ["text_embedding", "rerank", "completion", "chat_completion"],
978978
"configurations": {
979979
"service_account_json": {
980980
"description": "API Key for the provider you're connecting to.",
@@ -983,7 +983,7 @@ public void testGetConfiguration() throws Exception {
983983
"sensitive": true,
984984
"updatable": true,
985985
"type": "str",
986-
"supported_task_types": ["text_embedding", "rerank", "chat_completion"]
986+
"supported_task_types": ["text_embedding", "rerank", "completion", "chat_completion"]
987987
},
988988
"project_id": {
989989
"description": "The GCP Project ID which has Vertex AI API(s) enabled. For more information on the URL, refer to the {geminiVertexAIDocs}.",
@@ -992,7 +992,7 @@ public void testGetConfiguration() throws Exception {
992992
"sensitive": false,
993993
"updatable": false,
994994
"type": "str",
995-
"supported_task_types": ["text_embedding", "rerank", "chat_completion"]
995+
"supported_task_types": ["text_embedding", "rerank", "completion", "chat_completion"]
996996
},
997997
"location": {
998998
"description": "Please provide the GCP region where the Vertex AI API(s) is enabled. For more information, refer to the {geminiVertexAIDocs}.",
@@ -1001,7 +1001,7 @@ public void testGetConfiguration() throws Exception {
10011001
"sensitive": false,
10021002
"updatable": false,
10031003
"type": "str",
1004-
"supported_task_types": ["text_embedding", "chat_completion"]
1004+
"supported_task_types": ["text_embedding", "completion", "chat_completion"]
10051005
},
10061006
"rate_limit.requests_per_minute": {
10071007
"description": "Minimize the number of rate limit errors.",
@@ -1010,7 +1010,7 @@ public void testGetConfiguration() throws Exception {
10101010
"sensitive": false,
10111011
"updatable": false,
10121012
"type": "int",
1013-
"supported_task_types": ["text_embedding", "rerank", "chat_completion"]
1013+
"supported_task_types": ["text_embedding", "rerank", "completion", "chat_completion"]
10141014
},
10151015
"model_id": {
10161016
"description": "ID of the LLM you're using.",
@@ -1019,7 +1019,7 @@ public void testGetConfiguration() throws Exception {
10191019
"sensitive": false,
10201020
"updatable": false,
10211021
"type": "str",
1022-
"supported_task_types": ["text_embedding", "rerank", "chat_completion"]
1022+
"supported_task_types": ["text_embedding", "rerank", "completion", "chat_completion"]
10231023
}
10241024
}
10251025
}

0 commit comments

Comments
 (0)