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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file contextcrunch-1.0.4.tar.gz.
File metadata
- Download URL: contextcrunch-1.0.4.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa6639e3f7c25be341a65d3a465df867e746184c53bb6bb7a8062a27c69c0b40
|
|
| MD5 |
95d24f6bf0e7d0710adbdd01d99b4092
|
|
| BLAKE2b-256 |
9fb84d75c7c309b7c5f29c5d99fe3e3da89182d43ca8a0d1d5ad99cf6875944e
|
File details
Details for the file contextcrunch-1.0.4-py3-none-any.whl.
File metadata
- Download URL: contextcrunch-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a25e2495d7907eef9c56ecb2a2ca3adae02e598a9d1d5c84327b91d022506d98
|
|
| MD5 |
78f6a8905e06cb2260b27dd435a5510e
|
|
| BLAKE2b-256 |
5240c88ba9e44e71057e43dbd42408e59053a7cc8b313700ff8053c4867a407d
|