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

Uploaded Python 3

File details

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

File metadata

  • Download URL: caesura_io_core-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 ac820eaaa6e5097643bc3d9c29ac5bff09be3230f9f436c2d27168240e5f1e0d
MD5 3bf60bd50488ba761463045707a5a666
BLAKE2b-256 5ebc17622d9b34d807da7cc3ba3aef32487f5dc0a4f016edc75a8f998a149657

See more details on using hashes here.

Provenance

The following attestation bundles were made for caesura_io_core-1.0.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for caesura_io_core-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5fef10c475ef92d6af8e44a27ff9fbe5d2d53e08e81d75fd743dbb8eff6ed138
MD5 3b4a04a74b8827b09f63ae73eb45fb58
BLAKE2b-256 a66f9a98f19bf957b52abb15aff1c5d1ba58e087f6ff672dfdc4a9298656374e

See more details on using hashes here.

Provenance

The following attestation bundles were made for caesura_io_core-1.0.4-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