Skip to main content

A simple package for interfacing with Dialogflow

Project description

Affability

Affability allows for an easy utilization of Google's DialogFlow for natural language understanding. It allows for calling a single function and returning the result from Dialogflow as a class containing all the pertinent data such as detected intent.

This can be utilized to understand commands and then perform the relevant tasks based from the detected intent. Affability is ultimately designed to have the ability to assist with a quadruped robot project in the future.

Dependencies

Installing using the requirements.txt file:

pip install -r requirements.txt

Installing manually:

pip install SpeechRecognition
pip install dialogflow

Usage

As a standalone file, Brain.py can be run.

Using the understand function:

The understand function contains 5 parameters: text, credentials, projectID, languageCode, and sessionID. Text is text to be analyzed, credentials is the file path of the authentication key, projectID is the project ID, languageCode is the language, and sessionID is the session ID. All parameters are strings.

understand('textToBeAnalyzed', 'filepath', 'projectIDname', 'en-US', 'me') 

The understand function returns the results as an organizer class. This class contains detectedIntent, confidence, reply, action, requiredParamsPresent, and replyParams.

class organizer:
    def __init__(self, detectedIntent, confidence, reply, action, requiredParamsPresent, replyParams):
        self.detectedIntent = detectedIntent
        self.confidence = confidence
        self.reply = reply
        self.action = action
        self.requiredParamsPresent = requiredParamsPresent
        self.replyParams = replyParams

For example, to extract and print detected intent:

reply = understand('textToBeAnalyzed', 'filepath', 'projectIDname', 'en-US', 'me') 
print(reply.detectedIntent)

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

Affability-0.0.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

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

Affability-0.0.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file Affability-0.0.1.tar.gz.

File metadata

  • Download URL: Affability-0.0.1.tar.gz
  • Upload date:
  • Size: 1.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for Affability-0.0.1.tar.gz
Algorithm Hash digest
SHA256 efb64e1bac4276676775c28c68416a99542270029eb5146406b9e4df2462bd6f
MD5 a9b8b556956895de210987e5e216defb
BLAKE2b-256 172edaf80fb51bbeb92060177df15c4498437a8c38a1477e5f980a16b3079b63

See more details on using hashes here.

File details

Details for the file Affability-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: Affability-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for Affability-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b02aca4e8e80c6324a548adeaac3bdf9e85086334240503817061b3098f5743
MD5 bf1fe871c38f7dd71fa64985aac04a7d
BLAKE2b-256 797b96447801ef26f59fbab996eaca0ced8c91907a853e99840caf59195e374e

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