Release Fulfil.IO Inc.

Similar documents
Roman Numeral Converter Documentation

Python wrapper for Viscosity.app Documentation

Python Project Example Documentation

Aircrack-ng python bindings Documentation

TPS Documentation. Release Thomas Roten

Python simple arp table reader Documentation

chatterbot-weather Documentation

I2C LCD Documentation

PyCRC Documentation. Release 1.0

Simple libtorrent streaming module Documentation

sainsmart Documentation

django-idioticon Documentation

Release Nicholas A. Del Grosso

DNS Zone Test Documentation

google-search Documentation

Poulpe Documentation. Release Edouard Klein

Python Schema Generator Documentation

Django Wordpress API Documentation

django-reinhardt Documentation

django-cas Documentation

Redis Timeseries Documentation

Simple Binary Search Tree Documentation

Pykemon Documentation

Google Domain Shared Contacts Client Documentation

smartfilesorter Documentation

OpenUpgrade Library Documentation

Game Server Manager Documentation

gunny Documentation Release David Blewett

Python State Machine Documentation

pydrill Documentation

Frontier Documentation

dj-libcloud Documentation

Python AutoTask Web Services Documentation

Mantis STIX Importer Documentation

django-users2 Documentation

Python AMT Tools Documentation

eventbrite-sdk-python Documentation

doconv Documentation Release Jacob Mourelos

e24paymentpipe Documentation

django CMS Export Objects Documentation

withenv Documentation

AnyDo API Python Documentation

Poetaster. Release 0.1.1

yardstick Documentation

django-telegram-bot Documentation

pyldavis Documentation

Release Ralph Offinger

Python State Machine Documentation

open-helpdesk Documentation

API Wrapper Documentation

django-private-chat Documentation

smsghussd Documentation

Aldryn Installer Documentation

gpib-ctypes Documentation

PyCon APAC 2014 Documentation

Python data pipelines similar to R Documentation

django-responsive2 Documentation

Job Submitter Documentation

ejpiaj Documentation Release Marek Wywiał

dicompyler-core Documentation

xmodels Documentation

dublincore Documentation

xmljson Documentation

PyZillow Documentation

django-stored-messages Documentation

syslog-ng Apache Kafka destination

Airoscript-ng Documentation

nacelle Documentation

Python Finite State Machine. Release 0.1.5

django-composite-foreignkey Documentation

lazy-object-proxy Release 1.3.1

Connexion Sqlalchemy Utils Documentation

Gearthonic Documentation

Dragon Mapper Documentation

pvl Documentation Release William Trevor Olson

ProxySQL Tools Documentation

CID Documentation. Release Francis Reyes

django-bootstrap3 Documentation

django-composite-foreignkey Documentation

Microlab Instruments Documentation

Durga Documentation. Release dev2. transcode

Release Manu Phatak

cwmon-mysql Release 0.5.0

invenio-groups Documentation

Infoblox Client Documentation

pytest-benchmark Release 2.5.0

invenio-formatter Documentation

OTX to MISP. Release 1.4.2

Archan. Release 2.0.1

MT940 Documentation. Release Rick van Hattem (wolph)

Regressors Documentation

Face Recognition Documentation

otree Virtual Machine Manager Documentation

python-hologram-api Documentation

redis-lock Release 3.2.0

django mail admin Documentation

mlpy Documentation Release Astrid Jackson

ouimeaux Documentation

timegate Documentation

Lazarus Documentation

Transcription:

api a idocumentation Release 0.1.0 Fulfil.IO Inc. July 29, 2016

Contents 1 api_ai 3 1.1 Features.................................................. 3 1.2 Installation................................................ 3 1.3 Quickstart................................................ 3 1.4 Credits.................................................. 3 2 Installation 5 3 Usage 7 3.1 Entities.................................................. 7 3.2 Intents.................................................. 8 3.3 API Reference.............................................. 8 4 Contributing 11 4.1 Types of Contributions.......................................... 11 4.2 Get Started!................................................ 12 4.3 Pull Request Guidelines......................................... 12 4.4 Tips.................................................... 13 5 Credits 15 5.1 Development Lead............................................ 15 5.2 Contributors............................................... 15 6 History 17 6.1 0.1.0 (2016-1-22)............................................. 17 7 Indices and tables 19 Python Module Index 21 i

ii

Contents: Contents 1

2 Contents

CHAPTER 1 api_ai API.ai Python client Free software: ISC license Documentation: https://apiai.readthedocs.org. 1.1 Features Make queries Create Entities Create and update Intents 1.2 Installation pip install api.ai 1.3 Quickstart from api.ai import Agent agent = Agent( '<subscription-key>', '<client-access-token>', '<developer-access-token>', ) response = agent.query("hello there") 1.4 Credits Fulfil.IO Inc This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template. 3

4 Chapter 1. api_ai

CHAPTER 2 Installation At the command line: $ easy_install api.ai Or, if you have virtualenvwrapper installed: $ mkvirtualenv api_ai $ pip install api.ai 5

6 Chapter 2. Installation

CHAPTER 3 Usage To use api_ai in a project: from api.ai import Agent Configure the agent: agent = Agent( '<subscription-key>', '<client-access-token>', '<developer-access-token>', ) Query: agent.query("hello there") 3.1 Entities List all entities: agent.entities.all() Create a new Entity: agent.entities.create( 'Languages', [ {'value': 'Python', 'synonyms': ['python', 'py']}, {'value': 'Golang', 'synonyms': ['go', 'google go language']}, ] ) Update an entity with new entries: agent.entities.update( 'entity-id-uuid', [ {'value': 'Python', 'synonyms': ['python', 'py']}, {'value': 'Golang', 'synonyms': ['go', 'google go language']}, ], ) 7

3.2 Intents List all intents: agent.intents.all() Create a new Intent: agent.intents.create( 'name', 'templates': [ "Who am I?" ] ) 3.3 API Reference class api.ai.agent(sub_key, client_token, dev_token, session=none, timezone=none) Agent interface for an API.AI agent entities Return an entities handler object intents Return an intents handler object query(query, confidence=none, lang= en, contexts=none, resetcontexts=false, entities=none, timezone=none, session=none) Use when you want to make a single query. For multiple queries use multi_query (TODO) Parameters query The natural language text to be processed. confidence The confidence of the corresponding query parameter having been correctly recognized by a speech recognition system. 0 represents no confidence and 1 represents the highest confidence. class api.ai.entities(client) An entity is a data type that contains mappings between a set of synonyms all() return all the records in the endpoint create(name, entries) Create a new entity with the name Parameters name Name of the entity entries List of dictionaries agent.entities.create( 'EntityName', [{ "value": "Coffee Maker", "synonyms": ["coffee maker", "coffee machine"] 8 Chapter 3. Usage

) }, { "value": "Thermostat", "synonyms": ["Thermostat", "heat", "air conditioning"] }, { "value": "Lights", "synonyms": ["lights", "light", "lamps"] }, { "value": "Garage door", "synonyms": ["garage door", "garage"] }] update(entity_id, entries, name=none) Update an existing entity class api.ai.intents(client) Intents convert a number of user expressions or patterns into an action. all() return all the records in the endpoint create(name, contexts=none, templates=none, responses=none) For explanation of the params read: https://docs.api.ai/docs/intents#intent-object 3.3. API Reference 9

10 Chapter 3. Usage

CHAPTER 4 Contributing Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways: 4.1 Types of Contributions 4.1.1 Report Bugs Report bugs at https://github.com/fulfilio/api_ai/issues. If you are reporting a bug, please include: Your operating system name and version. Any details about your local setup that might be helpful in troubleshooting. Detailed steps to reproduce the bug. 4.1.2 Fix Bugs Look through the GitHub issues for bugs. Anything tagged with bug is open to whoever wants to implement it. 4.1.3 Implement Features Look through the GitHub issues for features. Anything tagged with feature is open to whoever wants to implement it. 4.1.4 Write Documentation api_ai could always use more documentation, whether as part of the official api_ai docs, in docstrings, or even on the web in blog posts, articles, and such. 4.1.5 Submit Feedback The best way to send feedback is to file an issue at https://github.com/fulfilio/api_ai/issues. If you are proposing a feature: 11

Explain in detail how it would work. Keep the scope as narrow as possible, to make it easier to implement. Remember that this is a volunteer-driven project, and that contributions are welcome :) 4.2 Get Started! Ready to contribute? Here s how to set up api_ai for local development. 1. Fork the api_ai repo on GitHub. 2. Clone your fork locally: $ git clone git@github.com:your_name_here/api_ai.git 3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development: $ mkvirtualenv api_ai $ cd api_ai/ $ python setup.py develop 4. Create a branch for local development: $ git checkout -b name-of-your-bugfix-or-feature Now you can make your changes locally. 5. When you re done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox: $ flake8 api_ai tests $ python setup.py test $ tox To get flake8 and tox, just pip install them into your virtualenv. 6. Commit your changes and push your branch to GitHub: $ git add. $ git commit -m "Your detailed description of your changes." $ git push origin name-of-your-bugfix-or-feature 7. Submit a pull request through the GitHub website. 4.3 Pull Request Guidelines Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests. 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in README.rst. 3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check https://travisci.org/fulfilio/api_ai/pull_requests and make sure that the tests pass for all supported Python versions. 12 Chapter 4. Contributing

4.4 Tips To run a subset of tests: $ python -m unittest tests.test_api_ai 4.4. Tips 13

14 Chapter 4. Contributing

CHAPTER 5 Credits 5.1 Development Lead Fulfil.IO Inc. <hello@fulfil.io> 5.2 Contributors None yet. Why not be the first? 15

16 Chapter 5. Credits

CHAPTER 6 History 6.1 0.1.0 (2016-1-22) First release on PyPI. 17

18 Chapter 6. History

CHAPTER 7 Indices and tables genindex modindex search 19

20 Chapter 7. Indices and tables

Python Module Index a api.ai, 8 21

22 Python Module Index

Index A Agent (class in api.ai), 8 all() (api.ai.entities method), 8 all() (api.ai.intents method), 9 api.ai (module), 8 C create() (api.ai.entities method), 8 create() (api.ai.intents method), 9 E entities (api.ai.agent attribute), 8 Entities (class in api.ai), 8 I intents (api.ai.agent attribute), 8 Intents (class in api.ai), 9 Q query() (api.ai.agent method), 8 U update() (api.ai.entities method), 9 23