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)
Metadata
Release files for h2o-helium 0.8.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| h2o_helium-0.8.2-py3-none-any.whl | Python 3 | none | any | Details |
Release files / h2o_helium-0.8.2-py3-none-any.whl
| Download URL | h2o_helium-0.8.2-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7190f4c6218bf17b5ffb12ae8e545d9c918556d2c409ec7be8db78da7c19b697
|
|
BLAKE2b-256 checksum How to use checksums |
519636e656a406eee09f6234af6f9d5b6133d19e8d26caf3b0c9cf99a2fafade
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.11
|