Skip to content

Commit

Permalink
fix: not add greeting (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
dilyararimovna authored Nov 15, 2022
1 parent 896a163 commit c0588b9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"I didn't get it. Sorry",
]
LANGUAGE = getenv("LANGUAGE", "EN")
GREETING_FIRST = int(getenv("GREETING_FIRST", 1))


@app.route("/respond", methods=["POST"])
Expand Down Expand Up @@ -366,7 +367,7 @@ def select_response(candidates, scores, confidences, is_toxics, dialog, all_prev
best_human_attributes = best_candidate.get("human_attributes", {})
best_bot_attributes = best_candidate.get("bot_attributes", {})

if len(dialog["bot_utterances"]) == 0 and greeting_spec[LANGUAGE] not in best_text:
if len(dialog["bot_utterances"]) == 0 and greeting_spec[LANGUAGE] not in best_text and GREETING_FIRST:
# add greeting to the first bot uttr, if it's not already included
best_text = f"{HI_THIS_IS_DREAM[LANGUAGE]} {best_text}"

Expand Down

0 comments on commit c0588b9

Please sign in to comment.