Access to the ContextCrunch Prompt Compression API from Python
Project description
ContextCrunch Python Client
Use the ContextCrunch API easily with python!
Prerequsites
- You need an API key from https://contextcrunch.com/console/keys
- Install contextcrunch with
pip install contextcrunch
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)
Built Distribution
Close
Hashes for contextcrunch-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a25e2495d7907eef9c56ecb2a2ca3adae02e598a9d1d5c84327b91d022506d98 |
|
MD5 | 78f6a8905e06cb2260b27dd435a5510e |
|
BLAKE2b-256 | 5240c88ba9e44e71057e43dbd42408e59053a7cc8b313700ff8053c4867a407d |