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
Palo Alto Networks PAN-OS SDK for Python

Palo Alto Networks PAN-OS SDK for Python The PAN-OS SDK for Python (pan-os-python) is a package to help interact with Palo Alto Networks devices (incl

Palo Alto Networks 281 Dec 09, 2022
StringSessionGenerator - A Telegram bot to generate pyrogram and telethon string session

⭐️ String Session Generator ⭐️ Genrate String Session Using this bot. Made by TeamUltronX 🔥 String Session Demo Bot: Environment Variables Mandatory

TheUltronX 1 Dec 31, 2021
Template to create a telegram bot in python

Template for Telegram Bot Template to create a telegram bot in python. How to Run Set your telegram bot token as environment variable TELEGRAM_BOT_TOK

PyTopia 12 Aug 14, 2022
Freqtrade is a free and open source crypto trading bot written in Python.

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram. It contains backtesting, plotting and money man

Kazune Takeda 5 Dec 30, 2021
Quickly edit your slack posts.

Lightning Edit Quickly edit your Slack posts. Heavily inspired by @KhushrajRathod's LightningDelete. Usage: Note: Before anything, be sure to head ove

Cole Wilson 14 Nov 19, 2021
42-event-notifier - 42 Event notifier using 42API and Github Actions

42 Event Notifier 42서울 Agenda에 새로운 이벤트가 등록되면 알려드립니다! 현재는 Github Issue로 등록되므로 상단

6 May 16, 2022
DiscWrappy - A Python wrapper for the Discord bot API

DiscWrappy - A Python wrapper for the Discord bot API

Jeff Morris 4 Apr 25, 2022
Authenticate your League of legends account on riot client in a few lines of code.

lol-authenticator v1.0.0 Content index Project Setup Dependencies Project Setup Dependencies Python v3.9.6 If you don't have Python installed on your

Cássio Fontoura 5 Aug 28, 2022
An simple python script for remove rockstar account for fivem, very useful for cheating or change account for unban from an server, remember change steam account.

This tool is used for be unbanned from servers, u need disconnect the discord, use other steam account and uninstall xbox for be unbanned 100%, it only work for unban in server, not global

MiguDEV 4 Oct 10, 2022
WILSON Cloud Respwnder is a Web Interaction Logger Sending Out Notifications with the ability to serve custom content in order to appropriately respond to client-issued requests.

WILSON Cloud Respwnder What is this? WILSON Cloud Respwnder is a Web Interaction Logger Sending Out Notifications (WILSON) with the ability to serve c

48 Oct 31, 2022
Sail is a free CLI tool to deploy, manage and scale WordPress applications in the DigitalOcean cloud.

Deploy WordPress to DigitalOcean with Sail Sail is a free CLI tool to deploy, manage and scale WordPress applications in the DigitalOcean cloud. Conte

Konstantin Kovshenin 159 Dec 12, 2022
This Telegram bot is created to help monitor individual mood. Lean and mean

Mood bot This bot is created to help monitor your mood. Lean and mean. Deployment Install Docker and Docker Compose Populate .env file cp .env.dist .e

Piotr Markielau 1 Dec 05, 2021
Paid Udemy Courses with Coupons

Freedemy Paid Udemy Courses with Coupons Steps to run pip3 install -r requirements.txt python3 free-courses.py Then you can click the Enroll Link and

GOKUL A.P 23 Dec 14, 2022
Fully asynchronous trace.moe API wrapper

AioMoe Fully asynchronous trace.moe API wrapper Installation You can install the stable version from PyPI: $ pip install aiomoe Or get it from github

2 Jun 26, 2022
A python library for anti-captcha.com

AntiCaptcha A python library for anti-captcha.com Documentation for the API Requirements git Install git clone https://github.com/ShayBox/AntiCaptcha.

Shayne Hartford 3 Dec 16, 2022
Web app for spotify playlist management with last.fm integration

Music Tools Set of utility tools for Spotify and Last.fm. Built on my other libraries for Spotify (spotframework), Last.fm (fmframework) and interfaci

andy 3 Dec 14, 2022
Python functions for opentargets.org API

What is opy_Targets? Opentargets.org uses GraphQL API to explore it's content via coding. This ensemble of functions aim is to make it easy to use the

1 Jan 10, 2022
Example code for interacting with solana anchor programs - candymachine

candypy example code for interacting with solana anchor programs - candymachine THIS IS PURELY SAMPLE CODE TO FORK, MODIFY, UNDERSTAND AND INTERACT WI

dubbelosix 3 Sep 18, 2022
Pythonic wrapper for the Aladhan prayer times API.

aladhan.py is a pythonic wrapper for the Aladhan prayer times API. Installation Python 3.6 or higher is required. To Install aladhan.py with pip: pip

HETHAT 8 Aug 17, 2022
This tool helps users selecting items from the Gwennen gambling trade (based on prices of the uniques).

Gwennen Gambler This small program will check each item in the Gwennen shop (item gamble) according and show small stats according to poe.ninja. Shoul

9 Apr 10, 2022