Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
[QnA] Fix MultiTurnPrompt QnA conversation (#1204)
Browse files Browse the repository at this point in the history
* Fix MultiTurn QnA conversation

* Fix linter issue
  • Loading branch information
Batta32 authored May 26, 2021
1 parent 4a73dc2 commit 955b836
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -854,13 +854,9 @@ private CompletableFuture<DialogTurnResult> callGenerateAnswer(WaterfallStepCont

// Calling QnAMaker to get response.
return this.getQnAMakerClient(stepContext).thenApply(qnaMakerClient -> {
QueryResults response =
(QueryResults) stepContext.getState().get(String.format("turn.qnaresult%s", this.hashCode()));
if (response == null) {
response = qnaMakerClient
QueryResults response = qnaMakerClient
.getAnswersRaw(stepContext.getContext(), dialogOptions.getQnAMakerOptions(), null, null)
.join();
}

// Resetting previous query.
Integer previousQnAId = -1;
Expand Down Expand Up @@ -980,8 +976,11 @@ private CompletableFuture<DialogTurnResult> checkForMultiTurnPrompt(WaterfallSte

if (answer.getContext() != null && answer.getContext().getPrompts().length > 0) {
Map<String, Integer> previousContextData =
ObjectPath.getPathValue(stepContext.getActiveDialog().getState(), QNA_CONTEXT_DATA, Map.class);

ObjectPath.getPathValue(
stepContext.getActiveDialog().getState(),
QNA_CONTEXT_DATA,
Map.class,
new HashMap<>());
for (QnAMakerPrompt prompt : answer.getContext().getPrompts()) {
previousContextData.put(prompt.getDisplayText(), prompt.getQnaId());
}
Expand Down

0 comments on commit 955b836

Please sign in to comment.