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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

caesura_io_core-0.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for caesura_io_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b02d4b12197c959177152f7b1cfe9ce7b855484ad10723d4f50faaffcaab8c5
MD5 0bbf30298557a7d84711d72659f47c16
BLAKE2b-256 76581fcfb9f1921d65d7ded11e44bfe82a5417626a515fad0ded4f6206bc6e4e

See more details on using hashes here.

Provenance

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