Skip to main content

Validate, repair, retry LLM structured output (JSON/YAML/TOML/python-literal)

Project description

arcanada-output-guard

Python sibling of @arcanada/output-guard. Mirror surface, shared golden fixtures, byte-equal parity gate.

See repository root README for full design.

Install

pip install arcanada-output-guard
# or
uv add arcanada-output-guard

Status

v0.1.0 — 15 strategies, two-pass orchestrator, pydantic + JSON-Schema adapters, guarded_generate async wrapper, batch + class API, 253 tests (including parity gate against fixtures-shared and hypothesis property tests).

Quick start

from output_guard import OutputGuard, pydantic_adapter, repair
from pydantic import BaseModel

class User(BaseModel):
    name: str
    age: int

# Functional API
result = repair('{"name": "Alice", "age": 30,}', "json", pydantic_adapter(User))
print(result.data)                # User(name='Alice', age=30)
print(result.pass_)               # "A"
print(result.strategies_applied)  # ["fix-commas"]

# Stateful API
guard = OutputGuard(schema=User)
result = guard.repair('```json\n{"name": "Bob", "age": 25}\n```')

License

MIT.

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

arcanada_output_guard-0.1.0.tar.gz (47.9 kB view details)

Uploaded Source

Built Distribution

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

arcanada_output_guard-0.1.0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file arcanada_output_guard-0.1.0.tar.gz.

File metadata

  • Download URL: arcanada_output_guard-0.1.0.tar.gz
  • Upload date:
  • Size: 47.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arcanada_output_guard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 51b6edcc3229dee2002a5dcde0bac393313060d1294edda68e72699e1d636adf
MD5 0ccb8809d27f8d73b4a4bb3f318e34a5
BLAKE2b-256 a71db7aa83f08a511e5e319bda740fc5e63e4ef68b8b4cf886b144bc42280d31

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcanada_output_guard-0.1.0.tar.gz:

Publisher: publish-pypi.yml on Arcanada-one/output-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arcanada_output_guard-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arcanada_output_guard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27a12a2cd8de91df774af64165a702108840408ba24487cef765f833f7b8a57b
MD5 f95f89a0ee87098259c47f7e4a52e8bc
BLAKE2b-256 bec20e3acbcf669316ff0e69ff9634c40b9f3a9d9207c3cd578f7121868b8a42

See more details on using hashes here.

Provenance

The following attestation bundles were made for arcanada_output_guard-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on Arcanada-one/output-guard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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