voiceground 0.1.4__py3-none-any.whl
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.
- voiceground/__init__.py +38 -0
- voiceground/_static/index.html +63 -0
- voiceground/events.py +72 -0
- voiceground/metrics.py +164 -0
- voiceground/observer.py +546 -0
- voiceground/py.typed +0 -0
- voiceground/reporters/__init__.py +19 -0
- voiceground/reporters/base.py +43 -0
- voiceground/reporters/html.py +238 -0
- voiceground/reporters/metrics.py +468 -0
- voiceground-0.1.4.dist-info/METADATA +199 -0
- voiceground-0.1.4.dist-info/RECORD +14 -0
- voiceground-0.1.4.dist-info/WHEEL +4 -0
- voiceground-0.1.4.dist-info/licenses/LICENSE +26 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: voiceground
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: Observability framework for Pipecat voice and multimodal conversational AI
|
|
5
|
+
Project-URL: Homepage, https://github.com/poseneror/voiceground
|
|
6
|
+
Project-URL: Documentation, https://github.com/poseneror/voiceground#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/poseneror/voiceground
|
|
8
|
+
Project-URL: Issues, https://github.com/poseneror/voiceground/issues
|
|
9
|
+
Author-email: Or Posener <posener.or@gmail.com>
|
|
10
|
+
License-Expression: BSD-2-Clause
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: ai,conversational-ai,observability,pipecat,real-time,voice
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: pipecat-ai>=0.0.90
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest-asyncio>=0.21; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
28
|
+
Provides-Extra: examples
|
|
29
|
+
Requires-Dist: aiohttp>=3.9; extra == 'examples'
|
|
30
|
+
Requires-Dist: loguru>=0.7; extra == 'examples'
|
|
31
|
+
Requires-Dist: pipecat-ai[elevenlabs,openai,silero]>=0.0.90; extra == 'examples'
|
|
32
|
+
Requires-Dist: pyaudio>=0.2.14; extra == 'examples'
|
|
33
|
+
Requires-Dist: python-dotenv>=1.0; extra == 'examples'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Voiceground
|
|
37
|
+
|
|
38
|
+
Observability framework for [Pipecat](https://github.com/pipecat-ai/pipecat) voice and multimodal conversational AI.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- **VoicegroundObserver**: Track conversation events following Pipecat's Observer pattern
|
|
43
|
+
- **HTMLReporter**: Generate interactive HTML reports with timeline visualization
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install voiceground
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or with UV:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
uv add voiceground
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
import uuid
|
|
61
|
+
from pipecat.pipeline.pipeline import Pipeline
|
|
62
|
+
from pipecat.pipeline.task import PipelineTask
|
|
63
|
+
from voiceground import VoicegroundObserver, HTMLReporter
|
|
64
|
+
|
|
65
|
+
# Create observer with HTML reporter
|
|
66
|
+
conversation_id = str(uuid.uuid4())
|
|
67
|
+
reporter = HTMLReporter(output_dir="./reports")
|
|
68
|
+
observer = VoicegroundObserver(
|
|
69
|
+
reporters=[reporter],
|
|
70
|
+
conversation_id=conversation_id
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
# Create pipeline task with observer
|
|
74
|
+
task = PipelineTask(
|
|
75
|
+
pipeline=Pipeline([...]),
|
|
76
|
+
observers=[observer]
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Run your pipeline
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Tested With
|
|
83
|
+
|
|
84
|
+
Voiceground has been tested with the following Pipecat providers:
|
|
85
|
+
|
|
86
|
+
### LLM Providers
|
|
87
|
+
- [x] OpenAI (GPT)
|
|
88
|
+
|
|
89
|
+
### STT Providers
|
|
90
|
+
- [x] ElevenLabs
|
|
91
|
+
|
|
92
|
+
### TTS Providers
|
|
93
|
+
- [x] ElevenLabs
|
|
94
|
+
|
|
95
|
+
## Event Categories
|
|
96
|
+
|
|
97
|
+
Voiceground tracks the following event categories:
|
|
98
|
+
|
|
99
|
+
| Category | Types | Description |
|
|
100
|
+
|----------|-------|-------------|
|
|
101
|
+
| `user_speak` | `start`, `end` | User speech events |
|
|
102
|
+
| `bot_speak` | `start`, `end` | Bot speech events |
|
|
103
|
+
| `stt` | `start`, `end` | Speech-to-text processing (includes transcription text) |
|
|
104
|
+
| `llm` | `start`, `first_byte`, `end` | LLM response generation (includes generated text) |
|
|
105
|
+
| `tts` | `start`, `first_byte`, `end` | Text-to-speech synthesis |
|
|
106
|
+
| `tool_call` | `start`, `end` | LLM function/tool calling |
|
|
107
|
+
| `system` | `start`, `end` | System events (e.g., context aggregation) |
|
|
108
|
+
|
|
109
|
+
## Opinionated Metrics
|
|
110
|
+
|
|
111
|
+
Voiceground tracks 7 opinionated metrics per conversation turn, providing comprehensive insights into voice conversation performance:
|
|
112
|
+
|
|
113
|
+
1. **Turn Duration**: Total time from the first event to the last event in the turn (milliseconds). Measures the complete duration of a conversation turn.
|
|
114
|
+
|
|
115
|
+
2. **Response Time**: Time from `user_speak:end` to `bot_speak:start` (or from the first event to `bot_speak:start` if the conversation started with bot speech). This is the end-to-end time the user experiences waiting for a response.
|
|
116
|
+
|
|
117
|
+
3. **Transcription Overhead**: Time from `user_speak:end` to `stt:end` (milliseconds). Measures the latency of speech-to-text processing.
|
|
118
|
+
|
|
119
|
+
4. **Voice Synthesis Overhead**: Time from `tts:start` to `bot_speak:start` (milliseconds). Measures the latency of text-to-speech synthesis.
|
|
120
|
+
|
|
121
|
+
5. **LLM Response Time**: Time from `llm:start` to `llm:first_byte` (milliseconds). Measures the time-to-first-byte for the LLM response, indicating how quickly the model starts generating content.
|
|
122
|
+
|
|
123
|
+
6. **System Overhead**: Time from `stt:end` to `llm:start` (milliseconds). Measures context aggregation and other system processing that occurs between transcription and LLM invocation. Includes labels/metadata about the system operations.
|
|
124
|
+
|
|
125
|
+
7. **Tools Overhead**: Sum of all individual `tool_call` durations (each `tool_call:end - tool_call:start`) that occur between `llm:start` and `llm:end` (milliseconds). Measures the total time spent executing function/tool calls during LLM processing.
|
|
126
|
+
|
|
127
|
+
### Metric Relationships
|
|
128
|
+
|
|
129
|
+
The metrics are related as follows:
|
|
130
|
+
- **Response Time** ≈ **Transcription Overhead** + **System Overhead** + **LLM Response Time** + **Tools Overhead** + **Voice Synthesis Overhead**
|
|
131
|
+
- **Turn Duration** includes all events in the turn and may be longer than Response Time if there are additional events before or after the main response flow
|
|
132
|
+
|
|
133
|
+
## Report Features
|
|
134
|
+
|
|
135
|
+
The generated HTML reports include:
|
|
136
|
+
|
|
137
|
+
- **Timeline Visualization**: Interactive timeline showing all events and their relationships
|
|
138
|
+
- **Events Table**: Detailed view of all tracked events with timestamps, sources, and data
|
|
139
|
+
- **Turns Table**: Conversation turns with all 7 opinionated performance metrics
|
|
140
|
+
- **Metrics Summary**: Average metrics across the conversation
|
|
141
|
+
- **Event Highlighting**: Hover over events or turns to see related events highlighted
|
|
142
|
+
|
|
143
|
+
## Examples
|
|
144
|
+
|
|
145
|
+
See the `examples/` directory for complete working examples:
|
|
146
|
+
|
|
147
|
+
- **basic_pipeline.py**: Basic voice conversation with STT, LLM, and TTS
|
|
148
|
+
- **tool_calling_pipeline.py**: Example with LLM function calling
|
|
149
|
+
|
|
150
|
+
To run an example:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# Install example dependencies
|
|
154
|
+
uv sync --all-extras
|
|
155
|
+
|
|
156
|
+
# Set required environment variables
|
|
157
|
+
export OPENAI_API_KEY=your_key
|
|
158
|
+
export ELEVENLABS_API_KEY=your_key
|
|
159
|
+
export VOICE_ID=your_voice_id
|
|
160
|
+
|
|
161
|
+
# Run the example
|
|
162
|
+
python examples/basic_pipeline.py
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**Note**: On macOS, you'll need to install portaudio for audio support:
|
|
166
|
+
```bash
|
|
167
|
+
brew install portaudio
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Development
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# Clone the repository
|
|
174
|
+
git clone https://github.com/poseneror/voiceground.git
|
|
175
|
+
cd voiceground
|
|
176
|
+
|
|
177
|
+
# Install all dependencies (including dev and examples)
|
|
178
|
+
uv sync --all-extras
|
|
179
|
+
|
|
180
|
+
# Run tests
|
|
181
|
+
uv run pytest
|
|
182
|
+
|
|
183
|
+
# Run linting
|
|
184
|
+
uv run ruff check .
|
|
185
|
+
|
|
186
|
+
# Run type checking
|
|
187
|
+
uv run mypy src
|
|
188
|
+
|
|
189
|
+
# Build the client
|
|
190
|
+
python scripts/develop.py build
|
|
191
|
+
|
|
192
|
+
# Run example (requires portaudio on macOS: brew install portaudio)
|
|
193
|
+
python scripts/develop.py example
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## License
|
|
197
|
+
|
|
198
|
+
BSD-2-Clause License - see [LICENSE](LICENSE) for details.
|
|
199
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
voiceground/__init__.py,sha256=SE1CXqfR1ttdwhF-wEBt4siVBEGHlmm10O0nUFFlTGw,1267
|
|
2
|
+
voiceground/events.py,sha256=8UHcHYy719JDnTG7ZsehMrubokNzAJf1ZKogOwslvwo,2094
|
|
3
|
+
voiceground/metrics.py,sha256=E1KpLzeAwk3Ir1fyr5XneGpk5KLCQFUoypuNudY4MP0,4927
|
|
4
|
+
voiceground/observer.py,sha256=CiWR4bJOY0VpXCkh6OqGk0A6CXMokZzLLFPmGXHKZ7s,21004
|
|
5
|
+
voiceground/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
voiceground/_static/index.html,sha256=EzpBg5Es8JAxYgObdxtEKIanoUsIChJxkxmsdQPiEMQ,412155
|
|
7
|
+
voiceground/reporters/__init__.py,sha256=mRIrsCHV3Fqe9-W_B79mRq-Rvhi5y7x5J2argeGx0Qs,428
|
|
8
|
+
voiceground/reporters/base.py,sha256=ybUOzwLEQ1cjfGphiPKOzCdgpx3CsMZOBtUjZ204Uuo,1144
|
|
9
|
+
voiceground/reporters/html.py,sha256=1wiSGnpqQWPiplVfEnn97ZcSl9ZW-tQDyuEtTTt5OVk,7753
|
|
10
|
+
voiceground/reporters/metrics.py,sha256=Q0HYQ0lWAo6vD5uI88hAc_Gyr_Y_BdAiXdlltbrs-No,17051
|
|
11
|
+
voiceground-0.1.4.dist-info/METADATA,sha256=H33d28yvColfE8hutjAyiImZmVCEkFseI3qELc-ZyRA,6893
|
|
12
|
+
voiceground-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
voiceground-0.1.4.dist-info/licenses/LICENSE,sha256=hTRqDroiJlNOmzbVHjoKc6HZ3DySfhjx4bjeZJHgID0,1335
|
|
14
|
+
voiceground-0.1.4.dist-info/RECORD,,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024, Voiceground Contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
|