Skip to content

Commit

Permalink
Merge pull request #9088 from RasaHQ/deprecate-message-method
Browse files Browse the repository at this point in the history
Remove deprecated Message method: get_combined_intent_response_key.
  • Loading branch information
kedz authored Jul 19, 2021
2 parents 72cbaaf + 1b94d19 commit e3a3669
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions changelog/8883.removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
`rasa.shared.nlu.training_data.message.Message` method `get_combined_intent_response_key` has been removed. `get_full_intent` should now be used in its place.
20 changes: 9 additions & 11 deletions rasa/shared/nlu/training_data/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,19 @@ def get_full_intent(self) -> Text:
else self.get(INTENT)
)

def get_combined_intent_response_key(self) -> Text:
"""Get intent as it appears in training data."""
rasa.shared.utils.io.raise_warning(
"`get_combined_intent_response_key` is deprecated and "
"will be removed in Rasa 3.0.0. "
"Please use `get_full_intent` instead.",
category=DeprecationWarning,
)
return self.get_full_intent()

@staticmethod
def separate_intent_response_key(
original_intent: Text,
) -> Tuple[Text, Optional[Text]]:

"""Splits intent into main intent name and optional sub-intent name.
For example, `"FAQ/how_to_contribute"` would be split into
`("FAQ", "how_to_contribute")`. The response delimiter can
take different values (not just `"/"`) and depends on the
constant - `RESPONSE_IDENTIFIER_DELIMITER`.
If there is no response delimiter in the intent, the second tuple
item is `None`, e.g. `"FAQ"` would be mapped to `("FAQ", None)`.
"""
split_title = original_intent.split(RESPONSE_IDENTIFIER_DELIMITER)
if len(split_title) == 2:
return split_title[0], split_title[1]
Expand Down

0 comments on commit e3a3669

Please sign in to comment.