pipecat-oruk 0.1.0rc1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pipecat_oruk-0.1.0rc1/.github/workflows/ci.yml +36 -0
- pipecat_oruk-0.1.0rc1/.github/workflows/publish.yml +62 -0
- pipecat_oruk-0.1.0rc1/.gitignore +6 -0
- pipecat_oruk-0.1.0rc1/CHANGELOG.md +5 -0
- pipecat_oruk-0.1.0rc1/LICENSE +21 -0
- pipecat_oruk-0.1.0rc1/PKG-INFO +150 -0
- pipecat_oruk-0.1.0rc1/README.md +127 -0
- pipecat_oruk-0.1.0rc1/docs/DEMO.md +20 -0
- pipecat_oruk-0.1.0rc1/docs/pipecat-demo.mp4 +0 -0
- pipecat_oruk-0.1.0rc1/docs/pipecat-verification.json +67 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_agent.py +223 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_browser/.gitignore +5 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_browser/README.md +37 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_browser/demo.js +201 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_browser/index.html +15 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_browser/server.py +209 -0
- pipecat_oruk-0.1.0rc1/examples/pipecat_stream_file.py +189 -0
- pipecat_oruk-0.1.0rc1/pyproject.toml +30 -0
- pipecat_oruk-0.1.0rc1/src/pipecat_oruk/__init__.py +17 -0
- pipecat_oruk-0.1.0rc1/src/pipecat_oruk/_service.py +638 -0
- pipecat_oruk-0.1.0rc1/src/pipecat_oruk/py.typed +0 -0
- pipecat_oruk-0.1.0rc1/src/pipecat_oruk/realtime.py +349 -0
- pipecat_oruk-0.1.0rc1/tests/audio/ATTRIBUTION.md +12 -0
- pipecat_oruk-0.1.0rc1/tests/audio/angry.wav +0 -0
- pipecat_oruk-0.1.0rc1/tests/conftest.py +148 -0
- pipecat_oruk-0.1.0rc1/tests/test_pipecat.py +477 -0
- pipecat_oruk-0.1.0rc1/tests/test_pipecat_examples.py +248 -0
- pipecat_oruk-0.1.0rc1/tests/test_realtime.py +182 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Verify package
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
pull_request:
|
|
5
|
+
permissions:
|
|
6
|
+
contents: read
|
|
7
|
+
jobs:
|
|
8
|
+
verify:
|
|
9
|
+
strategy:
|
|
10
|
+
fail-fast: false
|
|
11
|
+
matrix:
|
|
12
|
+
os: [ubuntu-latest]
|
|
13
|
+
python: ['3.11', '3.12', '3.13', '3.14']
|
|
14
|
+
include:
|
|
15
|
+
- os: macos-latest
|
|
16
|
+
python: '3.12'
|
|
17
|
+
- os: windows-latest
|
|
18
|
+
python: '3.12'
|
|
19
|
+
runs-on: ${{ matrix.os }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python }}
|
|
25
|
+
- name: Install framework and build dependencies
|
|
26
|
+
run: python -m pip install ".[agent,test]" "build>=1,<2" "twine>=6,<8"
|
|
27
|
+
- name: Build distributions
|
|
28
|
+
run: python -m build
|
|
29
|
+
- name: Validate distribution metadata
|
|
30
|
+
run: python -m twine check --strict dist/*
|
|
31
|
+
- name: Install built wheel
|
|
32
|
+
run: python -c "import pathlib, subprocess, sys; subprocess.check_call([sys.executable, '-m', 'pip', 'install', '--force-reinstall', '--no-deps', str(next(pathlib.Path('dist').glob('*.whl')))])"
|
|
33
|
+
- name: Test installed package
|
|
34
|
+
run: python -m pytest -q tests
|
|
35
|
+
- name: Verify environment
|
|
36
|
+
run: python -m pip check
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
name: Publish Pipecat integration
|
|
2
|
+
on:
|
|
3
|
+
workflow_dispatch:
|
|
4
|
+
permissions:
|
|
5
|
+
contents: read
|
|
6
|
+
concurrency:
|
|
7
|
+
group: publish-pipecat-oruk
|
|
8
|
+
cancel-in-progress: false
|
|
9
|
+
jobs:
|
|
10
|
+
verify:
|
|
11
|
+
if: github.ref == 'refs/heads/main'
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: '3.12'
|
|
18
|
+
- name: Install framework and build dependencies
|
|
19
|
+
run: python -m pip install ".[agent,test]" "build>=1,<2" "twine>=6,<8"
|
|
20
|
+
- name: Build reviewed version
|
|
21
|
+
run: |
|
|
22
|
+
python -c "import tomllib; assert tomllib.load(open('pyproject.toml','rb'))['project']['version'] == '0.1.0rc1'"
|
|
23
|
+
python -m build
|
|
24
|
+
python -m twine check --strict dist/*
|
|
25
|
+
python -m pip install --force-reinstall --no-deps dist/*.whl
|
|
26
|
+
python -m pytest -q tests
|
|
27
|
+
python -m pip check
|
|
28
|
+
- uses: actions/upload-artifact@v4
|
|
29
|
+
with:
|
|
30
|
+
name: reviewed-pipecat-package
|
|
31
|
+
path: dist/
|
|
32
|
+
if-no-files-found: error
|
|
33
|
+
retention-days: 7
|
|
34
|
+
publish:
|
|
35
|
+
needs: verify
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: pypi
|
|
39
|
+
url: https://pypi.org/project/pipecat-oruk/0.1.0rc1/
|
|
40
|
+
permissions:
|
|
41
|
+
id-token: write
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/download-artifact@v4
|
|
44
|
+
with:
|
|
45
|
+
name: reviewed-pipecat-package
|
|
46
|
+
path: dist/
|
|
47
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
48
|
+
with:
|
|
49
|
+
packages-dir: dist/
|
|
50
|
+
registry:
|
|
51
|
+
needs: publish
|
|
52
|
+
runs-on: ubuntu-latest
|
|
53
|
+
steps:
|
|
54
|
+
- uses: actions/checkout@v4
|
|
55
|
+
- uses: actions/setup-python@v5
|
|
56
|
+
with:
|
|
57
|
+
python-version: '3.12'
|
|
58
|
+
- name: Verify a fresh registry installation
|
|
59
|
+
run: |
|
|
60
|
+
python -m pip install 'pipecat-oruk[agent,test]==0.1.0rc1'
|
|
61
|
+
python -m pip check
|
|
62
|
+
python -m pytest -q tests
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0rc1 — unreleased
|
|
4
|
+
|
|
5
|
+
Initial Oruk-maintained streaming STT and phrase-emotion integration, with VAD/manual turns, bounded buffering, guarded retries, usage metrics, and runnable examples. Production browser verification and a recorded demonstration are included in docs/.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 oruk labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: pipecat-oruk
|
|
3
|
+
Version: 0.1.0rc1
|
|
4
|
+
Summary: Oruk streaming speech and phrase emotion for Pipecat
|
|
5
|
+
Project-URL: Homepage, https://oruk.ai
|
|
6
|
+
Project-URL: Documentation, https://oruk.ai/docs
|
|
7
|
+
Project-URL: Repository, https://github.com/Oruk-AI/pipecat-oruk
|
|
8
|
+
Project-URL: Issues, https://github.com/Oruk-AI/pipecat-oruk/issues
|
|
9
|
+
Author-email: oruk labs <access@oruk.ai>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Python: <3.15,>=3.11
|
|
13
|
+
Requires-Dist: aiohttp<4,>=3.10
|
|
14
|
+
Requires-Dist: numpy<3,>=1.26
|
|
15
|
+
Requires-Dist: pipecat-ai<1.9,>=1.8.1
|
|
16
|
+
Requires-Dist: soxr<2,>=1.0
|
|
17
|
+
Provides-Extra: agent
|
|
18
|
+
Requires-Dist: pipecat-ai[openai,runner,webrtc]<1.9,>=1.8.1; extra == 'agent'
|
|
19
|
+
Provides-Extra: test
|
|
20
|
+
Requires-Dist: pytest-asyncio<2,>=1; extra == 'test'
|
|
21
|
+
Requires-Dist: pytest<10,>=8; extra == 'test'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
<img src="https://oruk.ai/brand/kit/oruk-primary.png" alt="oruk" width="160">
|
|
25
|
+
|
|
26
|
+
# Oruk speech and phrase emotion for Pipecat
|
|
27
|
+
|
|
28
|
+
Stream speech to Oruk's realtime preview and receive interim transcripts, final text, and independent phrase-emotion estimates. This integration is developed by **oruk labs**, the company providing the API. It is community-maintained by Oruk; it is not maintained or endorsed by Pipecat.
|
|
29
|
+
|
|
30
|
+
**Release candidate.** The adapter is tested with Pipecat 1.8.1 on Python 3.11, 3.12, 3.13, and 3.14. The package accepts Pipecat 1.8.x; other patch releases require their own recorded checks. Automated tests use a simulated gateway with the real framework. A separate [production browser demonstration](https://github.com/Oruk-AI/pipecat-oruk/blob/main/docs/DEMO.md) verifies WebRTC, real transcription and phrase estimates, two consecutive turns, cancellation after an interim result, reconnection, and backend metering. This is not an accuracy benchmark or a verified LLM/TTS conversation.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
Use a Python virtual environment and pin the release candidate explicitly:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
python -m pip install 'pipecat-oruk==0.1.0rc1'
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
For the browser transport dependencies, install `pipecat-oruk[agent]==0.1.0rc1`. The examples below live in this repository; clone it to run them. To develop the adapter from a checkout, run `python -m pip install '.'` from the repository root.
|
|
41
|
+
|
|
42
|
+
Set `ORUK_API_KEY` in the server environment using a key from your Oruk developer portal. Keys are sent in an authenticated WebSocket upgrade, never in a URL or browser bundle. The distribution is named `pipecat-oruk` and uses `pipecat_oruk` imports.
|
|
43
|
+
|
|
44
|
+
## Try an audio recording
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
python examples/pipecat_stream_file.py recording.wav
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Use a mono PCM16 WAV at 8–96 kHz, up to five minutes long. Audio is sent at playback speed. The example prints JSON for interim text, final text, phrase events, and successful turn completion. It returns a nonzero exit status on failure.
|
|
51
|
+
|
|
52
|
+
Options:
|
|
53
|
+
|
|
54
|
+
- `--vad`: use Silero to split utterances; the file must be 8 or 16 kHz for this detector.
|
|
55
|
+
- `--wait-for-emotions`: include late phrase results in the final transcript's metadata.
|
|
56
|
+
- `--diarize`: request speaker labels within each Oruk turn.
|
|
57
|
+
- `--language fr`: configure a supported Oruk locale; the default is automatic recognition.
|
|
58
|
+
- `--fast`: send a saved recording without playback pacing, limited to 110 seconds.
|
|
59
|
+
|
|
60
|
+
## Try the browser speech demo
|
|
61
|
+
|
|
62
|
+
The [local browser example](https://github.com/Oruk-AI/pipecat-oruk/blob/main/examples/pipecat_browser/README.md) needs only an Oruk key. It streams the public sample through WebRTC, shows the returned estimates and receipts, and can record its own demonstration. No LLM or TTS account is required for this speech-only example. Install the agent extra shown below to include the browser transport dependencies.
|
|
63
|
+
|
|
64
|
+
## Put Oruk into a pipeline
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
|
68
|
+
from pipecat.audio.vad.vad_analyzer import VADParams
|
|
69
|
+
from pipecat.pipeline.pipeline import Pipeline
|
|
70
|
+
from pipecat.processors.audio.vad_processor import VADProcessor
|
|
71
|
+
from pipecat_oruk import OrukSTTService
|
|
72
|
+
|
|
73
|
+
vad = VADProcessor(
|
|
74
|
+
vad_analyzer=SileroVADAnalyzer(params=VADParams(start_secs=0.2, stop_secs=0.2))
|
|
75
|
+
)
|
|
76
|
+
stt = OrukSTTService(wait_for_emotions=True)
|
|
77
|
+
|
|
78
|
+
pipeline = Pipeline([
|
|
79
|
+
transport.input(),
|
|
80
|
+
vad,
|
|
81
|
+
stt,
|
|
82
|
+
user_aggregator,
|
|
83
|
+
llm,
|
|
84
|
+
tts,
|
|
85
|
+
transport.output(),
|
|
86
|
+
assistant_aggregator,
|
|
87
|
+
])
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The transport, aggregators, LLM, and TTS belong to your application. The complete [browser agent example](https://github.com/Oruk-AI/pipecat-oruk/blob/main/examples/pipecat_agent.py) assembles them. Set the pipeline's input rate to 16 kHz and avoid adding a second VAD inside the user aggregator. Oruk commits on the upstream VAD stop. Pipecat forwards audio before emitting a VAD start, so the adapter retains a bounded half-second prefix by default. Its prefix must cover the detector's start-confirmation interval plus one input chunk; an insufficient prefix is reported as an error instead of silently clipping the opening.
|
|
91
|
+
|
|
92
|
+
For externally segmented audio, use `OrukSTTService(vad=False)` and queue `OrukCommitFrame()` after the utterance. This is a system frame, ordered with incoming audio. `EndFrame` also flushes the current turn and waits for its result. An assistant `InterruptionFrame` preserves input recognition; `CancelFrame` aborts it.
|
|
93
|
+
|
|
94
|
+
## Run the browser agent
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
python -m pip install '.[agent]'
|
|
98
|
+
python examples/pipecat_agent.py --transport webrtc --host 127.0.0.1 --port 7860
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Before connecting, configure `ORUK_API_KEY`, `OPENAI_API_KEY`, `LLM_MODEL`, `TTS_MODEL`, and `TTS_VOICE` in the server environment. Choose model and voice names available to your account. The example uses Pipecat's OpenAI services for response generation and speech output; it does not call them during installation or `--help`. Open Pipecat's local runner interface, connect, and speak. This is a development example, not an Internet-facing deployment configuration.
|
|
102
|
+
|
|
103
|
+
The agent waits for phrase events and matches their metadata to the text being aggregated into the current user message. Only known labels, scores, and segment times reach its instruction context. The original transcript stays unchanged. The added note explicitly treats estimates as tentative, and it is removed for a subsequent text-only message. The example's local framework test verifies this handoff; it does not establish better conversations or emotion-recognition accuracy.
|
|
104
|
+
|
|
105
|
+
## Read results
|
|
106
|
+
|
|
107
|
+
| Output | Meaning |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| `InterimTranscriptionFrame` | Provisional text accumulated for this turn. It can be revised. |
|
|
110
|
+
| `TranscriptionFrame` | The provider's final transcript, with `finalized=True`. `metadata["oruk"]` identifies its stream, turn, audio offset, model, and available phrases. |
|
|
111
|
+
| `OrukPhraseEmotionFrame` | A completed or failed phrase estimate. Read the original `event`, including `phrase_id`, start/end, scores, and provider request ID. |
|
|
112
|
+
| `OrukSpeakerBoundaryFrame` | An optional speaker boundary. Speaker identity is not assigned to the entire transcript. |
|
|
113
|
+
| `OrukTurnCompletedFrame` | Final text and usage were received and the WebSocket closed successfully. The result includes all phrases sorted by time. |
|
|
114
|
+
|
|
115
|
+
Phrase estimates are independent of transcript deltas and may arrive after final text. Join by stream/turn/request identity and phrase ID; never pair the nearest delta with an emotion result. Phrase times are relative to the turn; `audio_offset` places that turn on the incoming audio timeline, including skipped idle time. Speaker IDs restart with each connection. This integration does not claim word alignment or transcript-confidence scores.
|
|
116
|
+
|
|
117
|
+
With the default `wait_for_emotions=False`, final text is delivered immediately and its metadata is an immutable snapshot. Listen for later phrase frames or the `on_phrase_emotion` event. With `True`, final text waits for a clean turn completion and carries all returned phrase events. Interim text remains immediate in either mode.
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
@stt.event_handler("on_phrase_emotion")
|
|
121
|
+
async def on_phrase(service, frame):
|
|
122
|
+
# Store or display this turn's estimate according to your application's needs.
|
|
123
|
+
handle_phrase(frame.turn_id, frame.event)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Handlers are awaited in order and must finish within `event_handler_timeout` (two seconds by default). `on_speaker_boundary` and `on_turn_completed` use the same pattern. Each handler receives its own copy. Queue substantial application work separately within your own bounded worker.
|
|
127
|
+
|
|
128
|
+
## Configure and troubleshoot
|
|
129
|
+
|
|
130
|
+
Use `RealtimeOptions` for initial phrase segmentation, language, diarization, and turn/completion limits. `OrukSTTService.Settings(language="fr")` is also supported. A `STTUpdateSettingsFrame` can change the language between turns; changing the fixed model or changing language mid-utterance is rejected without corrupting the active turn.
|
|
131
|
+
|
|
132
|
+
Input must be mono PCM16 at the pipeline's fixed rate. Sixteen-kHz samples are transmitted byte for byte. Other admitted rates use streaming SoX VHQ conversion to the endpoint's 16 kHz, with the filter tail flushed at each commit. This conversion does not preserve frequencies above the endpoint's bandwidth. The original file is unchanged. Each input frame is limited to one second.
|
|
133
|
+
|
|
134
|
+
The default outstanding-audio limit is 30 seconds, with at most 32 pending turns and 128 pending provider events. Overflow is an explicit error, not silent sample loss. Feed microphone audio at playback speed. Each turn is limited to 300 seconds by default; a graceful pipeline stop has a separate 30-second limit. All limits are configurable within documented constructor bounds.
|
|
135
|
+
|
|
136
|
+
Transient connection failures can be retried only before the first audio write attempt. Once delivery may have happened, the utterance is never replayed. A failed turn marks this service unusable and follows the worker's `ProcessorUnusablePolicy`; use `CANCEL` for the supplied example. Start a fresh service after correcting the cause. A phrase-emotion failure alone does not discard a valid transcript.
|
|
137
|
+
|
|
138
|
+
Usage metrics come from the provider receipt, not idle microphone bytes. A receipt can precede a terminal error, so usage alone is not proof of successful completion. The optional latency metric measures speech end to delivered final text for the matching turn. No production P99 is advertised: Pipecat uses its framework fallback until you supply a measured `ttfs_p99_latency`.
|
|
139
|
+
|
|
140
|
+
## Local verification and release status
|
|
141
|
+
|
|
142
|
+
The tests cover real streaming before commit, independent turns, VAD prefix and partial frames, five sample-rate conversions, failure/timeout/cancellation, bounded buffers, mute, immutable metadata, receipt-based metrics, language updates, and the actual user-aggregator handoff. The CLI is exercised as a subprocess against the local gateway. The test recording and its separate attribution are in `tests/audio/`. It is not covered by the program's MIT license.
|
|
143
|
+
|
|
144
|
+
```sh
|
|
145
|
+
python -m pip install '.[agent,test]' 'build>=1,<2' 'ruff>=0.15,<1' 'pyright>=1.1,<2'
|
|
146
|
+
python -m pytest -q
|
|
147
|
+
python -m build
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The production browser check covers two consecutive turns, cancellation after an interim result, reconnection, and backend metering. Its 45-second recording and request receipts are in [the demonstration record](https://github.com/Oruk-AI/pipecat-oruk/blob/main/docs/DEMO.md). A full spoken assistant using an LLM and TTS, including assistant barge-in, still needs separate verification. This package is a release candidate; it is not an upstream Pipecat release. An upstream documentation listing is still pending.
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<img src="https://oruk.ai/brand/kit/oruk-primary.png" alt="oruk" width="160">
|
|
2
|
+
|
|
3
|
+
# Oruk speech and phrase emotion for Pipecat
|
|
4
|
+
|
|
5
|
+
Stream speech to Oruk's realtime preview and receive interim transcripts, final text, and independent phrase-emotion estimates. This integration is developed by **oruk labs**, the company providing the API. It is community-maintained by Oruk; it is not maintained or endorsed by Pipecat.
|
|
6
|
+
|
|
7
|
+
**Release candidate.** The adapter is tested with Pipecat 1.8.1 on Python 3.11, 3.12, 3.13, and 3.14. The package accepts Pipecat 1.8.x; other patch releases require their own recorded checks. Automated tests use a simulated gateway with the real framework. A separate [production browser demonstration](https://github.com/Oruk-AI/pipecat-oruk/blob/main/docs/DEMO.md) verifies WebRTC, real transcription and phrase estimates, two consecutive turns, cancellation after an interim result, reconnection, and backend metering. This is not an accuracy benchmark or a verified LLM/TTS conversation.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Use a Python virtual environment and pin the release candidate explicitly:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
python -m pip install 'pipecat-oruk==0.1.0rc1'
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
For the browser transport dependencies, install `pipecat-oruk[agent]==0.1.0rc1`. The examples below live in this repository; clone it to run them. To develop the adapter from a checkout, run `python -m pip install '.'` from the repository root.
|
|
18
|
+
|
|
19
|
+
Set `ORUK_API_KEY` in the server environment using a key from your Oruk developer portal. Keys are sent in an authenticated WebSocket upgrade, never in a URL or browser bundle. The distribution is named `pipecat-oruk` and uses `pipecat_oruk` imports.
|
|
20
|
+
|
|
21
|
+
## Try an audio recording
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
python examples/pipecat_stream_file.py recording.wav
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Use a mono PCM16 WAV at 8–96 kHz, up to five minutes long. Audio is sent at playback speed. The example prints JSON for interim text, final text, phrase events, and successful turn completion. It returns a nonzero exit status on failure.
|
|
28
|
+
|
|
29
|
+
Options:
|
|
30
|
+
|
|
31
|
+
- `--vad`: use Silero to split utterances; the file must be 8 or 16 kHz for this detector.
|
|
32
|
+
- `--wait-for-emotions`: include late phrase results in the final transcript's metadata.
|
|
33
|
+
- `--diarize`: request speaker labels within each Oruk turn.
|
|
34
|
+
- `--language fr`: configure a supported Oruk locale; the default is automatic recognition.
|
|
35
|
+
- `--fast`: send a saved recording without playback pacing, limited to 110 seconds.
|
|
36
|
+
|
|
37
|
+
## Try the browser speech demo
|
|
38
|
+
|
|
39
|
+
The [local browser example](https://github.com/Oruk-AI/pipecat-oruk/blob/main/examples/pipecat_browser/README.md) needs only an Oruk key. It streams the public sample through WebRTC, shows the returned estimates and receipts, and can record its own demonstration. No LLM or TTS account is required for this speech-only example. Install the agent extra shown below to include the browser transport dependencies.
|
|
40
|
+
|
|
41
|
+
## Put Oruk into a pipeline
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
|
45
|
+
from pipecat.audio.vad.vad_analyzer import VADParams
|
|
46
|
+
from pipecat.pipeline.pipeline import Pipeline
|
|
47
|
+
from pipecat.processors.audio.vad_processor import VADProcessor
|
|
48
|
+
from pipecat_oruk import OrukSTTService
|
|
49
|
+
|
|
50
|
+
vad = VADProcessor(
|
|
51
|
+
vad_analyzer=SileroVADAnalyzer(params=VADParams(start_secs=0.2, stop_secs=0.2))
|
|
52
|
+
)
|
|
53
|
+
stt = OrukSTTService(wait_for_emotions=True)
|
|
54
|
+
|
|
55
|
+
pipeline = Pipeline([
|
|
56
|
+
transport.input(),
|
|
57
|
+
vad,
|
|
58
|
+
stt,
|
|
59
|
+
user_aggregator,
|
|
60
|
+
llm,
|
|
61
|
+
tts,
|
|
62
|
+
transport.output(),
|
|
63
|
+
assistant_aggregator,
|
|
64
|
+
])
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The transport, aggregators, LLM, and TTS belong to your application. The complete [browser agent example](https://github.com/Oruk-AI/pipecat-oruk/blob/main/examples/pipecat_agent.py) assembles them. Set the pipeline's input rate to 16 kHz and avoid adding a second VAD inside the user aggregator. Oruk commits on the upstream VAD stop. Pipecat forwards audio before emitting a VAD start, so the adapter retains a bounded half-second prefix by default. Its prefix must cover the detector's start-confirmation interval plus one input chunk; an insufficient prefix is reported as an error instead of silently clipping the opening.
|
|
68
|
+
|
|
69
|
+
For externally segmented audio, use `OrukSTTService(vad=False)` and queue `OrukCommitFrame()` after the utterance. This is a system frame, ordered with incoming audio. `EndFrame` also flushes the current turn and waits for its result. An assistant `InterruptionFrame` preserves input recognition; `CancelFrame` aborts it.
|
|
70
|
+
|
|
71
|
+
## Run the browser agent
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
python -m pip install '.[agent]'
|
|
75
|
+
python examples/pipecat_agent.py --transport webrtc --host 127.0.0.1 --port 7860
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Before connecting, configure `ORUK_API_KEY`, `OPENAI_API_KEY`, `LLM_MODEL`, `TTS_MODEL`, and `TTS_VOICE` in the server environment. Choose model and voice names available to your account. The example uses Pipecat's OpenAI services for response generation and speech output; it does not call them during installation or `--help`. Open Pipecat's local runner interface, connect, and speak. This is a development example, not an Internet-facing deployment configuration.
|
|
79
|
+
|
|
80
|
+
The agent waits for phrase events and matches their metadata to the text being aggregated into the current user message. Only known labels, scores, and segment times reach its instruction context. The original transcript stays unchanged. The added note explicitly treats estimates as tentative, and it is removed for a subsequent text-only message. The example's local framework test verifies this handoff; it does not establish better conversations or emotion-recognition accuracy.
|
|
81
|
+
|
|
82
|
+
## Read results
|
|
83
|
+
|
|
84
|
+
| Output | Meaning |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| `InterimTranscriptionFrame` | Provisional text accumulated for this turn. It can be revised. |
|
|
87
|
+
| `TranscriptionFrame` | The provider's final transcript, with `finalized=True`. `metadata["oruk"]` identifies its stream, turn, audio offset, model, and available phrases. |
|
|
88
|
+
| `OrukPhraseEmotionFrame` | A completed or failed phrase estimate. Read the original `event`, including `phrase_id`, start/end, scores, and provider request ID. |
|
|
89
|
+
| `OrukSpeakerBoundaryFrame` | An optional speaker boundary. Speaker identity is not assigned to the entire transcript. |
|
|
90
|
+
| `OrukTurnCompletedFrame` | Final text and usage were received and the WebSocket closed successfully. The result includes all phrases sorted by time. |
|
|
91
|
+
|
|
92
|
+
Phrase estimates are independent of transcript deltas and may arrive after final text. Join by stream/turn/request identity and phrase ID; never pair the nearest delta with an emotion result. Phrase times are relative to the turn; `audio_offset` places that turn on the incoming audio timeline, including skipped idle time. Speaker IDs restart with each connection. This integration does not claim word alignment or transcript-confidence scores.
|
|
93
|
+
|
|
94
|
+
With the default `wait_for_emotions=False`, final text is delivered immediately and its metadata is an immutable snapshot. Listen for later phrase frames or the `on_phrase_emotion` event. With `True`, final text waits for a clean turn completion and carries all returned phrase events. Interim text remains immediate in either mode.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
@stt.event_handler("on_phrase_emotion")
|
|
98
|
+
async def on_phrase(service, frame):
|
|
99
|
+
# Store or display this turn's estimate according to your application's needs.
|
|
100
|
+
handle_phrase(frame.turn_id, frame.event)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Handlers are awaited in order and must finish within `event_handler_timeout` (two seconds by default). `on_speaker_boundary` and `on_turn_completed` use the same pattern. Each handler receives its own copy. Queue substantial application work separately within your own bounded worker.
|
|
104
|
+
|
|
105
|
+
## Configure and troubleshoot
|
|
106
|
+
|
|
107
|
+
Use `RealtimeOptions` for initial phrase segmentation, language, diarization, and turn/completion limits. `OrukSTTService.Settings(language="fr")` is also supported. A `STTUpdateSettingsFrame` can change the language between turns; changing the fixed model or changing language mid-utterance is rejected without corrupting the active turn.
|
|
108
|
+
|
|
109
|
+
Input must be mono PCM16 at the pipeline's fixed rate. Sixteen-kHz samples are transmitted byte for byte. Other admitted rates use streaming SoX VHQ conversion to the endpoint's 16 kHz, with the filter tail flushed at each commit. This conversion does not preserve frequencies above the endpoint's bandwidth. The original file is unchanged. Each input frame is limited to one second.
|
|
110
|
+
|
|
111
|
+
The default outstanding-audio limit is 30 seconds, with at most 32 pending turns and 128 pending provider events. Overflow is an explicit error, not silent sample loss. Feed microphone audio at playback speed. Each turn is limited to 300 seconds by default; a graceful pipeline stop has a separate 30-second limit. All limits are configurable within documented constructor bounds.
|
|
112
|
+
|
|
113
|
+
Transient connection failures can be retried only before the first audio write attempt. Once delivery may have happened, the utterance is never replayed. A failed turn marks this service unusable and follows the worker's `ProcessorUnusablePolicy`; use `CANCEL` for the supplied example. Start a fresh service after correcting the cause. A phrase-emotion failure alone does not discard a valid transcript.
|
|
114
|
+
|
|
115
|
+
Usage metrics come from the provider receipt, not idle microphone bytes. A receipt can precede a terminal error, so usage alone is not proof of successful completion. The optional latency metric measures speech end to delivered final text for the matching turn. No production P99 is advertised: Pipecat uses its framework fallback until you supply a measured `ttfs_p99_latency`.
|
|
116
|
+
|
|
117
|
+
## Local verification and release status
|
|
118
|
+
|
|
119
|
+
The tests cover real streaming before commit, independent turns, VAD prefix and partial frames, five sample-rate conversions, failure/timeout/cancellation, bounded buffers, mute, immutable metadata, receipt-based metrics, language updates, and the actual user-aggregator handoff. The CLI is exercised as a subprocess against the local gateway. The test recording and its separate attribution are in `tests/audio/`. It is not covered by the program's MIT license.
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
python -m pip install '.[agent,test]' 'build>=1,<2' 'ruff>=0.15,<1' 'pyright>=1.1,<2'
|
|
123
|
+
python -m pytest -q
|
|
124
|
+
python -m build
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The production browser check covers two consecutive turns, cancellation after an interim result, reconnection, and backend metering. Its 45-second recording and request receipts are in [the demonstration record](https://github.com/Oruk-AI/pipecat-oruk/blob/main/docs/DEMO.md). A full spoken assistant using an LLM and TTS, including assistant barge-in, still needs separate verification. This package is a release candidate; it is not an upstream Pipecat release. An upstream documentation listing is still pending.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Production browser demonstration
|
|
2
|
+
|
|
3
|
+
[Watch the 45-second demonstration](pipecat-demo.mp4).
|
|
4
|
+
|
|
5
|
+
Recorded September 11, 2026 using Pipecat 1.8.1 and the production Oruk realtime
|
|
6
|
+
API. The browser's live canvas displays the actual returned text, phrase
|
|
7
|
+
estimates, and request receipts. Input is the public Oruk quickstart recording.
|
|
8
|
+
|
|
9
|
+
Three turns finish successfully. A fourth is disconnected after a real interim
|
|
10
|
+
transcript and has no completed-turn receipt. Reconnection opens a fresh session.
|
|
11
|
+
Backend metering matches all four requests, including 1.58 seconds on the cancelled
|
|
12
|
+
one. The unedited original WebM is retained in Oruk's execution evidence; the MP4
|
|
13
|
+
changes the container/codec for convenient playback and preserves the full timeline.
|
|
14
|
+
|
|
15
|
+
[Verification details and hashes](pipecat-verification.json). This is a transport
|
|
16
|
+
and service integration check, not an independent benchmark or customer outcome.
|
|
17
|
+
A spoken LLM/TTS assistant and assistant barge-in are separate, unverified paths.
|
|
18
|
+
|
|
19
|
+
Demo recording and branding © 2026 Oruk labs. They are separate from the
|
|
20
|
+
MIT-licensed program. The existing third-party test fixture has its own attribution.
|
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"verified_at": "2026-09-11",
|
|
3
|
+
"python": "3.12.13",
|
|
4
|
+
"pipecat": "1.8.1",
|
|
5
|
+
"adapter_version": "0.1.0.dev0",
|
|
6
|
+
"environment": "Chrome browser, local SmallWebRTC transport, production Oruk realtime API",
|
|
7
|
+
"model": "oruk-realtime",
|
|
8
|
+
"sample_url": "https://oruk.ai/samples/oruk-quickstart.wav",
|
|
9
|
+
"sample_sha256": "fc25b0bd24fd7b6748ca9c6f6c2837df41873fe5dd680a54584e7b8c16b69140",
|
|
10
|
+
"completed_requests": [
|
|
11
|
+
"b1d84071d0e1401fa5a1610c642b4b44",
|
|
12
|
+
"ca36114109ad460b82c940dfe958198b",
|
|
13
|
+
"afe7005d660b43fcb8ee4a1afab402fd"
|
|
14
|
+
],
|
|
15
|
+
"interrupted_request": "3baff6a3e50a49f1836838bde4814021",
|
|
16
|
+
"metering": [
|
|
17
|
+
{
|
|
18
|
+
"request_id": "b1d84071d0e1401fa5a1610c642b4b44",
|
|
19
|
+
"model": "oruk-realtime",
|
|
20
|
+
"audio_seconds": 3.56,
|
|
21
|
+
"billable_seconds": 3.56
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"request_id": "ca36114109ad460b82c940dfe958198b",
|
|
25
|
+
"model": "oruk-realtime",
|
|
26
|
+
"audio_seconds": 3.58,
|
|
27
|
+
"billable_seconds": 3.58
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"request_id": "3baff6a3e50a49f1836838bde4814021",
|
|
31
|
+
"model": "oruk-realtime",
|
|
32
|
+
"audio_seconds": 1.58,
|
|
33
|
+
"billable_seconds": 1.58
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"request_id": "afe7005d660b43fcb8ee4a1afab402fd",
|
|
37
|
+
"model": "oruk-realtime",
|
|
38
|
+
"audio_seconds": 3.56,
|
|
39
|
+
"billable_seconds": 3.56
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"sample_expected_text": "I am genuinely excited that this is finally working.",
|
|
43
|
+
"observed_final_texts": [
|
|
44
|
+
"I am genuinely excited that this is finally working.",
|
|
45
|
+
"I am genuinely excited that this is finally working.",
|
|
46
|
+
"I am genuinely excited that this is finally working."
|
|
47
|
+
],
|
|
48
|
+
"demo_file": "pipecat-demo.mp4",
|
|
49
|
+
"demo_duration_seconds": 45.032,
|
|
50
|
+
"demo_sha256": "55ec752b2354aeda2863a7424f33de29adfe5f522455202ef17ea1a6366bd462",
|
|
51
|
+
"limitations": [
|
|
52
|
+
"Public prerecorded sample, not a human microphone conversation",
|
|
53
|
+
"Not independent model accuracy or production latency evidence",
|
|
54
|
+
"Uses an internal demo identity; not a customer conversion",
|
|
55
|
+
"Full LLM/TTS conversation and assistant barge-in remain unverified",
|
|
56
|
+
"The service was exercised using the prepared 0.1.0.dev0 wheel; compare adapter and transport hashes for later packaging-only versions"
|
|
57
|
+
],
|
|
58
|
+
"adapter_sha256": "a8260a708467db6edfa705aee0a5137f95ff7013d750c54766159fd4cb430b09",
|
|
59
|
+
"transport_sha256": "2e45aa56731dcd21edc9d0bbbd9faa9d081d80dd68517f41793ff48aec457661",
|
|
60
|
+
"release_candidate_smoke": {
|
|
61
|
+
"version": "0.1.0rc1",
|
|
62
|
+
"request_id": "766a22daab234bf8a9aad89e16c78440",
|
|
63
|
+
"text": "I am genuinely excited that this is finally working.",
|
|
64
|
+
"receipt_billable_seconds": 3.56,
|
|
65
|
+
"scope": "Installed standalone wheel and portable browser example; production transcript, phrase estimate and completed-turn receipt; no separate database reconciliation for this smoke run"
|
|
66
|
+
}
|
|
67
|
+
}
|