Skip to main content

The dep-light primitives library for the cjm capability ecosystem — defines the shared cross-task result DTOs (data nouns) that tool capabilities emit and task adapters, workflow cores, and the composition layer all consume, so a pure-compute tool capability depends only on its task's data noun, never on the adapter machinery.

Project description

cjm-capability-primitives

Install

pip install cjm_capability_primitives

Project Structure

nbs/
├── transcription.ipynb # Standardized result DTO for the transcription task — the data noun tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.
└── vad.ipynb           # Standardized result DTO for the voice-activity-detection task — the data noun VAD tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Total: 2 notebooks

Module Dependencies

graph LR
    transcription["transcription<br/>Transcription Result"]
    vad["vad<br/>VAD Result"]

No cross-module dependencies detected.

CLI Reference

No CLI commands found in this project.

Module Overview

Detailed documentation for each module in the project:

Transcription Result (transcription.ipynb)

Standardized result DTO for the transcription task — the data noun tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.transcription import (
    TranscriptionResult
)

Classes

@dataclass
class TranscriptionResult:
    "Standardized output for all transcription plugins."
    
    text: str  # The transcribed text
    confidence: Optional[float]  # Overall confidence (0.0 to 1.0)
    segments: Optional[List[Dict[str, Any]]]  # Timestamped segments
    metadata: Dict[str, Any] = field(...)  # Additional metadata

VAD Result (vad.ipynb)

Standardized result DTO for the voice-activity-detection task — the data noun VAD tool capabilities emit and task adapters / workflow cores consume, wire-registered so results cross the worker boundary typed.

Import

from cjm_capability_primitives.vad import (
    TimeRange,
    VADResult
)

Classes

@dataclass
class TimeRange:
    "A temporal segment within an audio source (the VAD speech/silence span)."
    
    start: float  # Start time in seconds
    end: float  # End time in seconds
    label: str = 'speech'  # Segment type (e.g. 'speech')
    confidence: Optional[float]  # Detection confidence (0.0 to 1.0)
    payload: Dict[str, Any] = field(...)  # Extra data (reserved)
    
    def to_dict(self) -> Dict[str, Any]:  # Serialized representation
        "Convert to dictionary for JSON serialization."
@dataclass
class VADResult:
    "Standardized output for voice-activity-detection capabilities."
    
    ranges: List[TimeRange]  # Detected speech segments, sorted by start
    metadata: Dict[str, Any] = field(...)  # Global VAD stats (duration, sample_rate, total_speech, ...)
    
    def from_dict(
        "Reconstruct from a wire payload, re-typing nested TimeRanges.

`ranges` holds typed `TimeRange` objects, so the substrate's typed wire
envelope (stage 2) reconstructs them host-side here rather than leaving
bare dicts (which would break attribute access like `r.start`)."

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

cjm_capability_primitives-0.0.4.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

cjm_capability_primitives-0.0.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file cjm_capability_primitives-0.0.4.tar.gz.

File metadata

File hashes

Hashes for cjm_capability_primitives-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1ff2eeb418748544dd46ffc92b4a102d6c1dfd789ccfe8a51d5255bb6c26bc8e
MD5 1baba39c9d6946aa9ad7ba2d053f3946
BLAKE2b-256 a900115bd536de8c2ac03bb055b827ad18769c66f6464e5f0a1e0a6636d270f3

See more details on using hashes here.

File details

Details for the file cjm_capability_primitives-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_capability_primitives-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 06c9abe960c8c2290353df515cb1932c69adc89d43be7fb016b5f8ce3734e812
MD5 afd49b4b2ed004df9f9ebe331c0f4594
BLAKE2b-256 2d536a5da66388eff400c2cc3544891b009d9236069a3508b0e3e689aca832a4

See more details on using hashes here.

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