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.2.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.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crayonai_stream-0.6.2.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.2.tar.gz
Algorithm Hash digest
SHA256 3d2074d2e32d45846d6aea32b3ca5e36bf5aa4125349b435a46486ab0dc59582
MD5 fb53ec4767f3810d15fd1fbc7e677811
BLAKE2b-256 e06425cc652afb359d5d5a17b89a8a813d01aeae3b813b4fabcdd42268a08778

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for crayonai_stream-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3be620afd0b3960904e0d07cfc731d6273fb01b083d5adc400e165d46ccd6fea
MD5 0efbcecce841f5c4528f95d402c14c7a
BLAKE2b-256 f79dc5c718975a72e9bdc59282f299590bf0563d4686bb20793919edf6c23eac

See more details on using hashes here.

Provenance

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