Example #1
0
def search_category(search_category):
    speech = "Ok, you chose {} right?".format(search_category)
    context_manager.add('search_context', lifespan=3)
    context_manager.set('search_context', 'search_category', search_category) 
    return ask(speech)
Example #2
0
def departure_date(day):
    context_manager.set('departure', 'day', day)
    context_manager.add('arrival')
    speech = 'Ok would you like to confrim your booking details?'
    return ask(speech)
Example #3
0
def action_func(stores):
    manager.get('data').set('stores', stores)
    manager.add('stores-selected')
    return event('SelectMeasureType')
Example #4
0
 def add_context():
     speech = "Adding context to context_out"
     manager.add("context_1")
     return ask(speech)
Example #5
0
def store_answer(answer):
    manager.add('time-periods-complete')  # always end with day
    manager.get('data').set('byday', answer)
    return event('AskProductScope')
Example #6
0
def action_func(products):
    manager.get('data').set('products', products)
    manager.add('products-selected')
    return event('SelectMeasureType')
Example #7
0
def display_available_strats():
    context_manager.add("strat-config-data")
    resp = inline_keyboard("Which strategy do you wish to try?")
    for i in build.EXISTING_STRATS:
        resp.add_button(*i)
    return resp
Example #8
0
def start_conversation(search_category):
    context_manager.add('search_context', lifespan=5)
    context_manager.set('search_context', 'search_category', search_category)
    return ask("Hello shopper!, you looking for {} right?".format(
        search_category)).suggest('yes', 'no')
Example #9
0
def set_special_choice(specialty):
    speech = 'Cool, you chose a {} pizza. What size do you want?'.format(
        specialty)
    context_manager.add('special').set('specialty', specialty)

    return ask(speech)
Example #10
0
def make_sure(order_method):
    context_manager.add(order_method)
    speech = "Did you say {}?".format(order_method)
    return ask(speech)
Example #11
0
def greetings():
    speech = """We've got some bumpin pies up in here!.
                Would you like to order for pickup or delivery?"""
    context_manager.add('select-method', lifespan=1)
    return ask(speech)
Example #12
0
def search_category(search_category):
    context_manager.add('search_context', lifespan=5)
    context_manager.set('search_context', 'search_category', search_category)
    return ask(
        "OK, you looking for {} right?".format(search_category)).suggest(
            'yes', 'no')
Example #13
0
def restart_conversation():
    context_manager.add('search_context', lifespan=0)
    # context_manager.add('search_results', lifespan=0)
    return ask('OK! New search').suggest('I want new smartphone',
                                         'I am looking for a laptop',
                                         'Looking for bike')
Example #14
0
 def set_user_diet(diet):
     speech = 'Are you trying to make food or get food?'
     manager.add(diet)
     return ask(speech)
Example #15
0
def store_answer(answer):
    manager.add('ask-byday', lifespan=1)
    manager.get('data').set('byweek', answer)
    return event('StepToProducts')
Example #16
0
 def add_context():
     speech = 'Adding context to context_out'
     manager.add('SampleContext')
     return ask(speech)
Example #17
0
def start_allergies():
    context_manager.add('await_for_food', lifespan=10)
    speech = "sure, what is your allergy?"
    return ask(speech)