This Library makes creating fulfillment for Dialogflow v2 agents with Django or Flask easy and simple
Project description
Dialogflow Fulfillment Python
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
- Simple Response
- System Intent
- Suggestions
- Link out Suggestion
- Google Assistant Signin
- Permissions
Quick Start
- Login or Create a Dialogflow Account
- Create a Dialogflow agent or import samples
- Setup your Django or Flask API
- Install this library from Pip using
pip install pydialogflow-fulfillment
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pydialogflow_fulfillment-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7fbaf37915ada1df2beabf2c764b6d12584f69bccd4eb68fbc9874ea5670f5 |
|
MD5 | 0c6522da419221146703408f6b216ff0 |
|
BLAKE2b-256 | 7c8be208d2eacf4334007c6660c3ba46ee67731ed81164c60fadba1293753267 |
Close
Hashes for pydialogflow_fulfillment-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64bad3ef373cc39d873eaa7d08ed7d384db33609e637a090ddc87b9ec7d291f6 |
|
MD5 | 11d0991081415fe33ff97914dfeb5af7 |
|
BLAKE2b-256 | 5c8cf289d387c7604bcd2ae36e9da18cb1452f25d5d7011e2c2b980c0d6b9f5f |