Client library for H2O Helium
Project description
H2O Helium Python Client
Install
pip install h2o-helium
Usage
from h2o_helium import Helium
helium = Helium(address='https://helium.h2o.ai', api_key='sk-xxxxxx')
# Create a new collection
collection_id = helium.create_collection(name='Contracts', description='Paper clip supply contracts')
# Upload documents
with open('/path/to/dunder_mifflin.pdf', 'rb') as f:
dunder_mifflin = helium.upload('Dunder Mifflin.pdf', f)
with open('/path/to/wernham_hogg.pdf', 'rb') as f:
initech = helium.upload('Wernham Hogg.pdf', f)
# Ingest documents
helium.ingest_uploads(collection_id, [dunder_mifflin, initech])
# Create a chat session
chat_session_id = helium.create_chat_session(collection_id)
# Query the collection
with helium.connect(chat_session_id) as session:
reply = session.query('How many paper clips were shipped to Scranton?', timeout=10)
print(reply.content)
reply = session.query('Did David Brent co-sign the contract with Initech?', timeout=10)
print(reply.content)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for h2o_helium-0.7.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cba9624c2285974106c88ed2bfef31c4eb7db3076f39a18f4645b103848108c |
|
MD5 | a4d1de37c132ac110cf47840a60cfe36 |
|
BLAKE2b-256 | 38b8220ebe68f14a7b336d47e16ba065a26d04365c633206b1211d3f5ee85272 |