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

Uploaded Python 3

File details

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

File metadata

  • Download URL: caesura_io_core-1.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6eadaacd53f4c93d9502d44baf6a80e1e831f06905f07dcbf160ede4c5231eb4
MD5 27ceb3a0c92944372d12aa970520c15d
BLAKE2b-256 5ca532ce7c208cb48cf14ef8ffc8b52a05efebb6a83472cc3e7df71ae6bd5997

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for caesura_io_core-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 87b6a15c151772e5fef72b81d383c285d2a447f8719fdeea447e6c5694312eb4
MD5 7b50789d5e18131485180ee203d02a6b
BLAKE2b-256 bd3088a8b41c55a883be3cb793ac5aa8257a713b023d3c8ac11036c6bee61ef7

See more details on using hashes here.

Provenance

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