Metadata-Version: 2.4
Name: livekit-plugins-munsit
Version: 0.4.0
Summary: LiveKit Agents plugin for Munsit voice AI: Arabic speech-to-text (batch + live streaming) and text-to-speech. Consolidates livekit-plugins-faseeh.
Project-URL: Homepage, https://github.com/CNTXTFZCO0/livekit-plugins-munsit
Project-URL: Documentation, https://github.com/CNTXTFZCO0/livekit-plugins-munsit#readme
Project-URL: Repository, https://github.com/CNTXTFZCO0/livekit-plugins-munsit
Project-URL: Bug Tracker, https://github.com/CNTXTFZCO0/livekit-plugins-munsit/issues
Project-URL: Munsit, https://munsit.com
Author-email: Mohan Raj Palanisamy <mohanraj.palanisamy@cntxt.tech>
Maintainer-email: Mohan Raj Palanisamy <mohanraj.palanisamy@cntxt.tech>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: ai,arabic,audio,faseeh,livekit,munsit,realtime,speech-to-text,stt,voice
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: livekit-agents[codecs]>=1.4.4
Requires-Dist: numpy>=1.26
Description-Content-Type: text/markdown

# livekit-plugins-munsit

[LiveKit Agents](https://docs.livekit.io/agents/) plugin for **Munsit** voice AI:
Arabic speech-to-text (batch and live streaming) and Arabic text-to-speech.

> This package consolidates the former `livekit-plugins-faseeh` (TTS) — that name now
> ships a deprecation shim that installs this package.

## Installation

```bash
pip install livekit-plugins-munsit
```

Set your API key (from the [Munsit dashboard](https://app.munsit.com/en/api-keys)):

```bash
export MUNSIT_API_KEY=your-key
```

## Speech-to-Text

```python
from livekit.agents import AgentSession
from livekit.plugins import munsit, silero

session = AgentSession(
    stt=munsit.STT(mode="streaming"),   # live transcription over WS /api/v1/listen
    vad=silero.VAD.load(),
)
```

Two modes:

| | `mode="streaming"` (default) | `mode="batch"` |
|---|---|---|
| Transport | `WS /api/v1/listen` | `POST /api/v1/audio/transcribe` |
| Interim results | yes (`INTERIM_TRANSCRIPT`) | no |
| Turn detection | server-side (endpointing + semantic smart-turn) | client energy VAD |
| Word timestamps + confidence | yes, on finals | yes |
| Models | `munsit`, `munsit-en-ar` (default) | `munsit`, `munsit-en-ar` (default) |

Streaming options:

```python
munsit.STT(
    mode="streaming",
    endpointing_ms=800,          # silence that ends a turn (100–5000; retunable live)
    smart_turn=True,             # semantic end-of-turn gating
    hotwords=["فرحان", "تطبيق منصت"],   # custom vocabulary (≤200 entries, ≤40 chars)
    interim_results=True,
    correlation_id="call-1234",
    on_enrichment=lambda ev: print(ev),  # per-turn Sentiment / Gender events
)
```

Batch extras: `hotwords=[...]` and `return_confidence=True` (per-word confidence on
timestamps). `hotwords` only bias the Arabic `munsit` model — with `munsit-en-ar`
(the default) they are ignored with a warning, in both modes.

## Text-to-Speech

```python
from livekit.plugins import munsit

tts = munsit.TTS(
    voice_id="ar-hijazi-female-1",
    model="faseeh-v1-preview",
)
```

`MUNSIT_API_KEY` is used for both engines (the legacy `FASEEH_API_KEY` env var still works
for TTS).

## Documentation

Full API reference: https://docs.munsit.com — see *Speech-to-Text Streaming* for the
`/api/v1/listen` protocol (events, close codes, billing).

## Development

```bash
uv sync
uv run pytest tests/ -k "not Integration"   # offline suite (fake server)
MUNSIT_API_KEY=... uv run pytest tests/     # includes live integration tests
```

## License

Apache-2.0
