Introducing Steem Voice - a Google Assistant app for the Steem blockchain

Steem Voice

Github repository 

Author 

What is the project about?

I've always liked Google Voice Assistant. I mean who doesn't? You can fulfill your needs just by speaking to your device.  What if we could implement that to Steem? That's why I've decided to develop a Google Voice Assistant app that interacts with the Steem blockchain. I call it Steem Voice.

Starting this project wasn't easy for me because I have never written a webhook before. Thankfully, I found a great framework called Flask-Assistant that made everything easier.

On the first day, I've encountered a huge problem. I couldn't install the Steem library because of a problem concerning Visual Studio. I kept getting this error: Cannot open include file: 'io.h': No such file or directory. After countless hours of installing visual studio again and again and surfing the internet for a solution, I was able to solve the issue by using Anaconda.

With everything all set, I started the first command which was calculating the reputation of a given user. Here's a video of me testing the first command:

While testing, I found the first major problem which is Usernames. The device couldn't pick up a lot of the usernames I tried unless I spelled them which was very annoying.

I moved on to the second command, calculating a user's upvote worth which was much more complex than I thought. It took me some time to get everything set up especially with all those different variables. 

This was my first time using dialog flow. To be honest, it was a bit confusing. If you look at my older commits, you'll notice that I used different entities for each command. It was completely unnecessary so I fixed it by using only one entity and creating different follow-up intents that should keep everything sorted.

Then It was time to move on into the third command which was calculating the steem power of a given user. I used the converter tool that comes with the steem library. My first method of converting vests into steem power was using the steem_per_mvest as shown below:

 def vests2sp(v):
       ratio = c.steem_per_mvests()
       sp = v * ratio / 1e6
       return str(round(sp, 1))

Then, I found sp_to_vests(sp) which does all of the above so I used it instead.

Finally, I added the last command which is used to read the title of a user's latest post. (I initially wanted this command to also return the link of the post but the link returned wasn't clickable. I will focus on this later)

This morning, I tried the command again but it didn't work which is when I found the second major issue:

Steem-python API isn't fast enough to keep up with Google assistant's 5-second limit which gave me a request timed out error. I wrote a small program to measure the process time of the fourth command:

The process took from 2 to 29 seconds thus confirming the issue.

Roadmap 

Is Steem Voice Ready?

As I explained above, my next goal is to find a solution for the two major problems. For now, I added a list of usernames to overcome the first issue as you might have noticed in the videos I don't have to provide the whole username that's because I added synonyms to the list, for instance, instead of saying @utopian-io I can only say utopian or utopian io. If I don't find a better solution, I'll add a feature when I release the app that enables a user to register his username then I'll manually go through each one adding synonyms to it.

For the second problem, I didn't find a good solution. For now, I'll be leaving it as it is.

There are lots and lots of commands to be added. All help is appreciated. 

Technology Stack 

  • Python 3.6

How to contribute? 

Everyone is welcome to aid. You can contribute to the development of this project by creating a pull request to my repository. You can also get in touch with me on Discord  at Fancybrothers#7429 or on Steem.chat at fancybrothers or simply leave your idea down below.

If you want to test this app on your own, contact me and I'll send you the whole Dialogflow agent or a temporarily link to test it out.

Ps: Sorry for the low quality video. I don't have any good recording equipment.

My Github account: https://github.com/Fancybrothers

H2
H3
H4
3 columns
2 columns
1 column
8 Comments