Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

129
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda