Skip to main content

Official CoffeeHouse API Wrapper for Python

Project description

CoffeeHouse API Wrapper for Python

This is a very simple API Wrapper for the CoffeeHouse API. Using This Library only supports the V1IVA2.0 API which is based from this Documentation

CoffeeHouse Python Example

Installation

pip install coffeehouse

or

python setup.py build
python setup.py install

Lydia Example

from coffeehouse.lydia import LydiaAI
from coffeehouse.api import API

# Create the CoffeeHouse API instance
coffeehouse_api = API("<API KEY>")

# Create Lydia instance
lydia = LydiaAI(coffeehouse_api)

# Create a new chat session (Like a conversation)
session = lydia.create_session()
print("Session ID: {0}".format(session.id))
print("Session Available: {0}".format(str(session.available)))
print("Session Language: {0}".format(str(session.language)))
print("Session Expires: {0}".format(str(session.expires)))

# Talk to the bot!
while True:
    output = session.think_thought(input("Input: "))
    print("Output: {0}".format(output))

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

coffeehouse-2.1.0.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

coffeehouse-2.1.0-py3.8.egg (8.9 kB view hashes)

Uploaded Source

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