Skip to main content

Prompt compression in Python

Project description

steno-python

Usage

The most basic usage. Call the steno.compress function on your prompt. Get back a shorter, functionally equilvalent version.

import steno

prompt = "You crossed the line. People trusted you and they died. You gotta go down."
print(steno.compress(prompt))
You crossed line. People trusted you, died. Go down.
********************************************************************************
Original text: 17 tokens
Compressed text: 13 tokens
Compression: 23.53%
Compression took 615.38 ms

Use the <literal> tag to specify content you do not want modified.

import steno
prompt = """
Yeah <literal>(You can't touch this)</literal>
Look, man <literal>(You can't touch this)</literal>
You better get hype, boy, because you know you can't <literal>(You can't touch this)</literal>
"""
print(steno.compress(prompt))
Yeah. (You can't touch this) (You can't touch this)
 Look man. (You can't touch this) You better get hype, know you.

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

steno_engine-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

steno_engine-0.1.2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file steno_engine-0.1.2.tar.gz.

File metadata

  • Download URL: steno_engine-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for steno_engine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 911117713cd90d9d50d5f0be62f279efa14a89014711aee0eff312205d5d797b
MD5 18e1be72d7a79a3b763d4161499ca7b5
BLAKE2b-256 4640210ebe7fe1ca6e0f32d7581f705e14dfae8605fa3d7b17cf5e48769cc19f

See more details on using hashes here.

File details

Details for the file steno_engine-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: steno_engine-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for steno_engine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 afd5c6364f86280bbd7299d83d24242e3b128a868afa49205df192ce57ba2a97
MD5 75a3ce02cc4220751b817a5cd116ad95
BLAKE2b-256 246faff7f7af91b23ba393cdcce9867161ea7ece912a49ef8f8d9ecc100c70e7

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