Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not add greeting #211

Merged
merged 1 commit into from
Nov 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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