'Beyond Bitshares' - An open source Google Assistant bot! (WIP)
bitshares·@cm-steem·
0.000 HBD'Beyond Bitshares' - An open source Google Assistant bot! (WIP)
<center></center> # 'Beyond Bitshares' - An open source Google Assistant bot! In my last couple Steemit posts, I wrote about [developing a HUG REST API](https://steemit.com/bitshares/@cm-steem/several-updates-for-the-bitshares-hug-rest-api) for the read-only [python-bitshares](https://github.com/xeroc/python-bitshares) functions in order to expose said functionality for public Bitshares service utilization. Given the open source nature of the [HUG REST API](https://github.com/BTS-CM/Bitshares-HUG-REST-API) & the in depth installation documentation, anyone can utilize the tech for whatever Bitshares project they're interested in implementing. My next Bitshares project is a [Google Assistant](https://assistant.google.com/), this will potentially expose millions of new users to Bitshares through their mobile phones, their watches (in the future) and their dedicated google home devices. It will be first launched in English, and translated into multiple languages once in a production state. ## How?  ### Bitshares HUG REST API The Bitshares HUG REST API repo provides the Bitshares network an open-source high performance interface to the Bitshares network through simple GET requests. We will be interacting with the HUG REST API server directly using NodeJS hosted on Firebase Cloud Functions (see below). #### Pricing For each 1 CPU, we can get between 2-4 workers to interact with NodeJS function calls, so each CPU should serve approx 10-15 Google Assistant users. I currently use Vultr which has reasonable pricing for VPS, I'm currently paying $10/month for a single core VPS to host the HUG server. --- <center></center> ### Oxarbitrage's "[BPAB - Bitshares Python Api Backend](https://github.com/oxarbitrage/bitshares-python-api-backend)" My Bitshares HUG REST API does not provide some of the more advanced functionality than that which Oxarbitrage's "BPAB - Bitshares Python Api Backend" provides. In the future, I'll investigate original (non copy/pasted) HUG implementation, however for the short term I will likely utilize this API for the following functions: * [Top Proxies](http://23.94.69.140:5000/top_proxies) * [Top Markets](http://23.94.69.140:5000/top_markets) * [Top Smartcoins](http://23.94.69.140:5000/top_smartcoins) * [Top UIAs](http://23.94.69.140:5000/top_uias) * [Get most active markets](http://23.94.69.140:5000/get_most_active_markets) ---  ### Dialogflow I'll be utilizing [Dialogflow](https://dialogflow.com/) (formerly API.AI, bought by Google in 2017) to handle the interpretation of user input, producing rich entities (for the fees & about section for now, perhaps assets later) and to build the intent functionality/logic which is effectively the skeleton of the Google Assistant. With Dialogflow, you create an intent and provide it 'User says' information such as "Show me the current USD:BTS orderbooks" and Dialogflow will detect which intent to trigger (the orderbook intent), as well as extract the trading pair (USD:BTS in this case) for providing as input to NodeJS (and subsequently the HUG REST API). What I find most difficult about using DialogFlow currently is that users don't have to follow set out paths through the bot, they can trigger any area of the bot (unless certain steps are mandatory) so you need to account for the user being in one area of the bot's functionality then jumping to another area without bringing along historical data from the previous intent/function which could glitch the operation of the bot unexpectedly. You have to program defensively against this issue whenever expecting input from the user. For the first version of the bot, once the user is provided information they will be force-quit out of the bot (using app.tell()) rather than asking them what they want to do next. The reason for this is that when you ask (app.ask()) what they want to do next, you need to provide a fallback intent (if they provide invalid user input, re-prompting as error handling) for each intent (at the moment there's approx 28 such intent functions) so their coding right now would be throwing thousands of lines of template code in without real functionality - so it's on the back burner for now! Pricing: FREE! Repo link: [BeyondBitshares-Dialogflow](https://github.com/BTS-CM/BeyondBitshares-Dialogflow) ---  ### Firebase I'll be utilizing [Firebase's cloud function hosting](https://firebase.google.com/products/functions/) to provide Dialogflow the webhook fullfilment required to communicate with once the user has triggered intents through the Google Assistant application/device. Code hosted on the Firebase cloud function platform is programmed in [NodeJS](https://nodejs.org/en/), it's not too difficult to be honest, difficulties arise in the lack of complete documentation (likely to be fixed by Google & its community) and the fact that we'll we working with a single huge NodeJS script (instead of many files). With the current template code in place (only about 10% complete the current functionality), the line count is already over 2000 lines so it'll probably end up 4000 lines before we start throwing in additional language support. #### Pricing Since we're going to be interacting with the Bitshares HUG REST API (an external networked service), we cannot use Firebase's free tier (only allows external networking to Google services). The cheaper option for now is to pick the 'Blaze Plan'.  Repo link: [BeyondBitshares-Firebase](https://github.com/BTS-CM/BeyondBitshares-Firebase) ## License? I've open sourced this entire project using the MIT license (both the [Dialogflow](https://github.com/BTS-CM/BeyondBitshares-Dialogflow) and the [NodeJS web fulfillment](https://github.com/BTS-CM/BeyondBitshares-Firebase) code components). The HUG REST API code is already MIT licensed on GitHub. With this project anyone will be able to fork and run their own clone of the Beyond Bitshares bot. Hopefully rather than immediately forking and competing though we'll work on the one bot together :) ## TODO * Potentially update HUG REST API to include 'success' fields when everything went well, we're already checking for this in the Firebase code. * Work on each of the intent's functions, interacting with the data retrieved from HUG. This is probably the largest area of work right now. * Work on each intent's "User says" sections, including the handling of parameters (Account, Asset, Worker, Committee member, etc..). * Move from App.Tell() (force quitting after fulfilling user request) to App.Ask() to continue the user's interaction with the bot. * This will require providing each intent with a fallback intent, probably a thousand lines of near duplicate code unless I can squish it down somehow.. * Investigate Asset entity generation, so that USD can be called by 'USD, bitUSD, united states dollar market pegged asset, USD smartcoin, etc...). ## Thoughts? I'd love to hear your thoughts about this project, anyone interested in using or helping develop this bot? Do you think this will be beneficial for the Bitshares network? What are your initial impressions of the Google Assistant compared to other bots? Do you have your own ideas for a Google Assistant bot? --- Best regards, @cm-steem
👍 cm-steem, dartistdreams, steempower, fuzzyvest, scalextrix, sarcastic.man, juliux, dylanhobalart, edgarf1979, katz, edifon, mmaf, kuldarennika, nurhasib, ivet, vortac, sanach, magicalwolf, mugsy7, spot2, steemtruth, izge, svkrulze, roboticmind, cryptotaxadvisor, da-dawn, zealicus, fedesox, breakthecrypto, darth-azrael, jkkim, steem-star, xxcynicalkidxx, unrared, daznez, bravenewcoin, profitgenerator, darth-cryptic, nsunil, sc-steemit, michaelwilshaw, kuhuiwen, etcbits, papayouns, saifkhanniaz, hope-on-fire, khalilo, joeyp978, slapbox, planet-power, mandagoi, gmsan, shawshank-steem, sandalphon, lesakesa, valdas, buffalo-soldier, fnhero, world-water-bank, judyhopps, contentguy, perperokk30, kallamrameshbabu, jaibaru, nthon, kayros, hashash, sweetnitrick, cryptonewb, onceuponatime, colinmac99ca, lahvista, kemila, mkesnchz041179, bue, glitterfart, outwalking, muhammadalfatih, vaidas, fernandezgeoff, bulek, abir20129, windyphagta, woeer333, zpzn, cryptorise, hesaa, volatile-brainz, lovelyworld, mrsteeleyogirl, jondahl, cancep, tombstone, aayalac22, razali1, achy, hassansharif, gregan, simivalleyjeff53, nameofname, jesus1507, destroy, ranadildarahmad, vadan1234, deepreddy, artusninga, princeyk, jacoboram, tahirmahmood, team101, thebeachedwhale, rulima, kokys, lonestar-1978, tradev, meyzwarsoon, shaifullah, sandra, sauna, tellmevaldo, gokselle, helo, honeythief, fitbit, amid.bhujel, cmorton, hogu, linkonsaha31, abdeladim, dronesecrets, riky, zulkyg, godlikehumans, tsugimoto, lukasmining, andrewfowler108, quantumphoenix, ram5xtreme, ubg, physics-o-mania, vikasjaat, waygreenergrass, ubiqmak, emmali, zyalock, davidalexander, abol, michaelx, eirsanctum, mohamedyasser, marvindean, williamshenry, ajhunny, animagic, realfahd, droidsid, logan-king, themedhafod, enki, pierrebailey, xeldal, ikramfahmisy, cesarclaudio, mohdtahir121, sahifactor, alvarocela, iqbalhamdani, jumpship, mrstory, marin10, mohamed118b, shqipeet, aysunekmekci, indrajeet, freeze, taqi, malena84, themobilewriter, asjonute, asof4, psicoparedes, tosch, mimee, mmshah, krotobis, nadry, kishoremd, emran-mc2, davenumero6, zeidlitwhips, stimeet, thepajaro, sheikhmanu, dhn0411, druidcruize, danishdani, investorsutopia, chuckyfucky, o1123581321, ealbania, peeyush, salah-g, fsonline, fernandosb, leomega007, kamixi, daniham, fersik, pallavtyagi8, chrisnicola2, jacksonoskele, jhonny1, todaysrant2017, oksanakazakova, chandrarezeki, igel2017, faqiralfata, zeeshan312, heaestefany, secretcrypto, mami220, steempower-ach, jordanx2, jerol, dexter786, madeinamerica, guggerf, nooruddin, biovab-jojik, danker, dudefromsa, tanisya, highlite, calvinhu, dkt, iamai, hhakan, nirerpakhi, salah15, salah55, felix.mg1, sivakrishna9494, uldzu, ghasal, carlos-danieel, markkujantunen, mazicman, aparapid, calsone6, marksoswavey, adelin.simion, siddm96, feverforever, bs0404, achmadyani, brusd, bluescreenhorror, stuch974, twally, patelchirag, gresstyle, castofmind, fuadiemuhammad, kacpersky, myothuzar, tigas001, best-of-football, rksagar, parandox, bulkeny, m3dj0, xbinary, digitalsecurity, tisler, thescarn, hamzatheone, rwade102409, paatrick, exblade, henaff, cortes4g, pappymorreto, xaul, azizu, kaarna, mudawaly, yaratsu, sizwesihle, everyway, waqasaps, voyager7, teeegs90, arrkiin, juliewood, jj-pizzaman, fordmogul, thuhtet, farmerturkey, timmyc, raheelabbas, shrikanth, sherozekhan, rapboymeh, alamy, cryptoarun, marian0, treebear, klymacks, bishwas4, kendrick1, danlupi, vapour21, abdullahshoaib, litebritelove, uhyeok0715, stehaller, zoeyvalliant, rolandaguilar93, ozellequiamco, levent78, antoniogil, juanibra, shipper62, gopalsuthar, sobeksdiary, calligiato, gekko, imren, bliss01, michellevicreyes, jamesnumber1, chris4210, mazdhanpratama, amyehya, adikuala, steemitbird, gloeze, seikatsumkt, potomychtofun, allanloyd4, metalwolf, milovancevic, ilinmad, titusfrost, upsidedownguy, andrius1, session101, iwod, agan, powellwoods, teragani, nur59, abc.love.steemit, coochya, uimahal7, gut117, see-shrik, sicomunity, max-infeld, alexdc88, fernandorivera, jbfa, nadhora, arepa89, okgs, terseer1, noviriyanti, rulesofthemind, rickyjr, annakarenina, noviriani, flomara98, aistis, aidilf, dalexx, sajibbose, architech-solo, samether, fxtechnology, agcaapo, vermillion666, cchilds2, erwinjose, viktor08, thedon1, sonusd, royalecko, soloist, joelgonz1982, devosdevosi, auginis, demmy, saidkamal, sukru03, sikk.beat, ipman62, lubameanslove, frankremmy, abdelrahaman, shahriarseyam, koryla, jacoknoetze, atsumi, timmay4life, elzaevtimova, cmitl, dwhntx, onyi, traquino, rxhector, eliashanna, greatsam, gentlemensmafia, damdap, muhammadrijal43, cryptonomichodl, lucentbritex, captainbaxter, farmanalee, pmartynov, hard2forget, musethu, santigs, dmesquita, culgin, crypt4rch, virtualgrowth, al2ping, dosbosnivianos, andriu232, quentinus, ssophiee, steemprentice, dynobryno, mike1wealth, angelaconde, becerra18, d-stepnoy, andreicalin, cheredin, drahan, muadzis, ayinky, lewd-chaser, parraccianni, qassamed1, judasp, jix, solomonsojay, michaelfilmmaker, marcusbwalter, mkultra87f, carlosluisablan, joshuaatiemo, nikola13, soprano, rhondel, tapakba, ergiegonzaga, dafahd, izaliz24o, patys, mykdevil, marylaluna, scholargc, kenshin22, emanuellindqvist, luisribeli, siulgerardo1980, aleksandra9011, serapeion, alexis-blrb, herissafandi, olyamiles, dcherna, rccc, hoo04430, ms2crypto, eversky, khatsis, kirisena, jovanivega, enesbaba1967, spacebird89, craig-grant, murtalaa, marval10, incr3dible, egzgn26x, bogh, notregme, diogogomes, roocrew17, ifraim, dahaz159, geoffrey, losyrax, pierlave, bp9930, teslim, leoumesh, vmf, leo-87, aige1997, thepink, luoq, radagast, elplaga, dartagnan1, louismata, moviesboxoffice, moisesmcardona, zinminhtet, punkrockpara, abdullahall, ainiaziz, minhtet, sludgefeed, rodznocturne, yuxuan, mirfaner, mutahir, donkeykong9000, doggy, sookbba, aneukaceh.coffee, extazymed, eliaschess333, pepedumont, i10facts, jimenez, rubenalexander, embalsespr, preguntame, bilqis07, viktur007, yeminthu, ivargereiko, whitey420, bella.wright, mustafarazy, zayin, alputhi09, honeyletsgo, jemi, kungfury, swethu, skyatlantis, x950428, barton26, jiffythekid, aniekanbassey, thescientist, shamshad2000, lukempire, moneybags73, casberp, sensation, jrodzone, angusleung100, danibehram, aorozco, miguelrys1, sergnak, steemitboard, nageshwar0369, senteno77, trevorbmx20, legendaryjone, slydogg, endymionoriax, kinini, anklass, ifekafourlimit, robin11, jerrycrypto, benytg, googlefrueh, aggamun, crudens, silororn, mycrypteria, carverdelic, heisenberggg, frombeyond, abda, znx, cryptotrader2017, adam.right, willieweenie, karolynaz, eclairy, card1001, blacknight4, shaunmatthew, synapse, imam-nazar, elena-ge, hardenjames, zews, borislavzlatanov, resteem.bot, skornher, rohanrys, lumberjax, hitter, blnqmusic, lunahod, mod-tamichh, allaboutarts, sanif, ajihasan, kalter005, muliadi, zarkuda, harekrishana, shuji, mindfreezer, strapped, lele-venturi, jringo, suitablybored, cryptocreative, miraj467, tech-online, yayankrsafitri, breezieblack, slsbltf9, franksabbih, geeb, noblewalter, teenauk, wdsturkey, kyndyz, ppitonak, asyrifalmirza, m8586, preetisingh1993, irene21, bivar-asp, minersean, albanna, kuldeepkaul, fiskey, melaniewhite, saidrasul, styxer, youtubeshare, kiporen212, o0pepper0o, erjans, zaisal, findingbrooke23, danieelab, renijuliani, newlive, olayhemy, qazedc, afrosiab, maxse, wesleybos, jmdk1974, miny01, amal123, mmartin1, redbaron90, lmx3881, barter-economy, jzulfadli98, mawardy, rockford, bb-96, siralexf, dee-y, egyption, jlitew, genesisrugeles, jakmann, josecage, baldwinv, omarid, embat, sanarauf, taminsteem, alieone, ninjatuner, wisdoncouture, camilocv, jduarte, mamin.daud, kanchana, rajib2k5, aronlemon, inhee, mrfox, sugestiones, kaderusto1, shawnybby352, hobbok, ichidadam, sedatyildiz, maryanaro, gkdnwls000, bofess22, yousep, pasagadasudhakar, heathcarmody, cutejuhee, greatlife, stephburwell, healthwithkanwal, liamjansen, snowice, oliverschmid, thangsawmmang, mmaddall, leonardimperial, thehoneybee, fractalnode, itsragged, footballsteem, dear12, atiselsts, blumen.lila, znzmdms, dkabii, dcabee2015, evoclen, efelexy, devilcat, mairontiisler, laurent, martinkoiv, alvetiadal, just-john, liyan-yan, masykur16, yahqan, stoneboy, adun80, gandalfthewhite, ghanexs, nutela, evegorilla, kiblat, safwan71, teukurahmatakbar, peppernrino, sumsum007, tanguyjestin, redk, kinematics, s2ann, yulmarasantos, uconcasual, keva1022, nyangyi, luke-life, mwesigwajulius, tomino, miguelfiguera, cryptoexplorer7, animefanrd, angelbs23, adarsh1991, garvita, jason, reivax11, dkahonge, thediogenes, kgilhooly,