Skip to content

Commit

Permalink
Rebased and fixed escape JSON
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
  • Loading branch information
arjunkumargiri committed Dec 5, 2023
1 parent 01480ba commit 6dd5242
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void run(MLAgent mlAgent, Map<String, String> params, ActionListener<Obje
}

String outputResponse = parseResponse(output);
params.put(outputKey, outputResponse);
params.put(outputKey, escapeJson(outputResponse));
additionalInfo.put(outputKey, outputResponse);

if (finalI == toolSpecs.size()) {
Expand Down Expand Up @@ -175,12 +175,12 @@ private String parseResponse(Object output) {
return response + "";

} else if (output instanceof ModelTensor) {
return escapeJson(toJson(((ModelTensor) output).getDataAsMap()));
return toJson(((ModelTensor) output).getDataAsMap());
} else {
if (output instanceof String) {
return (String) output;
} else {
return escapeJson(toJson(output));
return toJson(output);
}
}
}
Expand Down

0 comments on commit 6dd5242

Please sign in to comment.