Skip to main content

This Library makes creating fulfillment for Dialogflow v2 agents with Django or Flask easy and simple

Project description

Dialogflow Fulfillment Python

PyPI version

The Dialogflow Fulfillment Library allows you to connect natural language understanding and processing to your own systems, APIs, and databases. Using Fulfillment, you can surface commands and information from your services to your users through a natural conversational interface.

This Library makes creating fulfillment for Dialogflow v2 agents with Django or Flask easy and simple.

Supported Features

  1. Simple Response
  2. System Intent
  3. Suggestions
  4. Link out Suggestion
  5. Google Assistant Signin
  6. Permissions

Quick Start

  1. Login or Create a Dialogflow Account
  2. Create a Dialogflow agent or import samples
  3. Setup your Django or Flask API
  4. Install this library from Pip using pip install pydialogflow-fulfillment
  5. Go to Fulfillment > Enable Webhook > Enter the url for your API > Enable webhook for all domains

Examples

Dialogflow Request

from pydialogflow_fulfillment import DialogflowRequest

dialog_fulfillment = DialogflowRequest(request.body)

# get intent name
print(dialog_fulfillment.get_intent_name())
# get intent display name
print(dialog_fulfillment.get_intent_displayName())

# get a parameter from Google Assistant request 
print(dialog_fulfillment.get_paramter("param")) # single parameter
print(dialog_fulfillment.get_paramters()) # all parameters

Dialogflow Response

from pydialogflow_fulfillment import DialogflowResponse
from pydialogflow_fulfillment import SimpleResponse, Suggestions, SystemIntent

dialogflow_response = DialogflowResponse("This is a text response")
dialogflow_response.add(SimpleResponse("This is a simple text response","This is a simple text response"))
dialogflow_response.add(Suggestions(["Help","About","Sync"]))
dialogflow_response.add(SystemIntent("another_dialogflow_intent_name"))

dialogflow_response.add(LinkOutSuggestion("DialogFlow Website","http://dialogflow.com"))

dialogflow_response.expect_user_response = False

print(dialogflow_response)

Google Assistant Signin

dialogflow_response = DialogflowResponse("PLACEHOLDER_FOR_SIGN_IN")
dialogflow_response.add(AskForSignin())

print(dialogflow_response)

Permissions

dialogflow_response = DialogflowResponse("PLACEHOLDER_FOR_PERMISSION")
dialogflow_response.add(AskPermission(["DEVICE_PRECISE_LOCATION","NAME"],"To just know better"))

print(dialogflow_response)

License

See LICENSE.md.

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

pydialogflow_fulfillment-0.0.3.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

pydialogflow_fulfillment-0.0.3-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

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