Skip to content

Commit 2527e0d

Browse files
authored
Voice SDK 0.1.26
Python SDK for building voice-enabled applications with the Speechmatics Real-Time API. Optimized for conversational AI, voice agents, transcription services, and real-time captioning. The Voice SDK is a higher-level abstraction built on top of the Speechmatics Real-Time API (`speechmatics-rt`).
1 parent 8bee6b0 commit 2527e0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+10525
-64
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: '[BUG] '
5-
labels: 'bug'
6-
assignees: ''
4+
title: "[BUG] "
5+
labels: "bug"
6+
assignees: ""
77
---
88

99
**Which SDK are you using?**
10+
1011
- [ ] speechmatics-rt (Real-Time SDK)
1112
- [ ] speechmatics-batch (Batch SDK)
12-
- [ ] Both
13+
- [ ] speechmatics-voice (Voice SDK)
14+
- [ ] All
1315

1416
**Package Information**
15-
- **Package Name**: (e.g., speechmatics-rt, speechmatics-batch)
17+
18+
- **Package Name**: (e.g., speechmatics-rt, speechmatics-batch, speechmatics-voice)
1619
- **Package Version**: (e.g., 1.0.0)
1720
- **Python Version**: (e.g., 3.9, 3.10, 3.11, 3.12, 3.13)
1821
- **Operating System**: (e.g., Windows 10, macOS 12, Ubuntu 20.04)
@@ -22,6 +25,7 @@ A clear and concise description of what the bug is.
2225

2326
**To Reproduce**
2427
Steps to reproduce the behavior:
28+
2529
1.
2630
2.
2731

.github/ISSUE_TEMPLATE/question.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
---
22
name: Question
33
about: Ask a question or request support
4-
title: '[QUESTION] '
5-
labels: 'question'
6-
assignees: ''
4+
title: "[QUESTION] "
5+
labels: "question"
6+
assignees: ""
77
---
88

99
**Which SDK is your question about?**
10+
1011
- [ ] speechmatics-rt (Real-Time SDK)
1112
- [ ] speechmatics-batch (Batch SDK)
12-
- [ ] Both SDKs
13+
- [ ] speechmatics-voice (Voice SDK)
14+
- [ ] All
1315
- [ ] General usage question
1416
- [ ] Setup/Installation
1517
- [ ] Not sure
1618

1719
**Package Information** (if applicable)
18-
- **Package Name**: (e.g., speechmatics-rt, speechmatics-batch)
20+
21+
- **Package Name**: (e.g., speechmatics-rt, speechmatics-batch, speechmatics-voice)
1922
- **Package Version**: (e.g., 1.0.0)
2023
- **Python Version**: (e.g., 3.9, 3.10, 3.11, 3.12, 3.13)
2124
- **Operating System**: (e.g., Windows 10, macOS 12, Ubuntu 20.04)
@@ -35,4 +38,5 @@ What result or behavior are you hoping to achieve?
3538

3639
**Related issues**
3740
Link any related issues or discussions:
41+
3842
- Related to #

.github/RELEASE.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ This document outlines the release process for the Speechmatics Python SDK packa
55
## Overview
66

77
The Speechmatics Python SDK repository contains two separate packages:
8+
89
- `speechmatics-rt` - Real-Time API Client
910
- `speechmatics-batch` - Batch API Client
1011
- `speechmatics-flow` - Flow API Client
12+
- `speechmatics-voice` - Voice Agent API Client
1113

1214
Each package is released independently with its own versioning and release workflow.
1315

@@ -16,17 +18,20 @@ Each package is released independently with its own versioning and release workf
1618
Before creating a release, ensure the following steps are completed:
1719

1820
### Code Quality
21+
1922
- [ ] All tests pass locally (`make test-all`)
2023
- [ ] Linting passes (`make lint-all`)
2124
- [ ] Type checking passes (`make type-check-all`)
2225
- [ ] Examples work correctly with the new version
2326
- [ ] Documentation is up to date
2427

2528
### Version Management
29+
2630
- [ ] Review and update README files if needed
2731
- [ ] Verify dependencies are correct in `pyproject.toml`
2832

2933
### Testing
34+
3035
- [ ] Test examples with fresh installations
3136
- [ ] Verify environment variables work correctly
3237
- [ ] Test error handling scenarios
@@ -39,13 +44,15 @@ Before creating a release, ensure the following steps are completed:
3944
To release a new version of the RT SDK:
4045

4146
1. **Create a Release Tag**
47+
4248
```bash
4349
git tag rt/v1.0.0
4450
git push origin rt/v1.0.0
4551
```
4652

4753
2. **Automated Workflow**
4854
The `release-rt.yaml` workflow will automatically:
55+
4956
- Extract version from tag (e.g., `rt/v1.0.0``1.0.0`)
5057
- Run comprehensive tests across Python versions
5158
- Update version in `sdk/rt/speechmatics/rt/__init__.py`
@@ -63,13 +70,15 @@ To release a new version of the RT SDK:
6370
To release a new version of the Batch SDK:
6471

6572
1. **Create a Release Tag**
73+
6674
```bash
6775
git tag batch/v1.0.0
6876
git push origin batch/v1.0.0
6977
```
7078

7179
2. **Automated Workflow**
7280
The `release-batch.yaml` workflow will automatically:
81+
7382
- Extract version from tag (e.g., `batch/v1.0.0``1.0.0`)
7483
- Run comprehensive tests across Python versions
7584
- Update version in `sdk/batch/speechmatics/batch/__init__.py`
@@ -87,13 +96,15 @@ To release a new version of the Batch SDK:
8796
To release a new version of the Flow SDK:
8897

8998
1. **Create a Release Tag**
99+
90100
```bash
91101
git tag flow/v1.0.0
92102
git push origin flow/v1.0.0
93103
```
94104

95105
2. **Automated Workflow**
96106
The `release-flow.yaml` workflow will automatically:
107+
97108
- Extract version from tag (e.g., `flow/v1.0.0``1.0.0`)
98109
- Run comprehensive tests across Python versions
99110
- Update version in `sdk/flow/speechmatics/flow/__init__.py`
@@ -106,36 +117,72 @@ To release a new version of the Flow SDK:
106117
- Update GitHub release notes
107118
- Announce the release
108119

120+
### 4. Voice Agent SDK Release
121+
122+
To release a new version of the Voice Agent SDK:
123+
124+
1. **Create a Release Tag**
125+
126+
```bash
127+
git tag voice/v1.0.0
128+
git push origin voice/v1.0.0
129+
```
130+
131+
2. **Automated Workflow**
132+
The `release-voice.yaml` workflow will automatically:
133+
134+
- Extract version from tag (e.g., `voice/v1.0.0``1.0.0`)
135+
- Run comprehensive tests across Python versions
136+
- Update version in `sdk/voice/speechmatics/voice/__init__.py`
137+
- Build the package
138+
- Publish to PyPI
139+
140+
3. **Manual Steps After Release**
141+
- Verify the package is available on PyPI
142+
- Test installation: `pip install speechmatics-voice==1.0.0`
143+
- Update GitHub release notes
144+
- Announce the release
145+
109146
## Version Management
110147

111148
### Version Format
149+
112150
Both packages follow semantic versioning (SemVer):
151+
113152
- `MAJOR.MINOR.PATCH` (e.g., `1.2.3`)
114153
- `MAJOR.MINOR.PATCH-beta.N` for beta releases (e.g., `1.2.3-beta.1`)
115154

116155
### Version Update Process
156+
117157
1. **Development**: Versions remain as `0.0.0` in `__init__.py` files
118158
2. **Release**: GitHub Actions automatically updates the version during release
119159
3. **Post-Release**: The updated version remains in the repository
120160

121161
### Tag Naming Convention
162+
122163
- RT SDK: `rt/v{version}` (e.g., `rt/v1.0.0`)
123164
- Batch SDK: `batch/v{version}` (e.g., `batch/v1.0.0`)
124165
- Flow SDK: `flow/v{version}` (e.g., `flow/v1.0.0`)
166+
- Voice Agent SDK: `voice/v{version}` (e.g., `voice/v1.0.0`)
125167

126168
## Environment Setup
127169

128170
### PyPI Configuration
171+
129172
Both packages are published to PyPI using GitHub Actions with OpenID Connect (OIDC):
173+
130174
- RT SDK: Uses `pypi-rt` environment
131175
- Batch SDK: Uses `pypi-batch` environment
132176
- Flow SDK: Uses `pypi-flow` environment
177+
- Voice Agent SDK: Uses `pypi-voice` environment
133178

134179
### Required Secrets
180+
135181
No manual secrets are required as the workflows use OIDC for PyPI authentication.
136182

137183
## Testing Matrix
138184

139185
Both packages are tested against:
186+
140187
- Python versions: 3.9, 3.10, 3.11, 3.12, 3.13
141188
- Operating system: Ubuntu (latest)
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Release Voice Agent SDK
2+
3+
on:
4+
push:
5+
tags:
6+
- "voice/v*"
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
extract-version:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
version: ${{ steps.extract.outputs.version }}
17+
steps:
18+
- name: Extract version from tag
19+
id: extract
20+
run: |
21+
# Extract version from tag (voice/v1.0.0 -> 1.0.0)
22+
VERSION=${GITHUB_REF#refs/tags/voice/v}
23+
echo "version=$VERSION" >> $GITHUB_OUTPUT
24+
echo "Extracted version: $VERSION"
25+
26+
test-voice:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
- name: Test Voice Agent SDK
37+
run: |
38+
make install-dev
39+
make lint-voice
40+
make test-voice
41+
42+
release-build:
43+
runs-on: ubuntu-latest
44+
needs: [extract-version, test-voice]
45+
outputs:
46+
version: ${{ needs.extract-version.outputs.version }}
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- uses: actions/setup-python@v5
51+
with:
52+
python-version: "3.13"
53+
54+
- name: Update package version in sdk/voice/speechmatics/voice/__init__.py
55+
run: |
56+
VERSION="${{ needs.extract-version.outputs.version }}"
57+
sed -i "s/0\.0\.0/$VERSION/g" ./sdk/voice/speechmatics/voice/__init__.py
58+
echo "Updated version to: $VERSION"
59+
cat ./sdk/voice/speechmatics/voice/__init__.py | grep __version__
60+
61+
- name: Build Voice Agent SDK
62+
run: |
63+
make install-dev
64+
make build-voice
65+
66+
- name: Upload dist
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: voice-release-dist
70+
path: sdk/voice/dist/
71+
72+
pypi-publish:
73+
runs-on: ubuntu-latest
74+
needs: [release-build]
75+
environment:
76+
name: pypi-voice
77+
url: https://pypi.org/project/speechmatics-voice/${{ needs.release-build.outputs.version }}
78+
79+
steps:
80+
- name: Retrieve release dist
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: voice-release-dist
84+
path: dist/
85+
86+
- name: Publish to PyPI
87+
uses: pypa/gh-action-pypi-publish@release/v1
88+
with:
89+
packages-dir: dist/
90+
password: ${{ secrets.PYPI_ORG_TOKEN }}

.github/workflows/test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,26 @@ jobs:
7070
- name: Build Flow SDK
7171
run: make build-flow
7272

73+
test-voice:
74+
name: Test Voice Agent SDK
75+
runs-on: ubuntu-latest
76+
strategy:
77+
matrix:
78+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
79+
steps:
80+
- uses: actions/checkout@v4
81+
- uses: actions/setup-python@v5
82+
with:
83+
python-version: ${{ matrix.python-version }}
84+
- name: Install dependencies
85+
run: make install-dev
86+
- name: Lint Voice Agent SDK
87+
run: make lint-voice
88+
- name: Test Voice Agent SDK
89+
run: make test-voice
90+
- name: Build Voice Agent SDK
91+
run: make build-voice
92+
7393
test-tts:
7494
name: Test TTS SDK
7595
runs-on: ubuntu-latest

.gitignore

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,12 @@ coverage.xml
5050
.hypothesis/
5151
.pytest_cache/
5252
cover/
53+
.benchmarks/
5354

5455
# Translations
5556
*.mo
5657
*.pot
5758

58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
7459
# PyBuilder
7560
.pybuilder/
7661
target/
@@ -172,5 +157,16 @@ cython_debug/
172157
# PyPI configuration file
173158
.pypirc
174159

160+
# Temporary files / directories
161+
.tmp/
162+
tmp/
163+
164+
# Model caches
165+
.models/
166+
.cache/
167+
*.onnx
168+
*.pkf
169+
.claude
170+
175171
# Examples
176-
**/output.wav
172+
**/output.wav

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ repos:
5050
- id: bandit
5151
files: ^sdk/.*/speechmatics/
5252
args: [-r, -f, json, -ll]
53+
additional_dependencies: ["pbr"]
5354

5455
- repo: https://github.com/pre-commit/pygrep-hooks
5556
rev: v1.10.0

0 commit comments

Comments
 (0)