From 792814b49b2047a58705b6f92fb1efbe5867c39e Mon Sep 17 00:00:00 2001 From: Yaliang Wu Date: Tue, 3 Oct 2023 21:15:31 -0700 Subject: [PATCH] support bwc for process function Signed-off-by: Yaliang Wu --- .../opensearch/ml/engine/algorithms/remote/ConnectorUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java index c481725057..deb0f8c45d 100644 --- a/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java +++ b/ml-algorithms/src/main/java/org/opensearch/ml/engine/algorithms/remote/ConnectorUtils.java @@ -94,7 +94,8 @@ private static RemoteInferenceInputDataSet processTextDocsInput(TextDocsInputDat List docs = new ArrayList<>(); for (String doc : inputDataSet.getDocs()) { if (doc != null) { - docs.add(gson.toJson(doc)); + String gsonString = gson.toJson(doc); + docs.add(gsonString.substring(1, gsonString.length() - 1)); } else { docs.add(null); }