question

newuser-e0dd5ce5-c645-402a-b9c5-be2274119234 avatar image
newuser-e0dd5ce5-c645-402a-b9c5-be2274119234 asked ·

Regarding the Elicitslot issue on python with aws lambda and alexa skill

Hi I have two methods so in that first method response section i am trying to add the elicit slot for calling the second method intent name and slot value at this time i need syntax for elicit slot for Alexa


First Method:

================

def get_goalgroup(intent,session):
    card_title = "goalsdata"
    apiurl ='https://h2aiknq079.execute-api.us-east-1.amazonaws.com/demo/Goals'
    data = {
        'chassignid':22
    }

    goalsresponsedata = requests.post(url= apiurl,data= json.dumps(data))
    session_attributes = {}
    speech_output = goalsresponsedata.text +10*' '+'which goal group would you like'
    reprompt_text = ""
    should_end_session = False
    return build_response(
        session_attributes,
        build_speechlet_response
        (
            card_title,
            speech_output,
            reprompt_text,
            should_end_session
    ))

Second method:

===============


def get_cgoals(intent,session):

    global goalgroupname
    goalgroupname = intent['slots']['goalgroup']['value']
    card_title = "cgoalgroup"
    apiurl ='https://tbqsbbi445.execute-api.us-east-1.amazonaws.com/demo/cgoals'
    data = {
        "goal_group":goalgroupname
    }

    responseGoals = requests.post(url= apiurl,data= json.dumps(data))
    session_attributes = {}
    speech_output = cgoalsData+10*' '+'What would you like to do? 1 Hear details, 2 List active strategies for this goal or 3 go to next?'
    reprompt_text = ""
    should_end_session = False
    return build_response(
        session_attributes,
        build_speechlet_response
        (
            card_title,
            speech_output,
            reprompt_text,
            should_end_session
    ))


In the second method Card Title is the "Intent Name" and slot values "goalgroup"



alexa skills kitalexa voice servicealexa for business
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Amazon_Bernardo Bezerra avatar image
Amazon_Bernardo Bezerra answered ·

Hello and thank you for your message.

It is not clear to me what you are trying to do. You can find a sample in python for the use of the dialog interface over here. More information about the dialog interface is present in the documentation here.

Regards,
Barry

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.