This repository was archived by the owner on Jun 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -134,21 +134,14 @@ def suggest(self, *replies):
134134 for r in replies :
135135 chips .append ({"title" : r })
136136
137- # NOTE: both of these formats work in the dialogflow console,
138- # but only the first (suggestions) appears in actual Google Assistant
139-
140137 # native chips for GA
141138 self ._messages .append (
142139 {"platform" : "ACTIONS_ON_GOOGLE" , "suggestions" : {"suggestions" : chips }}
143140 )
144141
145- # # quick replies for other platforms
146- # self._messages.append(
147- # {
148- # "platform": "ACTIONS_ON_GOOGLE",
149- # "quickReplies": {"title": None, "quickReplies": replies},
150- # }
151- # )
142+ if "DIALOGFLOW_MESSENGER" in self ._integrations :
143+ chip_resp = df_messenger ._build_suggestions (* replies )
144+ self ._platform_messages ["DIALOGFLOW_MESSENGER" ].append (chip_resp )
152145
153146 return self
154147
Original file line number Diff line number Diff line change @@ -46,3 +46,11 @@ def _build_list(title, items):
4646 list_responses .append (item )
4747
4848 return list_responses
49+
50+
51+ def _build_suggestions (* replies ):
52+ chips = {"type" : "chips" , "options" : []}
53+ for i in replies :
54+ chips ["options" ].append ({"text" : i })
55+
56+ return chips
You can’t perform that action at this time.
0 commit comments