Пример #1
0
def throw_handler(dice_cnt):
    speech = "주사위를 " + str(dice_cnt) + "개 던집니다."
    dice_sound = os.path.join(os.getcwd(), "rolling_dice_sound.mp3")
    result_text = get_answer(dice_cnt)

    return statement(say.Korean(speech))\
        .add_speech(say.Link(dice_sound))\
        .add_speech(say.Korean(result_text))
Пример #2
0
def whats_my_color():
    color = session.attributes.get(COLOR_KEY)
    if color is not None:
        statement_text = render_template('known_color_bye', color=color)
        return statement(say.Korean(statement_text))
    else:
        question_text = render_template('unknown_color_reprompt')
        return question(say.Korean(question_text)).reprompt(
            say.Korean(question_text))
Пример #3
0
def my_color_is(color):
    if color is not None:
        session.attributes[COLOR_KEY] = color
        question_text = render_template('known_color', color=color)
        reprompt_text = render_template('known_color_reprompt')
    else:
        question_text = render_template('unknown_color')
        reprompt_text = render_template('unknown_color_reprompt')
    return question(say.Korean(question_text))\
        .reprompt(say.Korea(reprompt_text))
Пример #4
0
def launch():
    speech_text = render_template('welcome')
    return question(say.English(speech_text)).reprompt(say.Korean('아무도 없나요~?'))
Пример #5
0
def launch():
    question_text = render_template('welcome')
    reprompt_text = render_template('welcome_reprompt')
    return question(say.Korean(question_text))\
        .reprompt(say.Korean(reprompt_text))
Пример #6
0
def default_intent():
    magic_sound = "https://ssl.pstatic.net/static/clova/service/native_extensions/magicball/magic_ball_sound.mp3"
    speech = "마법 구슬이 " + get_answer() + " 라고 말합니다."
    return statement(say.Link(magic_sound))\
        .add_speech(say.Korean(speech))
Пример #7
0
def launch():
    speech_text = "안녕하세요? 마법구슬이에요. 무엇이든 저에게 물어보세요."
    return question(say.Korean(speech_text))
Пример #8
0
def session_ended():
    return statement(say.Korean("주사위 놀이 익스텐션을 종료합니다."))
Пример #9
0
def guide_intent():
    return question(say.Korean("주사위 한 개 던져줘, 라고 시도해보세요."))
Пример #10
0
def launch():
    speech_text = "몇개의 주사위를 던질까요?"
    session.sessionAttributes['intent'] = 'ThrowDiceIntent'

    return question(say.Korean(speech_text))