Skip to main content

Streaming utilities for CrayonAI

Project description

CrayonAI Stream

Python package for JSON Schema helpers and streaming utilities used in CrayonAI applications.

Installation

pip install crayonai_stream

Usage

JSON Schema Helpers

Convert Pydantic models to template schemas:

from crayonai_stream import pydantic_to_template_schema
from pydantic import BaseModel

class MyTemplate(BaseModel):
    name: str
    value: int

schema = pydantic_to_template_schema(MyTemplate, "my_template", "A sample template")

Create response formats with multiple templates:

from crayonai_stream import templates_to_response_format, TemplateDefinition

response_format = templates_to_response_format(
    TemplateDefinition(
        schema=MyTemplate,
        name="my_template",
        description="A sample template"
    )
)

Development

Install development dependencies:

pip install -e ".[dev]"

Run all checks (useful for CI):

make ci

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

crayonai_stream-0.6.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

crayonai_stream-0.6.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file crayonai_stream-0.6.0.tar.gz.

File metadata

  • Download URL: crayonai_stream-0.6.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for crayonai_stream-0.6.0.tar.gz
Algorithm Hash digest
SHA256 f05a5d7ff448bcd49b60438749ea4e46b80bb9abb5fd561777f649d5b1caa931
MD5 8af8804fb2c3e4c2c4f2186db4f08e1a
BLAKE2b-256 4970d4858c215ee76d92f8d75080e582876be184163d6ccd81057c4d19cbc4a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for crayonai_stream-0.6.0.tar.gz:

Publisher: publish-pypi-package.yml on thesysdev/crayon

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

File details

Details for the file crayonai_stream-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crayonai_stream-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1ef687355c248e7b5bf59c7e15802d6222a01914c260650c6533b10cf06f13
MD5 65d3dc931b2a686f49efabc452448bad
BLAKE2b-256 84e5ffe0211fad1f9b4936c2d4de5fd9c8316a111967b3ea580146e9042a4769

See more details on using hashes here.

Provenance

The following attestation bundles were made for crayonai_stream-0.6.0-py3-none-any.whl:

Publisher: publish-pypi-package.yml on thesysdev/crayon

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