Skip to main content

Tiny wrapper exposing Prompture helpers to convert LLM output into TOON.

Project description

llm-to-toon

Tiny wrapper around prompture that returns TOON (Token-Oriented Object Notation) instead of JSON. Under the hood it uses prompture.extract_and_jsonify(..., output_format="toon") and converts the result into the ultra-compact TOON text automatically.

Install:

pip install llm-to-toon

Usage:

from llm_to_toon import from_llm_text

schema = {"name": "string", "age": "int"}
toon_text = from_llm_text("Name: Juan Age: 30", schema)
print(toon_text)

By default the helper spins up the local Ollama driver (gemma:latest). Pass your own Prompture driver if you want to call OpenAI, Azure, Groq, etc. For the full Prompture feature-set see the main project: https://github.com/jhd3197/prompture

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

llm_to_toon-0.0.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

llm_to_toon-0.0.0-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file llm_to_toon-0.0.0.tar.gz.

File metadata

  • Download URL: llm_to_toon-0.0.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for llm_to_toon-0.0.0.tar.gz
Algorithm Hash digest
SHA256 ecb314303763479d65c473c45601ef7d7a41f843853f4d9a4efd52719c1d3ebf
MD5 1746f72fd015574ac4da192126d18c54
BLAKE2b-256 76a403300ef58f971de423ba85d385882578b9f23609a930705f00ce921d6337

See more details on using hashes here.

File details

Details for the file llm_to_toon-0.0.0-py3-none-any.whl.

File metadata

  • Download URL: llm_to_toon-0.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for llm_to_toon-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 df9c46fa384a2e728f01a1088cddd861e4287965c7994f925a8710acd69f8a7f
MD5 1e149547931a53950f6558933134c9ee
BLAKE2b-256 ed21252f5bd59ee272f8a0662313c8c25ecd1a0fc18002c8de95d9e89e04cf16

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