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
Asyncevents: a small library to help developers perform asynchronous event handling in Python

asyncevents - Asynchronous event handling for modern Python asyncevents is a small library to help developers perform asynchronous event handling in m

Mattia 5 Aug 07, 2022
A Discord Bot - has a few commands. Built using python - Discord.py - RIP.

Discord_Bot A Discord Bot has been built here. It is capable of running a few commands. The below present screenshot should suffice in terms of explai

Manab Kumar Biswas 1 May 22, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
Uses discords api to see if a token has a valid payment method.

Discord Payment Checker Uses discords api to see if a token has a valid payment method. Report Bug · Request Feature Features Checks tokens Checks all

dropout 10 Dec 01, 2022
Telegram forwarder

Telegram Forwarder Quick Start This application using docker, docker-compose to run. So I suppose that you can install these two things. Prepare essen

10 Dec 20, 2022
Custom bot I've made to host events on my personal Discord server.

discord_events Custom bot I've made to host events on my personal Discord server. You can try the bot out in my personal server here: https://discord.

AlexFlipnote 5 Mar 16, 2022
Me and @nathanmargni did a small analysis on what are the best strategies to win more games of League of Legends.

Me and @nathanmargni did a small analysis on what are the best strategies to win more games of League of Legends.

Christian Berchtold 2 Jan 19, 2022
A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

A Telegram Filter Bot, Support Unlimited Filter. Also, The Bot can auto-filter telegram File | video

Hash Minner 3 Nov 27, 2021
iCloudPy is a simple iCloud webservices wrapper library written in Python

iCloudPy 🤟 Please star this repository if you end up using the library. It will help me continue supporting this product. 🙏 iCloudPy is a simple iCl

Mandar Patil 49 Dec 26, 2022
Start multiple bots using one script. VK RAID BOTNET

MultiRaidBotnet Start multiple bots using one script. VK RAID BOTNET Русский launcher.py - главный скрипт, запускающий весь ботнет config.py - в нём х

2 Jul 22, 2022
Easy to use API Wrapper for somerandomapi.ml.

Overview somerandomapi is an API Wrapper for some-random-api.ml Examples Asynchronous from somerandomapi import Animal import asyncio async def main

Myxi 1 Dec 31, 2021
Trust-minimized Bitcoin wallet

coldcore Trust-minimized, airgapped Bitcoin management This is experimental software. Wait for a formal release before use with real funds. A trust-mi

James O'Beirne 121 Jan 01, 2023
An automated, headless YouTube Uploader

An automated, headless YouTube Uploader Authors: Christian C., Moritz M., Luca S. Related Projects: YouTube Watcher, Twitch Compilation Creator, Neura

127 Dec 23, 2022
Name says it all/Instructions are in README file.

Discord-Webhook-Spammer Name says it all/Instructions are in README file. Setup 1. pip install discord-webhook ( In console, terminal or whatever you

Catto 1 Mar 21, 2022
A mass creator for Discord's new channel threads.

discord-thread-flooder A mass creator for Discord's new channel threads. (obv created by https://github.com/imvast) Warning: this may lag ur pc if u h

Vast 6 Nov 04, 2022
Eva Maria Bot With Python

Eva Maria Bot Features Auto Filter Manual Filter IMDB Admin Commands Broadcast Index IMDB search Inline Search Random pics ids and User info Stats, Us

Aadhi 3 Jan 06, 2022
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
Simple progressbar for discord

⚙️ DiscordProgressbar 📂 Установка | Installation pip install discordbar 📚 Документация | Documentation 📞 Связаться со мной | Сontact with me 📜 Ли

DenyS 26 Nov 30, 2022
Monitor robot of Apple Store's products, using DingTalk notification.

概述 本项目应用主要用来监测Apple Store线下直营店货源情况,主要使用Python实现。 首先感谢iPhone-Pickup-Monitor项目带来的灵感,同时有些实现也直接使用了该项目的一些代码。 本项目在iPhone-Pickup-Monitor原有功能的基础上去掉了声音通知,但添加了多

Lennon Chin 159 Dec 09, 2022
Python3 based bittrex rest api wrapper

bittrex-rest-api This open source project was created to give an understanding of the Bittrex Rest API v1.1/v3.0 in pearl language. The sample file sh

4 Nov 15, 2022