Is there an API for asking the Google Assistant general questions via plaintext? - google-assistant-sdk

I'm looking for a way to integrate the Google Assistant into my chatbot and be able to get answers to general questions like "whats the weather?", "how tall is X?", "what does X mean?" etc. (just how Google Home works). Ideally this would be over a REST API and I'd get the response back inside of a JSON payload.
I looked through the Google Assistant SDK docs but it wasn't clear on how I could host/build an API that does this. Any ideas on if something like this already exists?

Yes, you use the Google Assistant SDK.
There isn't a REST API, since other requirements for the SDK are poorly suited for REST. Instead it uses gRPC, which lets them publish a standard interface and lets you compile this interface to local language bindings.
IF you are using Python, C++, or Node.js, there are already libraries available which allow you to skip the gRPC setup yourself.

Related

Google assistant SDK custom commands

Currently following hot word example, I create custom commands like turn screen on/off, how do I disable voice response "sorry I can't help you"
there are multiple ways do it.follow this link and details google assistant
1 - if your using this method/project creation and run it. then you can parse the request/query in event.args['text'] based on which you can perform activity local without sending it to google assistant. problems: google will response with some voice message parallel.
2 - use IFTTT, pretty simple to work with. basic use with webhooks takes little time though. this link is useful and use ngrok for local webhook url
3 - use API.AI this is for advanced projects where you depend on google to assist with questions recognization and response with your answers from webhooks. it's not straight forward to work with, the details and tutorials that are given are with google cloud functions which works only with node.js as of now. if your python programmer or any other languages google has examples in github which are again not stright forward, I guess.

API for Creating/Editing Google Slides

Does Google offer a REST or Javascript API for creating and editing slides? I've been able to figure out how to interact with sheets and most of the other services offered as part of Docs/Drive, but haven't had any luck with Slides.
If there is no API, I'd be willing to create files directly myself, but I haven't been able to find any documentation on a Slides file format.
The Google Slides API was launched on 11/9/2016. It provides the ability to read, create, and edit Google Slides presentations.
I was looking into this too. Looks like it's been a requested feature since at least 2012, follow Issue Tracker Link
Right now the best I know of is to automate making a powerpoint file (e.g. use this library for python) and then upload it to google drive where it will autoconvert. Obviously there are many limitations to this strategy, but in a quick test it worked fine for something simple.
I would also love if Google provided an API that allows making slides like the various API calls for microsoft office.

What's the proper and correct way to access files on O365 from iOS

I know that someone mean will probably close this question for being opinion, but the truth is, I'm not after opinion as such, but actual facts about the correct way and how to do this.
I've been searching around for quite a time and I'm still unclear as to what direction to take. It seems there are a billion* libraries that I could use, but I want to know what would be the correct, proper supported method of achieving this.
Essentially, I have a very simple requirement to list and download files from Sites on our Office 365 subscription to an iOS application.
Initially, I looked at the REST interface for Sharepoint and, from a browser, was able to easily perform a GET to our site and receive and receie a response with meta data about the file, for example:
https://mytenantid.sharepoint.com/_api/web/getfilebyserverrelativeurl('/MyFile/Here/Document.txt')
I could also retrieve JSON output instead of XML by specifying an Accept header of application/json using the POSTMAN REST client for Chrome.
So far, so easy. Just the authentication to do outside of the browser and that's it.
Phew!!
I started by looking at Basic authentication, but wasn't sure if this is the right way to do it and even if it would work?
On looking further, it seems that actually, using OAuth might be the way to go. Apparently, you can either do this yourself (no idea how), or use a library (ADAL?) from Microsoft? Unfortunately, this all looks half baked will very little documentation that seems to work. It also requires the use of CocoaPods and workspaces and isn't just a simple library that I can copy to my project and start using (a la SwiftyJSON). There also seems to be a lot of other libraries around too.
I should mention that I'm using Swift, so I've tried converting code from Objective C to Swift (unsuccessfully) too. Apparently I can't use "readWithCallback" with an argument list that the code tells me I should actually use -- even a sample application I downloaded had the same issue.
I've also tried using node.js with a script (not a Web Application) and the documentation and number of libraries available for that is almost worse.
Any assistance to achieve this really simple capability would be hugely appreciated -- it's been driving me nuts.
Many thanks,
D.
*this might be a slight exaggeration.
Office 365 has a RESTful API that you can use any programming language to authentication and integrate in your app.
Here is a simple example for iOS connected app to office 365. The sample shows how to do this in Objective C and SWIFT.
https://github.com/OfficeDev/O365-iOS-Connect
If you want to full iOS samples for office 365 connected apps, Check out this link:
https://msdn.microsoft.com/en-us/office/office365/howto/starter-projects-and-code-samples
Enjoy :)

Is it possible to read a Google Spreadsheet from (server-VM-run) Dart code?

I'd like to read data from a Google Drive Spreadsheet in Dart code (running as a console app in the VM, not in the browser). I'm somewhat confused by the names of the API; Sheets is part of Google Drive, but all the Google Drive API docs I can find relate to integrating the UI of Drive into your app.
There's also this question on SO, but it's over 2 years so I'm hoping that it's no longer correct, and there is an API.
I found this Dart Google API library, but it says:
THIS LIBRARY IS DEPRECATED
Please use the Google API Dart libraries in http://pub.dartlang.org, the Dart package manager
Search for 'google' or the API of your choice. For example:
http://pub.dartlang.org/packages/google_drive_v2_api
However I'm struggling to find which package I'm supposed to use. The Drive API one doesn't have a lot of info, and there doesn't appear to be one with "Sheets" or "Docs" in the name.
You need to use the Spreadsheet API https://developers.google.com/google-apps/spreadsheets/.
There isn't a Dart lib for it, but it's a well formed REST API so very easy to program against.
Sheets is not exactly part of Google Drive, it is part of the Google Docs productivity suite that is stored in Google Drive. Google Drive is the general cloud storage layer. The Drive API is for interacting with files of all types that are stored in Drive. You can interact with Sheets files using that API to modify metadata or import or export to/from other formats like csvs. That is possible to do from Dart (I'm not sure if there is a Dart-specific client library, but this API is just rest calls so its always possible.)
If you want to interact with a Sheet at a lower level to do things like modify a single cell, you can use AppScript, however that cannot be done from Dart.
Usually for Google APIs support generators that create access libraries for every language.
For example https://pub.dartlang.org/packages/google_drive_v2_api.
You can generate them yourself (also for your own endpoints) using https://pub.dartlang.org/packages/discovery_api_client_generator but for most APIs there are packages already in pub.dartlang.org.

Firefox Lightbeam API

I am sure you guys have heard about Mozilla Firefox's LightBeam technology which graphically shows you the third party websites connected to your website. I would like to do something similar to that. Is there an API that I could use? Has anyone of you familiar with such an API?
Also, if there is something similar to Lightbeam that anyone of you might be using, then I'll appreciate if you can let me know.
Thanks.
Lightbeam (formerly Collusion) is an Add-on SDK extension, written in Javascript. I don't think it offers an official API you could interact with, and uses itself only APIs Firefox/Gecko provides plus some third party JS libraries such as d3.
But it is open source, so you're free to study the code, make pull requests and borrow stuff for your own projects.

Resources