Skip to main content

Access to the ContextCrunch Prompt Compression API from Python

Project description

ContextCrunch Python Client

Use the ContextCrunch API easily with python!

Prerequsites

Quick Start

from contextcrunch import ContextCrunchClient
client = ContextCrunchClient('API_KEY_HERE')

compressed = client.compress(
  context=['compress this text'],
  prompt='last message',
  compression_ratio=0.95
)
print(f'Although this text is too short to compress, we can see the API works! {compressed}')

Uploading to PyPi

python3 -m build
python3 -m twine upload dist/*

Username: __token__

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

contextcrunch-1.0.4.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

contextcrunch-1.0.4-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

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