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

128
Visualizações
What type of variable is intent.slots.myIntent.value in the source code of a lambda AWS JS

I'm doing a skill in the Alexa development console.

An intent within the skill is as follows:

activates the output {mySlot} where mySlot is of type AMAZON.NUMBER

I have taken a lambda function provided by the manufacturer of a microntroller from an example.

This function is a JS file where I have written a function for the aforementioned intent as follows:

function setMyOutPut(intent, session, callback)
{
  ...
  const desiredState = intent.slots.mySlot.value;
  if ((desiredState === 1))
  {
    powerOn = 1;
  }
  else if ((desiredState === 2))
  {
    powerOn = 2;
  }
  else if ((desiredState === 3))
  {
    powerOn = 3;
  }
  else
  {
    speechOutput = "There are only three outputs to activate";
    repromptText = "I did not understand the exit number, please try again';
    callback(sessionAttributes, buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));
  }
  ...

}

When from Alexa I execute the Skill and the intent, when I say "activates the output one", a confirmation Intent is executed in which Alexa responds "The output has been activated correctly".

But if I say, for example "activate the output seven", in the same way it responds that it has been activated correctly.

Or there are times when I say "activates the output three" and the else is produced and it answers "There are only three outputs to activate".

So what I suspect is that intent.slots.mySlot.value is not a numeric variable.

Any suggestions or comments?

about 4 years ago · Juan Pablo Isaza
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