Skip to main content

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


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

If you're not sure about the file name format, learn more about wheel file names.

h2o_helium-0.8.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file h2o_helium-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: h2o_helium-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for h2o_helium-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7190f4c6218bf17b5ffb12ae8e545d9c918556d2c409ec7be8db78da7c19b697
MD5 0c53a0c02918893a1605e57df686f379
BLAKE2b-256 519636e656a406eee09f6234af6f9d5b6133d19e8d26caf3b0c9cf99a2fafade

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