Code Monkey home page Code Monkey logo

paulcutsinger / sample-for-can-fulfill-intent-request Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 10.0 12 KB

Sample related to: "Help Customers Find the Right Skill When No Invocation Name is Used. You can make it easier for customers to find and engage with your US English skills by adding support for the CanFulfillIntentRequest (beta) interface. Using CanFulfillIntentRequest, your skill provides information about its ability to fulfill a given customer request at runtime. Alexa combines this information with a machine-learning model to choose the right skill to use when a customer makes a request without an invocation name. As a result, customers find the right skill faster, using the search terms they say most naturally. "

JavaScript 100.00%

sample-for-can-fulfill-intent-request's Introduction

Can Fulfill Intent Request

Sample related to: "Help Customers Find the Right Skill When No Invocation Name is Used. You can make it easier for customers to find and engage with your US English skills by adding support for the CanFulfillIntentRequest (beta) interface. Using CanFulfillIntentRequest, your skill provides information about its ability to fulfill a given customer request at runtime. Alexa combines this information with a machine-learning model to choose the right skill to use when a customer makes a request without an invocation name. As a result, customers find the right skill faster, using the search terms they say most naturally. "

To use this, you'll need the alexa node SDK. Specifically the beta version. Here are instructions https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/tree/2.x_public-beta

launch blog post

https://developer.amazon.com/docs/custom-skills/name-free-interaction.html

sample-for-can-fulfill-intent-request's People

Contributors

paulcutsinger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sample-for-can-fulfill-intent-request's Issues

Are there any examples for when the intent has no slots?

In the response do you still need to include an empty slots subnode?

		"invocationResponse": {
			"body": {
				"version": "1.0",
				"response": {
					"canFulfillIntent": {
						"canFulfill": "YES",
						"slots": {}
					}
				}
			}
		},

or is something like this okay?

		"invocationResponse": {
			"body": {
				"version": "1.0",
				"response": {
					"canFulfillIntent": {
						"canFulfill": "YES"
					}
				}
			}
		},

I have a private Alexa for business skill that I wrote. Can you perhaps confirm or deny that this intent is invoked on private skills? I put print statements in my code (Im emulating this all in Python). When I try invoke the skill without using the skill name just by using utterances, I would expect this function to be invoked underneath. The print statements log to cloud watch, so I was expecting to see data there.

However, I am not seeing data in cloud watch and it doesn't seem to be working at all. Meaning none of my utterances are matching up with intents and getting passed to the skill without the invocation name.

Can someone provide a sample perhaps in python so I can check my work, and\or advise on what the json response should look like when we dont need to worry about slots?

The documentation states For each slot, a skill is optionally expected to return values for the canUnderstand and canFulfill fields. Optionally to me means that you simple can omit the data and just return an empty slots subnode but I am not sure.


def canFulfillIntent(fullfill_request,session):
    print("We hit the fullfill intent")
    lsta = []
    intent = fullfill_request['intent']
    intent_name = str(fullfill_request['intent']['name'])
    print("Intent Name Is: " + intent_name)
    if intent_name in lsta:
        #we are good return yes
        Decision = "YES"
        print("FOUND INTENT")
        return build_response_fulfill(build_fulfill_response(Decision))
    else:
        #return no    
        Decision = "NO"
        print("DID NOT FIND INTENT")
        return build_response_fulfill(build_fulfill_response(Decision))

How to test this skill?

Hi,

I can't test this sample with vocal console in Amazon. When i say "open voice experts and tell me about Jedidiah Esposito", it's work fine but if i just say "tell me about Jedidiah Esposito", alexa answer me "Sorry, I'm not sure."
How can i do?

Thanks

Error when using ask-sdk-core module

const Alexa = require('ask-sdk-core');

When using "ask-sdk-core" I kept getting the "handlerInput.responseBuilder.withCanFulfillIntent is not a function" error. When changed to "ask-sdk" I was able to get the following (expected) response:

"response": {
"canFulfillIntent": {
"canFulfill": "YES",
"slots": {
"voiceExpert": {
"canUnderstand": "YES",
"canFulfill": "NO"
}
}
}
}

Here is my "npm ls --depth=0" output:
8c85900feb20:custom $ npm ls --depth=0
[email protected] ~/canFulfillPaul/lambda/custom
├── [email protected]
├── [email protected]
└── [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.