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
A twitter bot that simply replies with a beautiful screenshot of the tweet, powered by beautify.dhravya.dev

Poet this! Replies with a beautiful screenshot of the tweet, powered by poet.so Installation git clone https://github.com/dhravya/poet-this.git cd po

Dhravya Shah 30 Dec 04, 2022
Basic Discord python bot

#How to Create a Discord Bot Account In order to work with the Python library and the Discord API, we must first create a Discord Bot account. Here ar

Tustus 1 Oct 13, 2021
Programmeertheorie 2022 - Team Trainspotters - RailNL

Trainspotters Vak: Programmeertheorie 2022 Gekozen case: RailNL Teamnaam: Trainspotters Studenten: Mijntje Meijer, Sam Bijhouwer, Maik Larooij To-do's

Maik Larooij 1 Jan 25, 2022
Discord bot for polls and votes including STV. Supports hiding results and is written with Discord.py

VoteBot Discord voting bot capable of standard polls, as found in many other bots; anonymous polls, where votes are hidden and totals are only display

6 Nov 15, 2022
CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

CryptoApp - Python code to pull wallet balances from a variety of different chains through nothing other than your public key.

Zach Frank 4 Dec 13, 2022
THERE IS AN IMPOSTER AMONG US. VOTE HIM OUT BEFORE HE [ R E D A C T E D ].

🛡️ Guardian There is an impostor among us. Can you help us find out who it is? ⚙️ Installation and Usage Make sure to install Tesseract-OCR before ru

Catus Magnus 1 Jan 06, 2022
A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

A GitHub Actions repo for tracking the dummies sending free money to Alex Jones + co.

Egarok 2 Jul 20, 2022
This is a tool to help people to make a bot for labelling images for machine learning projects.

labeller_images_python_telegramBOT This is a bot to help collect data for any machine learning project. It was developed using the python-telegram-bot

Diego Silveira 2 Nov 13, 2021
Plataforma para atendimento a outras empresas que necessitam de atendimento técnico.

Plataforma para atendimento a outras empresas que necessitam de atendimento técnico. É possível que os usuarios de empresas parceiras registrem solici

Kelvin Alisson Cantarino 2 Jun 29, 2022
A Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

Saumya Patel 1 Nov 29, 2021
A mood based crypto tracking application.

Crypto Bud - API A mood based crypto tracking application. The main repository is private. I am creating the API before I connect everything to the ma

Krishnasis Mandal 1 Oct 23, 2021
This software's intent is to automate all activities related to manage Axie Infinity Scholars. It is specially aimed to mangers with large scholar roasters.

Axie Scholars Utilities This software's intent is to automate all activities related to manage Scholars. It is specially aimed to mangers with large s

Ferran Marin 153 Nov 16, 2022
A python script to send sms anonymously with SMS Gateway API. Works on command line terminal.

incognito-sms-sender A python script to send sms anonymously with SMS Gateway API. Works on command line terminal. Download and run script Go to API S

ʀᴇxɪɴᴀᴢᴏʀ 1 Oct 25, 2021
TON Miner from TON-Pool.com

TON-Pool Miner Miner from TON-Pool.com

21 Nov 18, 2022
đź“… Calendar file generator for triathlonlive.tv upcoming events

Triathlon Live Calendar Calendar file generator for triathlonlive.tv upcoming events. Install Requires Python 3.9.4 and Poetry. $ poetry install Runni

Eduardo Cuducos 4 Sep 02, 2022
Trading bot rienforcement with python

Trading_bot_rienforcement System: Ubuntu 16.04 GPU (GeForce GTX 1080 Ti) Instructions: In order to run the code: Make sure to clone the stable baselin

1 Oct 22, 2021
Search all history of Chrome in terminal

Chrotry Search all history of Chrome in terminal. Demo Usages Move the Chrome history file to current directory by running move_history.sh Rename hist

Xiaoxu HU 2 Jun 13, 2022
Random Geek Jokes REST API

Geek-Jokes A RESTful API to get random geek jokes written in Flask What is the Geek-Jokes-api? The Geek Jokes RESTful API lets you fetch a random geek

Sameer Kumar 84 Dec 15, 2022
Just a simple discord bot a create for try

WAIFU MATERIAL DISCORD BOT! French ver. here HOW TO LAUNCH First, clone this rep

1 Jan 08, 2022
An API wrapper around the pythonanywhere's API.

pyaww An API wrapper around the pythonanywhere's API. The name stands for pythonanywherewrapper. 100% API coverage Most of the codebase is documented

7 Dec 11, 2022