fix: not add greeting
@@ -50,6 +50,7 @@ MOST_DUMMY_RESPONSES = [
"I didn't get it. Sorry",
]
LANGUAGE = getenv("LANGUAGE", "EN")
+GREETING_FIRST = int(getenv("GREETING_FIRST", 1))
@app.route("/respond", methods=["POST"])
@@ -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}"
