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__
Metadata
Release files for contextcrunch 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| contextcrunch-1.0.4.tar.gz | 2.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| contextcrunch-1.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.0 kB
Release files / contextcrunch-1.0.4.tar.gz
| Download URL | contextcrunch-1.0.4.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa6639e3f7c25be341a65d3a465df867e746184c53bb6bb7a8062a27c69c0b40
|
|
BLAKE2b-256 checksum How to use checksums |
9fb84d75c7c309b7c5f29c5d99fe3e3da89182d43ca8a0d1d5ad99cf6875944e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / contextcrunch-1.0.4-py3-none-any.whl
| Download URL | contextcrunch-1.0.4-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a25e2495d7907eef9c56ecb2a2ca3adae02e598a9d1d5c84327b91d022506d98
|
|
BLAKE2b-256 checksum How to use checksums |
5240c88ba9e44e71057e43dbd42408e59053a7cc8b313700ff8053c4867a407d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|