Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Package for implementing Dorset remote agent API

Project Description

Dorset remote agent library

This library provides components for implementing the remote agent web service API for Dorset conversational interface project.

Installation

Install using pip:

$ pip install dorset

Usage

This library handles the encoding and decoding of requests and responses from a Dorset application. This supports the creation of remote agents written in Python. Use this library with a python framework for RESTful APIs like Flask, Bottle, or Django.

The web framework will handle HTTP requests and response and this library will decode the request as an AgentRequest object and will encode an AgentResponse.

With Flask, this will look like:

app = Flask("dorset_hello")

# required endpoint for the application to test if the agent is alive
@app.route('/ping', methods=['GET'])
def ping():
    return json.dumps("pong")

# primary endpoint
@app.route('/request', methods=['POST'])
def process():
    data = request.get_json(silent=False)
    agent_request = Dorset.decode_request(data)

    print(agent_request.text)

    return Dorset.encode_response("hello, world!")
Release History

Release History

This version
History Node

0.4.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dorset-0.4.0.tar.gz (3.6 kB) Copy SHA256 Checksum SHA256 Source Feb 23, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting