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); }