Build Interactive Apps with Google Assistant: Challenge Lab

Photo by BENCE BOROS on Unsplash

Challenge scenario

Your challenge

import random
import logging
from import translate_v2 as translate
from flask import Flask, request, make_response, jsonify

def magic_eight_ball(request):

client =

choices = [
"It is certain.", "It is decidedly so.", "Without a doubt.",
"Yes - definitely.", "You may rely on it.", "As I see it, yes.",
"Most likely.", "Outlook good.", "Yes.","Signs point to yes.",
"Reply hazy, try again.", "Ask again later.",
"Better not tell you now.", "Cannot predict now.",
"Concentrate and ask again.", "Don't count on it.",
"My reply is no.", "My sources say no.", "Outlook not so good.",
"Very doubtful."

magic_eight_ball_response = random.choice(choices)

return make_response(jsonify({'fulfillmentText': magic_eight_ball_response }))

Task 2: Create the Lab Magic 8 Ball app for Google Assistant

Build an Action

Test your Assistant application with the Actions simulator

Reach out to me at