2626 from typing import Union
2727 from ask_sdk_model import Directive
2828 from ask_sdk_model .ui import Card
29+ from ask_sdk_model .canfulfill import CanFulfillIntent
2930
3031
3132PLAIN_TEXT_TYPE = "PlainText"
@@ -47,7 +48,8 @@ def __init__(self):
4748 """
4849 self .response = Response (
4950 output_speech = None , card = None , reprompt = None ,
50- directives = None , should_end_session = None )
51+ directives = None , should_end_session = None ,
52+ can_fulfill_intent = None )
5153
5254 def speak (self , speech ):
5355 # type: (str) -> 'ResponseFactory'
@@ -136,6 +138,22 @@ def set_should_end_session(self, should_end_session):
136138 self .response .should_end_session = should_end_session
137139 return self
138140
141+ def set_can_fulfill_intent (self , can_fulfill_intent ):
142+ # type: (CanFulfillIntent) -> 'ResponseFactory'
143+ """Sets CanFulfill intent to the response.
144+
145+ For more information on CanFulfillIntent, check the name-free
146+ interaction doc here: https://developer.amazon.com/docs/custom-skills/understand-name-free-interaction-for-custom-skills.html
147+
148+ :param can_fulfill_intent: CanFulfill Intent sent back in response.
149+ :type can_fulfill_intent: CanFulfillIntent
150+ :return: response factory with partial response being built and
151+ access from self.response.
152+ :rtype: ResponseFactory
153+ """
154+ self .response .can_fulfill_intent = can_fulfill_intent
155+ return self
156+
139157 def __trim_outputspeech (self , speech_output = None ):
140158 # type: (Union[str, None]) -> str
141159 """Trims the output speech if it already has the
0 commit comments