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 CoffeeHouse API which is based from this Documentation

Installation

pip install coffeehouse

or

python setup.py build
python setup.py install

Lydia Example

from coffeehouse.lydia import LydiaAI

# Create the CoffeeHouse API instance
api_key = input("API Key: ")

# Create Lydia instance
lydia = LydiaAI(api_key)

# 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))

# In the case you want to save the Session ID to reuse the session
# Use lydia to invoke think_thought instead, for example;
#
# while(True):
#     output = lydia.think_thought(session.id, input("Input: "))
#     print("Output: {0}".format(output))
#
# This is the same effect as above but uses the lydia instance directly.

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.2.6.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file coffeehouse-2.2.6.tar.gz.

File metadata

  • Download URL: coffeehouse-2.2.6.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.6.9

File hashes

Hashes for coffeehouse-2.2.6.tar.gz
Algorithm Hash digest
SHA256 0ca94a060fc2b8695706f2468774058bc4e2562a2d193fb75bd359822310d10e
MD5 c7606a7db7a29b0d7d17520537f99aee
BLAKE2b-256 506b397f7d834280ef665f688c934ac913547fd91696fede6ed2f4b73c23d951

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