Skip to content

Commit

Permalink
update api response
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Nov 28, 2023
1 parent f88db95 commit c8e2dc6
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -432,14 +432,21 @@ private void runReAct(
);

List<ModelTensors> finalModelTensors = new ArrayList<>();
Map<String, Object> additionalInfoMap = new HashMap<>(additionalInfo);
additionalInfoMap.put("response", finalAnswer);
finalModelTensors
.add(
ModelTensors
.builder()
.mlModelTensors(
Arrays.asList(ModelTensor.builder().name("response").dataAsMap(additionalInfoMap).build())
Arrays
.asList(
ModelTensor
.builder()
.name("response")
.dataAsMap(
ImmutableMap.of("response", finalAnswer, ADDITIONAL_INFO_FIELD, additionalInfo)
)
.build()
)
)
.build()
);
Expand Down

0 comments on commit c8e2dc6

Please sign in to comment.