-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
142 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
aniso8601==4.0.1 | ||
cachetools==3.1.1 | ||
certifi==2018.11.29 | ||
chardet==3.0.4 | ||
click==7.0 | ||
flask==1.0.2 | ||
google-auth==1.6.3 | ||
idna==2.8 | ||
itsdangerous==1.1.0 | ||
jinja2==2.10 | ||
markupsafe==1.1.0 | ||
pyasn1-modules==0.2.7 | ||
pyasn1==0.4.7 | ||
requests==2.21.0 | ||
rsa==4.0 | ||
ruamel.yaml==0.15.81 | ||
six==1.12.0 | ||
urllib3==1.24.1 | ||
werkzeug==0.14.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from flask import Flask | ||
from flask_assistant import Assistant, ask, profile, sign_in | ||
|
||
|
||
app = Flask(__name__) | ||
|
||
app.config['INTEGRATIONS'] = ['ACTIONS_ON_GOOGLE'] | ||
app.config['AOG_CLIENT_ID'] = "CLIENT_ID OBTAINED BY SETTING UP ACCOUNT LINKING IN AOG CONSOLE" | ||
|
||
|
||
assist = Assistant(app=app, route="/", project_id="YOUR_GCP_PROJECT_ID") | ||
|
||
@assist.action("Default Welcome Intent") | ||
def welcome(): | ||
if profile: | ||
return ask(f"Welcome back {profile['name']}") | ||
|
||
return sign_in("To learn more about you") | ||
|
||
# this intent must have the actions_intent_SIGN_IN event | ||
# and will be invoked once the user has | ||
@assist.action("Complete-Sign-In") | ||
def complete_sign_in(): | ||
if profile: | ||
return ask(f"Welcome aboard {profile['name']}, thanks for signing up!") | ||
else: | ||
return ask("Hope you sign up soon! Would love to get to know you!") | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters