Skip to main content

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.action()
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

Metadata

Release files for apprentice 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for apprentice 0.1.7
File Size Uploaded Provenance Actions
apprentice-0.1.7.tar.gz 17.9 kB Without provenance Details for apprentice-0.1.7.tar.gz

Release files / apprentice-0.1.7.tar.gz

Download URL apprentice-0.1.7.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4c22834479e94e5f351d057e1101e8e33100392dee3b0a009cba95aeb11527d6
BLAKE2b-256 checksum
How to use checksums
332fb96771a3728dc00571bb760661b851efad42c056a4be8913e92098ed91d9
Upload date
Uploaded using Trusted Publishing?
What is 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.7.0a4+

Security for apprentice 0.1.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page