项目作者: andrewgy8

项目描述 :
Built for streamlining development of Google Assistant Actions
高级语言: Python
项目地址: git://github.com/andrewgy8/apprentice.git
创建时间: 2018-11-16T22:03:18Z
项目社区:https://github.com/andrewgy8/apprentice

开源协议:GNU General Public License v3.0

下载


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

  1. pip install apprentice

Quickstart

We recommend you read the full tutorial @andrew_32881/hey-google-talk-to-24dfd336acd">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:

  1. $ apprentice init

This will create a file structure:

  1. src/
  2. main.py
  3. requirements.txt

Run a local server with

  1. $ 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
@andrew_32881/hey-google-talk-to-24dfd336acd">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.

  1. $ 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