Skip to content

Commit

Permalink
put listener to last
Browse files Browse the repository at this point in the history
Signed-off-by: Yaliang Wu <[email protected]>
  • Loading branch information
ylwu-amzn committed Feb 13, 2024
1 parent 3fc5b30 commit 5d5f261
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ private void runReAct(
);
} else {
String res = String.format(Locale.ROOT, "Failed to run the tool %s which is unsupported.", action);
((ActionListener<Object>) nextStepListener).onResponse(res);
StringSubstitutor substitutor = new StringSubstitutor(
Map.of(SCRATCHPAD, scratchpadBuilder.toString()),
"${parameters.",
"}"
);
newPrompt.set(substitutor.replace(finalPrompt));
tmpParameters.put(PROMPT, newPrompt.get());
((ActionListener<Object>) nextStepListener).onResponse(res);
}
} else {
addToolOutputToAddtionalInfo(toolSpecMap, lastAction, additionalInfo, output);
Expand Down

0 comments on commit 5d5f261

Please sign in to comment.