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: prompts from dummy skill #193

Merged
merged 1 commit into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
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 @@ -429,15 +429,7 @@ def tag_based_response_selection(dialog, candidates, scores, confidences, bot_ut
)
skill_name = cand_uttr["skill_name"]
_is_dialog_abandon = get_dialog_breakdown_annotations(cand_uttr) and PRIORITIZE_NO_DIALOG_BREAKDOWN
_is_just_prompt = (
cand_uttr["skill_name"] == "dummy_skill"
and any(
[
question_type in cand_uttr.get("type", "")
for question_type in ["normal_question", "link_to_for_response_selector"]
]
)
) or cand_uttr.get("response_parts", []) == ["prompt"]
_is_just_prompt = cand_uttr.get("response_parts", []) == ["prompt"]
if cand_uttr["confidence"] == 1.0:
# for those hypotheses where developer forgot to set tag to MUST_CONTINUE
cand_uttr["can_continue"] = MUST_CONTINUE
Expand Down
8 changes: 4 additions & 4 deletions skills/dummy_skill/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ async def send(self, payload: Dict, callback: Callable):
logger.info("Found special nounphrases for questions. Return question with the same nounphrase.")
cands += [choice(questions_same_nps)]
confs += [0.5]
attrs += [{"type": "nounphrase_question"}]
attrs += [{"type": "nounphrase_question", "response_parts": ["prompt"]}]
human_attrs += [{}]
bot_attrs += [{}]

Expand Down Expand Up @@ -267,13 +267,13 @@ async def send(self, payload: Dict, callback: Callable):
else:
confs += [0.05] # Use it only as response selector retrieve skill output modifier
cands += [link_to_question]
attrs += [{"type": "link_to_for_response_selector"}]
attrs += [{"type": "link_to_for_response_selector", "response_parts": ["prompt"]}]
human_attrs += [human_attr]
bot_attrs += [{}]
elif is_russian:
cands += [random.choice(RUSSIAN_RANDOM_QUESTIONS)]
confs += [0.8]
attrs += [{"type": "link_to_for_response_selector"}]
attrs += [{"type": "link_to_for_response_selector", "response_parts": ["prompt"]}]
human_attrs += [{}]
bot_attrs += [{}]

Expand All @@ -293,7 +293,7 @@ async def send(self, payload: Dict, callback: Callable):
logger.info("Found special nounphrases for facts. Return fact with the same nounphrase.")
cands += [choice(facts_same_nps)]
confs += [0.5]
attrs += [{"type": "nounphrase_fact"}]
attrs += [{"type": "nounphrase_fact", "response_parts": ["body"]}]
human_attrs += [{}]
bot_attrs += [{}]

Expand Down