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.1.tar.gz (6.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.1-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crayonai_stream-0.6.1.tar.gz
  • Upload date:
  • Size: 6.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.1.tar.gz
Algorithm Hash digest
SHA256 c75f0c11298764dc2f6a0610751eb962da72ee1efc330809deb61c23be2ae03b
MD5 dcbba7c1834ca7a822436f02dce1d0e8
BLAKE2b-256 a6c709ac141fd1d346b08ed5e3f4e46ef9ec7708778b6782b015e7ee748f4aba

See more details on using hashes here.

Provenance

The following attestation bundles were made for crayonai_stream-0.6.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for crayonai_stream-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 94ad0f6e24e8d4f793630843e2859aff81e83fe3568c052f1b235cb8536a3175
MD5 c89dde6c6f6e0039eca02dee70df0364
BLAKE2b-256 3633d6b79a5c131a52c224905be1c58ed72756a852f948f90933acbade954c4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for crayonai_stream-0.6.1-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