Back to Parent

on_intent("EMOTION")do
     #storing mood
   
    slots = request.intent.slots
    puts slots.to_s
    #Saving user sentiment
    mood = request.intent.slots["Mood"].to_s

    response.should_end_session = false

    # search_track(mood) 

    #set session storage 
    session_attributes["mood"] = mood

    # response.set_output_speech_text("Ok, I just made you a personalized mood playlist")

    response.set_output_speech_text("Ok, what would you like me to do?")
  end

  on_intent("MOOD_MUSIC")do    
    #Code for Spotify grabbing track sample by playlist
  
    if session_attributes["mood"].nil?
      # do default
      response.set_output_speech_text("I am sorry I didn't quite get that, but what are you in the mood for?")

    else
      mood = session_attributes["mood"] 
      search_track(mood) 
      response.set_output_speech_text("Ok, I just made you a personalized mood playlist")


    end

  end
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0