Skip to main content

Define and operate Dialogflow Agents with a simple, code-first, approach

Project description

Intents ⛺

Documentation Status codecov HEAD version PyPI version

Intents is a Python framework to define and operate Conversational Agents with a simple, code-first approach. Intents comes with built-in support for Dialogflow ES and experimental Alexa and Snips connectors. Its main benefits are:

  • Agents are Python projects. You will develop with autocomplete, static type checking and everything you are already used to.
  • Versioning and CI. Agents can be versioned on Git, and programmatically deployed just like software.
  • Human-friendly Connectors. Intents are classes, predictions are their instances. Support can be extended beyond Dialogflow by implementing custom connectors.

A detailed view of the available features can be found in STATUS.md. Also, check out the Projects page to keep track of recent developments.

Install

pip install intents

Usage

Intents are defined like standard Python dataclasses:

@dataclass
class HelloIntent(Intent):
    """A little docstring for my Intent class"""
    user_name: Sys.Person = "Guido"
MyAgent.register(HelloIntent)

Their language resources are stored in separate YAML files:

utterances:
  - Hi! My name is $user_name{Guido}
  - Hello there, I'm $user_name{Mario}

responses:
  default:
    - text:
      - Hi $user_name
      - Hello $user_name, this is Bot!

Agents can be uploaded as Dialogflow ES projects directly from code:

df = DialogflowEsConnector('/path/to/service-account.json', MyAgent)
df.upload()  # You will find it in your Dialogflow Console

Intents will act transparently as a prediction client:

predicted = df.predict("Hi there, my name is Mario")
predicted.intent            # HelloIntent(user_name="Mario")
predicted.intent.user_name  # "Mario"
predicted.fulfillment_text  # "Hello Mario, this is Bot!"

For a complete working example, check out the included Example Agent. Also, Intents documentation is published at https://intents.readthedocs.io/ 📚

Disclaimer

This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Dialogflow. The names Dialogflow, Google, as well as related names, marks, emblems and images are registered trademarks of their respective owners.

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

intents-0.3.0.tar.gz (109.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intents-0.3.0-py3-none-any.whl (140.9 kB view details)

Uploaded Python 3

File details

Details for the file intents-0.3.0.tar.gz.

File metadata

  • Download URL: intents-0.3.0.tar.gz
  • Upload date:
  • Size: 109.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.8 Linux/5.4.0-84-generic

File hashes

Hashes for intents-0.3.0.tar.gz
Algorithm Hash digest
SHA256 711d1081819dc07ab457961e5c847cae2c7be6de4cbe1e4aa8560127fe2a2ccf
MD5 dc80464376a04b47f3776c030eba4d88
BLAKE2b-256 d1cfc50e584f1cd753a67c07d4bf523f8d45f8477ec71e8b95ce787974fe55f0

See more details on using hashes here.

File details

Details for the file intents-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: intents-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 140.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.8.8 Linux/5.4.0-84-generic

File hashes

Hashes for intents-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be417a541dff1a7738006853ecfe83b587a6724cfd51a3d8f24e2fb669df4c4c
MD5 222bc398ac36ed5c71d243e847bc3138
BLAKE2b-256 f690b702ebccf4bcf2876ba3c4c4a256602da0e7bff79aa8662de40f8f924332

See more details on using hashes here.

Supported by

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