Skip to content

Commit a9f254d

Browse files
authored
fix unsuported operation (#4733)
Signed-off-by: Hailong Cui <ihailong@amazon.com>
1 parent 6ba0e6d commit a9f254d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/src/main/java/org/opensearch/ml/common/indexInsight/AbstractIndexInsightTask.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import java.nio.charset.StandardCharsets;
1717
import java.time.Instant;
18-
import java.util.Collections;
1918
import java.util.HashMap;
2019
import java.util.List;
2120
import java.util.Map;
@@ -471,11 +470,14 @@ protected static void callLLMWithAgent(
471470
String sourceIndex,
472471
ActionListener<String> listener
473472
) {
473+
Map<String, String> params = new HashMap<>();
474+
params.put("prompt", prompt);
475+
474476
AgentMLInput agentInput = AgentMLInput
475477
.AgentMLInputBuilder()
476478
.agentId(agentId)
477479
.functionName(FunctionName.AGENT)
478-
.inputDataset(RemoteInferenceInputDataSet.builder().parameters(Collections.singletonMap("prompt", prompt)).build())
480+
.inputDataset(RemoteInferenceInputDataSet.builder().parameters(params).build())
479481
.build();
480482

481483
MLExecuteTaskRequest executeRequest = new MLExecuteTaskRequest(FunctionName.AGENT, agentInput);

0 commit comments

Comments
 (0)