Skip to main content

Apprentice is a library for deploying and developing actions via Dialogflow and Google Cloud Functions.

Project description

Apprentice

Build Status PyPI version

Apprentice is a library for deploying and developing actions via Dialogflow and Google Cloud Functions.

Installation

pip install apprentice

Quickstart

A Google Action project will consist of two things:

  1. A Dialogflow defined action
  2. An endpoint that your Dialogflow Action can talk to.

To generate a Hello World application, you can run:

$ apprentice init

This will create a file structure:

hello_world_agent/
    main.py
    requirements.txt

main.py is the file that gcloud looks for to upload the function. It is important that the name, main.py, remains in order to use gcloud cli.

Testing

To make local development quicker, you can run a local server with

$ apprentice run

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.

Getting Started

from apprentice import Apprentice

apr = Apprentice(__name__)


@apr.route('/', methods=['POST'])
def hello_world(*args, **kwargs):
    reply = 'Hello world!'
    return apr.response(reply)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apprentice-0.2.0.tar.gz (17.9 kB view details)

Uploaded Source

File details

Details for the file apprentice-0.2.0.tar.gz.

File metadata

  • Download URL: apprentice-0.2.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for apprentice-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6f8a6a87372841b9b428f4e80ee8e45a899cab52ba046a5a6f4d0df3332bdfd0
MD5 05975d68a6408ebc744b53c83055a589
BLAKE2b-256 0cfa57dc908296e11eb9eff1229288ea393eece7ef41ab4bbe6da4f9efd65d84

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page