Module misty2py.basic_skills.speak
This module enables speech with an extended return message.
Functions
def speak(misty: Misty,
utterance: str) ‑> Dict-
Expand source code
def speak(misty: Misty, utterance: str) -> Dict: """Speaks an utterance and returns descriptive message. Args: misty (Misty): The Misty that speaks the utterance. utterance (str): The utterance to speak. Returns: Dict: the enhanced dictionarised Misty2pyResponse. """ result = misty.perform_action( "speak", data={"Text": utterance, "UtteranceId": "utterance_" + get_random_string(6)}, ).parse_to_dict() return compose_custom_response( result, success_message="Talking successful. Utterance: `%s`." % utterance, fail_message="Talking failed. Utterance: `%s`." % utterance, )
Speaks an utterance and returns descriptive message.
Args
misty
:Misty
- The Misty that speaks the utterance.
utterance
:str
- The utterance to speak.
Returns
Dict
- the enhanced dictionarised Misty2pyResponse.