Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

166
Visualizações
flask-ask slot is always being mapped to None

My slot for a custom intent is always being recognised as None.

I have an intents schema which looks like this:

{
    "interactionModel": {
        "languageModel": {
            "invocationName": "name_of_app",
            "intents": [
                {
                    "name": "AMAZON.CancelIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.HelpIntent",
                    "samples": []
                },
                {
                    "name": "AMAZON.StopIntent",
                    "samples": []
                },
                {
                    "name": "EventsIntent",
                    "slots": [
                        {
                            "name": "eventCity",
                            "type": "AMAZON.GB_CITY"
                        }
                    ],
                    "samples": [
                        "whats on in {eventCity}",
                        "whats going on in {eventCity} ",
                        "tell me what events are in {eventCity}"
                    ]
                }
            ],
            "types": []
        }
    }
}

My code is in python, using the flask-ask framework. My main entrypoint looks something like this:

@ask.launch
def start_skill():
    welcome_message = 'Welcome to name_of_app, what do you want?'
    return question(welcome_message)

@ask.intent('EventsIntent', mapping={'city': 'eventCity'})
def weather(city):
    return statement('you have selected {}'.format(city))

Even this simple example however, does not work when the input is:

"whats on in London?"

I have tried with lowercase and with/without punctuation in the testing panel on the amazon developer console, however the return is always:

"you have selected None"

indicating that None is passed as 'eventCity'. Am I passing this slot incorrectly in either the intent schema or in the code?

Thanks

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

hey buddy following is the solution of your problem:

@ask.launch
def start_skill():
    welcome_message = 'Welcome to name_of_app, what do you want?'
    return question(welcome_message)

@ask.intent('EventsIntent', convert={'eventCity': str})
def weather(eventCity):
    return statement('you have selected {}'.format(eventCity))

I was also facing similar issue this thing resolved my issue.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda