Built for streamlining development of Google Assistant Actions

Overview

rocket ship

Apprentice

Build Status PyPI version

Apprentice is a framework built for developing Google Actions via Dialogflow and Google Cloud (serverless) Functions.

Includes:

  • plug-and-play feel to get going quickly
  • basic Dialogflow API 2.0 response handling
  • local setup for quick iteration

Installation

pip install apprentice

Quickstart

We recommend you read the full tutorial here.

A Google Action project will consist of two things:

  1. Dialogflow Intent
  2. A webhook to satisfy your users intent

To generate a "Hello World" webhook, run:

$ apprentice init

This will create a file structure:

src/
    main.py
    requirements.txt

Run a local server with

$ apprentice run

and expose to localhost port via an https tunnel. Then add the url to the fulfillment webhook in Dialogflow.

For a more indepth example please see the tutorial I wrote here.

Deployment

Note

gcloud cli must be installed and authorized for the following command to work. If you wish to not have gcloud cli installed, you can copy the file contents via the gcloud function dashboard.

$ apprentice -f hello_world -s hello_world_agent -e hello_world

This will generate the command to execute a gcloud function deploy via the cli.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU 3.0

Comments
  • Increase the usability of the Apprentice API

    Increase the usability of the Apprentice API

    This is what I could imagine the API for Apprentice looking like:

    
    from apprentice import Apprentice
    
    apr = Apprentice(__name__)
    
    ENTITIES = {
        "name": "History",
        "entries": [
            {
                "value": "history",
                "synonyms": [
                    "history",
                    "past event",
                    "the past",
                    "past"
                ]
            }, {
                "value": "birth",
                "synonyms": [
                    "birth",
                    "births",
                    "born"
                ]
            }
        ]
    }
    
    
    @apr.action(entities=['name'])
    def cool_fact_generator(*args, **kwargs):
        reply = _fact_response(apr.entity)
        return apr.make_repsonse(reply)
    
    opened by andrewgy8 1
  • Add suggestions

    Add suggestions

    When creating a response a user should be able to configure the view of suggestions.

    The resulting payload would look like:

    'payload': {
                    'google': {
                        'expect_user_response': False,
                        'is_ssml': True,
                        'permissions_request': None,
                        "richResponse": {
                            "items": [],
                            "suggestions": [],
                            "linkOutSuggestion": {}
                        }
                    }
                }
    
    opened by andrewgy8 0
  • .env with the Flask App path

    .env with the Flask App path

    For the local server to work as plug-and-play, it would be nice to have .env file that is read as a default to the installed main.py flask app. That way a user could execute:

    1. apprentice init
    2. apprentice run

    And have the local server running immediately.

    opened by andrewgy8 0
  • Fix triplicate deployment issue

    Fix triplicate deployment issue

    It seems that travis is trying to deploy the package with every version of python declared. For instance, https://travis-ci.com/andrewgy8/apprentice/builds/93792889

    The build succeeds with 3.7, but with 3.6 and 3.5, it fails. It shouldn't be deploying with all the python versions, only one.

    opened by andrewgy8 0
  • Allow user to define init directory name and function name

    Allow user to define init directory name and function name

    Be able to handle and argument such as:

    apprentice init --name=foo_bar

    and the output should be a direct called /foo_bar with a main.py file containing a foo_bar function.

    enhancement 
    opened by andrewgy8 0
Releases(v0.4.4)
Owner
Andrew Graham-Yooll
Software engineer with background in molecular biology
Andrew Graham-Yooll
Analyzed the data of VISA applicants to build a predictive model to facilitate the process of VISA approvals.

Analyzed the data of Visa applicants, built a predictive model to facilitate the process of visa approvals, and based on important factors that significantly influence the Visa status recommended a s

Jesus 1 Jan 08, 2022
Univerity-student oriented (lithuanian) discord bot

Univerity-student oriented (lithuanian) discord bot

3 Nov 30, 2021
Leveraged grid-trading bot using CCXT/CCXT Pro library in FTX exchange.

Leveraged-grid-trading-bot The code is designed to perform infinity grid trading strategy in FTX exchange. The basic trader named Gridtrader.py contro

Hao-Liang Wen 25 Oct 07, 2021
A Wide AOI tool for discord.

drkdiscord - drk#1337 A Wide AOI tool for discord. Installation To Install you have to have python 3.x and pip installed on your system. If you have t

Darkest Surface 6 Dec 17, 2022
Coronavirus whatsapp chatbot to give real time info on covid

Covy Developed a coronavirus whatsapp chatbot which gives case counts in a particular district, city, state or country. It also predicts future cases

Devinco (Rachit) 0 Oct 03, 2021
A Python interface to AFL, allowing for easy injection of testcases and other functionality.

Fuzzer This module provides a Python wrapper for interacting with AFL (American Fuzzy Lop: http://lcamtuf.coredump.cx/afl/). It supports starting an A

Shellphish 614 Dec 26, 2022
discord bot made in discord.py

udeline discord bot made in discord.py, which's main features include: general use server moderation fun commands other cool commands dependencies dis

1 Feb 08, 2022
A Python module for communicating with the Twilio API and generating TwiML.

twilio-python The default branch name for this repository has been changed to main as of 07/27/2020. Documentation The documentation for the Twilio AP

Twilio 1.6k Jan 05, 2023
Azure free vpn for students only! (Self hosted/No sketchy services/Fast and free)

Azpn-Azure-Free-VPN Azure free vpn for students only! (Self hosted/No sketchy services/Fast and free) This is an alternative secure way of accessing f

Harishankar Kumar 6 Mar 19, 2022
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run First add src to PYTHONPATH: export PYTHONPATH=${PWD} Then run: pyt

Ali Hejazizo 12 Dec 24, 2022
A repo to automate the booking process for vaccinations

OntarioVaccineFormAutomaker A repo to automate the booking process for vaccinations Requirements Allow ALL sights to be able to know your location (on

Rafid Dewan 7 May 31, 2021
Syrax Check User Bot Discord.py

Syrax-Check-User-Bot-Discord.py Guida Italiana il bot nasce con lo scopo di poter caricare il proprio nome utente,tag e foto profilo al forum tramite

Pippoide 0 Feb 04, 2022
szrose is an all in one group management bot made for managing your group effectively with some advance security tools & Suit For All Your Needs ❤️

szrose is an all in one group management bot made for managing your group effectively with some advance security tools & Suit For All Your Needs ❤️

szsupunma 93 Jan 07, 2023
A wrapper for slurm especially on Taiwania2 (HPC CLI)A wrapper for slurm especially on Taiwania2 (HPC CLI)

TWCC-slurm-wrapper A wrapper for slurm especially on Taiwania2 (HPC CLI). For Taiwania2 (HPC CLI) usage, please refer to here. (中文) How to Install? gi

Chi-Liang, Liu 5 Oct 07, 2022
An API wrapper for Henrik's Unofficial VALORANT API

ValorantAPI.py An API wrapper for Henrik's Unofficial VALORANT API Warning!! This project is still in beta and only contains barely anything yet. If y

Jakkaphat Chalermphanaphan 0 Feb 04, 2022
Download apps and remove icloud

Download apps and remove icloud

✨ 🐍 Python SDK for StarkNet.

✨ 🐍 starknet.py StarkNet SDK for Python 📘 Documentation Installation Quickstart Guide API Installation To install this package run pip install stark

Software Mansion 158 Jan 04, 2023
ELiza music is a telegram music bot project, allow you to play music on voice chat group telegram.

❤️ 𝗘𝗹𝗶𝘇𝗮 𝗠𝘂𝘀𝗶𝗰 ❤️ Unmaintained. The new repo of @MrsElizaRobot is private. (It is no longer based on this source code. The completely rewrit

Team Eliza 2 Dec 08, 2022
Create a roles overview page for all Ansible roles/playbooks in Gitlab

ansible-create-roles-overview Overview The script ./create_roles_overview.py queries a Gitlab API for Ansible roles and playbooks. It will iterate ove

2 Oct 11, 2021
A simple Discord Mass Dm with Scraper

Python-Mass-DM A simple Discord Mass Dm with Scraper If Member Scraper in Taliban.py doesn't work. You can DM me cuz that scraper is for tokens that g

RyanzSantos 4 Sep 02, 2022