What I want to implement is at least a working prototype of a Google Assistant Action with the use of local MySQL database. What I've taught of is MySQL DB-> Google Cloud Platform-> DialogFlow -> Google Assistant.
So the end product would be for example, I say: "What is my total sales" and Google Assistant would retrieve the data from MySQL. I've been trying to look for solutions online and none seem to match what I am looking for. Would this solution be theoretically possible? and how would I be able to integrate the cloud platform into the Google Assistant Action through DialogFlow? Thanks!
It is possible!
Create a Dialogflow agent. Define your intents and add the static response. Test it.
Once tests are passed, integrated it with Actions-On-Google using "Integration tab" to the left.
Test the Assistant with static responses.
When Assistant is ready with the static response, develop a webhook. You can use different client libraries in NodeJS (AoG Client or Dialogflow Client) or in Python (Flask-Assistant or Dialogflow Client) or can create your own.
Once the webhook is ready, run it locally and expose to the internet using NGROK.
Use the generated URL as fulfillment to the Dialogflow agent and update the assistant's draft version.
Create a MySQL DB and connect it webhook using regular NodeJS or Python code
Restart the server and test end to end!
Once tested locally with NGROK, you can PUSH it to the cloud (NodeJS or Python) or any other server.
Related
I have a python/Flask application, on our intranet, and I want people to authenticate to it using their Azure AD credentials. Pretty much every hit on Google/Bing/etc is about how to use AD to authenticate so you can subsequently use Microsoft APIs, such as Graph or Data Lake, or they are for .NET applications, or they are for stuff running on the Azure cloud.
The closest I've come to what I need is https://github.com/cicorias/python-flask-aad-v2, and the instructions refer to some older version of Azure. It would also be nice if I could specify whether an authenticated user should have access to this app, but I can live without it and simply have a list of allowed IDs in the app's back-end.
This cannot be that hard; I've done this in the past for both GCP and AWS, but I've hit the proverbial brick wall when it came to Azure. While this is not my first overall rodeo, it is my first Azure/AD rodeo, so to speak. I'm sure that part of my problem is that, being an Azure noob, I may not even be using the right search keywords.
Help?
Do not think in terms of the providers but in terms of the Authentication standards. Since you have integrated Google Login in your app in the past then you must have used something called OAuth as the auth standard. Azure AD also supports OAuth. You can use a python package called flask-azure-oauth to integrate it in your flask app.
You can refer to below code samples available in Microsoft Identity Platform documentation (https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code#web-applications)
Sign in users - https://github.com/Azure-Samples/ms-identity-python-flask-tutorial
Sign in users and call Microsoft Graph - https://github.com/Azure-Samples/ms-identity-python-webapp
These links are for Python (Flask). You can get code samples for other languages or scenario from Microsoft Identity Platform documentation (https://learn.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code#web-applications)
I've rolled my own email validation function before but have a project that uses a Pre-Google-Cloud-SDK api:
from google.appengine.api.mail import IsEmailValid
This takes a string and returns True/False if it does/doesn't follow the format for an email address. it doesn't test to see if the email address is live - it only parses the string.
Does this functionality exist in Google's Cloud SDK api?
I suspect not as bulk mail support was dropped from App Engine and, with it, this support function.
The Google Cloud API does not offer this type of validation. You can actually search all the available methods in the Client library documentation and in the GitHub repository.
If you are deploying your application with Google App Engine, you can always configure the App to handle Bounce notifications in case a mail is not delivered.
Alternatively, Gmail has its own getProfile API that allows you to check if a user is valid, unfortunately it will only work for gmail accounts.
I'm developing an application with Dialogflow and Actions on Google which requires to send daily birthday notification in Google Assistant.
I'm following this documentation to send daily updates. But I'm having trouble because of the language barrier.
I'm developing backed in Python and using fulfillment to serve the request, but that documentation is in Node.js. So I need help to send daily updates.
I've done up to Console setup. Please guide me for further process.(Which JSON req. should I sent?)
If you look down that documentation page a bit here and click the JSON tab, you'll see the specific format you need to configure the subscription to your birthday updates.
Since you're not using a client library, you'll need to write the Python code yourself to respond with the appropriate JSON.
I have a Webapp that writes the status of Azure VMs in a DB. I want to be able to have the DB update automatically every time a VM is started/stopped/restarted. How do I set up a trigger that POST to my Webapp when the VM is started/stopped/restarted? I'm using the Azure Python SDK. Thank you.
You don't need to write code to achieve this you could use EventGrids in Azure linked to a logic app which would write straight into your database. Here is an example of how to set up an EventGrid to send emails when linked to a logic app. This is an example in how to connect a Logic App to a database. The combination of these two examples will allow you to use Azure native technologies to achieve your goal.
Alternatively instead of writing straight to the database you could use the logic app to POST to your website using one of the connectors.
Hope that helps.
I am trying to first get connection to office 365 using python where I'll be able to hit the office 365 api with post request to create accounts. I have seen some solution using Flask and Django. However, I would like to just implement without these framework with a pure python script using only libraries built for doing such. This is a link to the solution in Flask: https://dev.office.com/code-samples-detail/5989
where the api connection is done:
# Put your consumer key and consumer secret into a config file
# and don't check it into github!!
microsoft = oauth.remote_app(
'microsoft',
consumer_key=client_id,
consumer_secret=client_secret,
request_token_params={'scope': 'User.Read Mail.Send'},
base_url='https://graph.microsoft.com/v1.0/',
request_token_url=None,
access_token_method='POST',
access_token_url='https://login.microsoftonline.com/common/oauth2/v2.0/token',
authorize_url='https://login.microsoftonline.com/common/oauth2/v2.0/authorize'
)
Also, unlike the Flask solution, I won't be using any views but it will run mainly as a backend task.
I want to replicate the api connection as above using only Python OAuth libraries so it runs as a Python script. So far, I'm only getting a 403 error when I tried curl or using request_oauth. Once I have connection to the api, I'll be able to perform CRUD operations on accounts.
Any advice or guidance would be appreciated. Thanks.