Skip to main content

Framework-agnostic core for Caesura — analyze, inject, and credit-metering logic shared across SDK integrations.

Project description

caesura-io-core

Framework-agnostic core for Caesura — shared analyze, inject, and credit-metering logic used by all SDK integrations.

This package is not meant to be used directly. It is the shared engine consumed by:

What's inside

Module Purpose
CaesuraClient / AsyncCaesuraClient HTTP client that calls the /api/analyze endpoint
MemoryCaesuraStore In-memory conversation state with LRU + idle-time eviction
CaesuraEngine / AsyncCaesuraEngine Orchestrator: cadence checks, observe/analyze cycle, buffering, event emission
create_credit_meter Accumulates and queries credit-usage metrics
create_debug_logger Structured on_event logger for debugging
Helpers hash_message, select_active, render_analysis, render_block, build_analyze_messages
Types CaesuraConfig, CaesuraEvent, InjectConfig, SendConfig, etc.

Install

pip install caesura-io-core

Usage

Most consumers should use the framework-specific wrappers. If you're building your own integration:

from caesura_core import create_caesura_engine, select_active, render_block

engine = create_caesura_engine(CaesuraConfig(
    base_url="https://dev.caesura.io",
    # api_key auto-read from CAESURA_API_KEY if omitted
))

# 1. Observe a conversation turn
engine.observe("conversation-id", [
    AnalyzeMessage(
        speaker_role="user",
        speaker_name="Customer",
        text="I need help preparing for the next meeting",
    ),
])

# 2. Retrieve buffered recommendations
state = engine.store.get("conversation-id")
active = select_active(state, engine.config.inject, time.time() * 1000)
blocks = render_block(active, engine.config.inject)
# → blocks contains rendered recommendation text ready for injection

License

Apache-2.0

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

caesura_io_core-1.0.2.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

caesura_io_core-1.0.2-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file caesura_io_core-1.0.2.tar.gz.

File metadata

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

File hashes

Hashes for caesura_io_core-1.0.2.tar.gz
Algorithm Hash digest
SHA256 1cc3ec2e8ac6e8deb7533d282f39cd57505dc8ff2a381dd1f5feaf16518f9af3
MD5 c34e2e405d8f58177c2277be48332f09
BLAKE2b-256 e42fc2e6620c8f34e9728ae91db8a25f055136b74a5ead69f152a7a8d32cb33b

See more details on using hashes here.

Provenance

The following attestation bundles were made for caesura_io_core-1.0.2.tar.gz:

Publisher: release.yml on caesura-io/sdk-py

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

File details

Details for the file caesura_io_core-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for caesura_io_core-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6df28c896537def3f1e0259166b3e9bb272738b71501e536b192b9ce8f5fff14
MD5 dda4e9c945e4652a6070a5fcfa869fe9
BLAKE2b-256 3eb85a26dd414749ee45f2ec0942b02d52434653922a0d4545157ababd5071bc

See more details on using hashes here.

Provenance

The following attestation bundles were made for caesura_io_core-1.0.2-py3-none-any.whl:

Publisher: release.yml on caesura-io/sdk-py

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