Can Google Prediction API be used to develop Predictive Chat Bot? - chatbot

I was just fiddling around different machine learning platforms and was planing to use Google predictive API for creating predictive chat bot.
The issue that I am facing now is each request to the API requires OAuth authentication. The fact that I will not be able to authenticate requests for processing the text entered by a client is the real concern. How will I probably respond to a text entered in the chat by a guest user in real time? Is it possible or is Google predictive API not made for this use case?
I am following Prediction API Quick Start Guide by Google and using POST MAN for making API calls.
If possible, please guide me using references or code snippet.

You can create service accounts in place of OAuth authentication tokens. You can create these through the Google Cloud Console. It will then give you the ability to create a server to server (Google) auth that you can use to interact with the API.

Related

How to Integrate Google Cloud Services With Flutter?

I have been wondering if it is possible to integrate Google Cloud Services such as Cloud Text-to-Speech in Flutter. The lack of documentation makes me wonder if there's some workaround or something because I can't find a way to integrate.
As you can see in the documentation, there are only samples for different languages, no presence for Flutter:
https://cloud.google.com/text-to-speech/docs/samples/tts-synthesize-text
enter image description here
Any suggestions? Will appreciate it.
GCP TtS is available also by REST API calls, as any other GCP service. So you can write Dartcode to perform an HTTP POST request to send text or audio.
BTW you have to consider how to authenticate to TtS, and there are different options, some of them:
your users need to be authenticated in your GCP organization by your mobile app, and they also need to have the permissions to invoke that service. Then your app can invoke TtS using HTTP POST and impersonating the user.
your mobile app authenticate the users without a GCP or Firebase identity. In that case you need a backend layer (might be a REST service or a simple Cloud function) acting as a proxy between your mobile app and TtS. Your app calls your backend, the backend authenticates to TtS using a service account (GPC identity), then the backend invokes TtS and sends back the result to your mobile app.

REST API Authentication stateless

Can someone please tell me which of this architectures is stateful/stateless?
REST API with session user authentication stored on redis.
REST API with JWT user authentication stored with revocation list on redis.
REST API with oauth2 user authentication.
I would like to also know if I can have resource and authorization server as one and the same API in terms of oauth2. Is it worth to have own authorization server?
What kind of user authentication and app authentication would be easy and secure to use as start up for REST API that will be used by the website and mobile app? I understand it would be 2 authentications one for user and one for app.
Please this is for me more like wrap up of all stuff I've read so I just need short answers - already had a lot of reading.
The key goal is to externalise it - your UI and API code is then simple and stateless. This is what an Authorization Server enables.
The AS is something you interface with and configure - but you don't code it yourself.
Use a free / cheap Authorization Server from a cloud provider like Google or AWS
Following the OAuth 2.0 and Open Id Connect standards is the lowest cost option if you make the right choices - though there is a learning curve.
As an example my Cloud Samples are pretty much zero cost to me - and my code is simple - even though anyone on the internet can run them.
In terms of getting connected, maybe have a browse of my first tutorial.

Integrate Custom built chatbot with Skype

I have built a chatbot having NLP and AI features in Java language. I have built restful webservices for interaction with the chatbot's AI engine.
The rest API will send the user's query and in return will get an answer by the bot.
I want to integrate this chatbot with Skype. As in there should be a chatbot account and then whenever a person types their query, it should be sent to my server via rest api call and then in turn the response message should be shown in skype chat window.
In my findings, I have seen skype integration with bots built bu Microsoft Bot Framework. Can anyone suggest how can I integrate this custom bot.
If anybody feels I haven't added right tags to reach the exact audience, please add the tags.
I think you need to create a MS Chatbot (in Azure) which allows to deploy it on Skype (and other channels ie Teams), then define a WebHook to invoke your service.
This service needs to "speak" with the MS Bot framework, so you will need to serialise/deserialise the payload, but in the backend you existing endpoint can be used as you need.
Hope it helps.

How to get Outlook Access token?

I'm using the outlook calendar rest api from Salesforce. To continuously leverage the calendar API I need to get authorisation code, access and refresh token.
I have been able to get the Authorisation code by hitting the API. How to get the access token using development code to use the outlook calendar rest API.
Please find the list of AAD authentication libraries here:
https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-authentication-libraries
I found this tutorial in Python very helpful for getting access codes:
This tutorial uses Microsoft Graph (which covers several Microsoft products including Microsoft Outlook) rather than the outlook REST API (which covers just Outlook).
https://learn.microsoft.com/en-us/outlook/rest/python-tutorial
At first, I thought setting up a Django server was overkill. Then I realized that I wanted a way for my Python instance to capture the access code after going through single-sign-on. (I MUST use my browser for single-sign-on because my institution uses multi-factor authentation.) Having a Django server is a natural way to do this.
So I created a new PyCharm Django project (which is straight-forward in PyCharm) and began following the tutorial.
I found it essential to continue following the tutorial all the way through displaying my emails to avoid getting authentication errors -- deviate from the tutorial, and I got error messages (such as this one) that were unpenetrable.

Secure/Best Practices for Account Creation for app that uses REST services?

I apologize if this is a somewhat stupid question, but I am very new to the REST programming realm. I have an application that is both web, mobile and machine accessible, and I will be leveraging REST-like web services for the mobile and machine part. I was going to use the S3 authentication model for the REST requests, however that requires the user account to already be setup.
If the user initiates his use of the service via an iPhone or other mobile device, what is the best way to securely create the user account? As it stands right now, anyone can create an account that will be created inactive and then activated via email link to a CAPTCHA web page. But I am afraid this could still lead to DOS attacks given the fact an email is generated for each request.
Any suggestions on improving this model and/or assuring the request does in fact come from an iPhone?
A good CAPTCHA will prevent such DOS attacks.
Require the CAPTCHA before sending the email link, ie when requesting an account.