Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4505a8f
chore: disable .fernignore
lukeocodes Dec 10, 2025
ad93815
SDK regeneration
fern-api[bot] Dec 10, 2025
5a1a659
SDK regeneration
fern-api[bot] Dec 10, 2025
9883fa6
chore(tests): prettify wiremock mappings so manual edits are easier t…
lukeocodes Dec 12, 2025
29c48d5
fix(tests): fixing wiremock tests with a content-type match temporarily
lukeocodes Dec 12, 2025
e07cbf1
fix(tests): fix wiremock conftest to use base client
lukeocodes Dec 12, 2025
97a31a9
fix(test): correct wire test implementations
lukeocodes Dec 12, 2025
9589d58
chore(fernignore): protect manual fixes from generator overwrite
lukeocodes Dec 12, 2025
f9f4511
feat(client): add telemetry parameters for backwards compatibility
lukeocodes Dec 12, 2025
d4049d2
chore: update ignore files for manual tests
lukeocodes Dec 15, 2025
1d404d7
fix(websockets): change media methods to accept bytes instead of str
lukeocodes Dec 15, 2025
b413ea1
chore(fernignore): add socket client files to prevent regeneration
lukeocodes Dec 15, 2025
055ffa6
test(websockets): update manual tests to use public media methods
lukeocodes Dec 15, 2025
785b6b3
docs(websockets): add websockets-reference.md for v6 SDK
lukeocodes Dec 15, 2025
fdcce88
SDK regeneration
fern-api[bot] Dec 16, 2025
47f7228
SDK regeneration
fern-api[bot] Dec 16, 2025
0a759cf
SDK regeneration
fern-api[bot] Dec 16, 2025
b422ca3
chore: bump version to 6.0.0-alpha.1
lukeocodes Dec 17, 2025
9d01c17
ci: add release-please workflow and configuration
lukeocodes Dec 17, 2025
276ec07
ci: update CI workflow with matrix strategy and Docker verification
lukeocodes Dec 17, 2025
e1e6285
ci: add PR title checking workflow
lukeocodes Dec 17, 2025
50b4b69
ci: add changelog logging and daily test workflows
lukeocodes Dec 17, 2025
5f8fa81
docs: add migration guides from main branch
lukeocodes Dec 17, 2025
e8f3e4b
Add comprehensive examples directory with production-ready patterns
lukeocodes Dec 17, 2025
f80076b
chore(lint): apply automatic linting fixes to examples
lukeocodes Dec 17, 2025
f8a656a
fix(tests): add Python 3.8-3.10 datetime.fromisoformat compatibility
lukeocodes Dec 17, 2025
b6db74e
chore: add tests/wire/__init__.py to fernignore
lukeocodes Dec 17, 2025
c8d03a6
chore: bump version to 6.0.0-alpha.2
lukeocodes Dec 17, 2025
7f574f1
fix(ci): add poetry to PATH and remove publish matrix
lukeocodes Dec 17, 2025
6863c90
chore: bump version to 6.0.0-alpha.3
lukeocodes Dec 17, 2025
edfce11
ci: migrate PyPI publishing to OIDC trusted publishers
lukeocodes Dec 19, 2025
1438872
chore: bump version to 6.0.0-alpha.4
lukeocodes Dec 19, 2025
1aa53c7
chore: add .github, docs, and examples folders to fernignore
lukeocodes Jan 7, 2026
62a5d8a
SDK regeneration
fern-api[bot] Jan 7, 2026
83ad8e4
fix(listen): change send_media parameter type from str to bytes
lukeocodes Jan 8, 2026
a65d8d1
fix(agent): add send_media method and support binary audio responses
lukeocodes Jan 8, 2026
e57a518
fix(speak): support binary audio responses in socket client
lukeocodes Jan 8, 2026
f45d376
docs: update .fernignore with current socket client binary audio fixes
lukeocodes Jan 8, 2026
c9b9fff
chore: update version to 6.0.0-beta.1
lukeocodes Jan 8, 2026
430a46a
chore: update version to 6.0.0-beta.2
lukeocodes Jan 8, 2026
d177636
SDK regeneration
fern-api[bot] Jan 12, 2026
31d6fba
chore: remove outdated WebSocket manual fix documentation
lukeocodes Jan 12, 2026
5c81290
chore(fernignore): remove wire test entries to allow regeneration
lukeocodes Feb 15, 2026
f9697f7
SDK regeneration
fern-api[bot] Feb 15, 2026
8204e16
fix(wire): correct listen test and wiremock mapping after regeneration
lukeocodes Feb 15, 2026
3a25e65
fix(websocket): update manual tests and socket clients for v5.5 regen…
lukeocodes Feb 15, 2026
c3ce707
fix(examples): update examples for v5.5 regenerated SDK types and met…
lukeocodes Feb 15, 2026
e1ddbba
docs: add v5 to v6 migration guide
lukeocodes Feb 15, 2026
6754e00
docs: merge WebSocket reference into reference.md with v6 types
lukeocodes Feb 15, 2026
d8cf33e
chore: restore release-please workflow from main
lukeocodes Feb 15, 2026
2529a26
Merge remote-tracking branch 'origin/main' into lo/v5-5-regen
lukeocodes Feb 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 17 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"cliVersion": "3.77.1",
"generatorName": "fernapi/fern-python-sdk",
"generatorVersion": "4.57.2",
"generatorConfig": {
"client": {
"class_name": "BaseClient",
"filename": "base_client.py",
"exported_class_name": "DeepgramClient",
"exported_filename": "client.py"
},
"use_typeddict_requests": true,
"should_generate_websocket_clients": true,
"enable_wire_tests": true
},
"sdkVersion": "6.0.0-beta.4"
}
60 changes: 33 additions & 27 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,39 @@
# Development, Configuration Files & Documentation
README.md
CONTRIBUTING.md
.vscode/
.gitignore
mypy.ini
websockets-reference.md
.github/
scripts/run_examples.sh
docs/
pyproject.toml
CHANGELOG.md
# Custom client implementation extending BaseClient with additional features:
# - access_token parameter support (Bearer token authentication)
# - Automatic session ID generation and header injection (x-deepgram-session-id)
# This file is manually maintained and should not be regenerated
src/deepgram/client.py

# Examples
examples/
# WireMock mappings: removed duplicate empty-body /v1/listen stub that causes
# non-deterministic matching failures
wiremock/wiremock-mappings.json

# Test Files
tests/unit/
tests/integrations/
# Wire test with manual fix: transcribe_file() requires request=bytes parameter
tests/wire/test_listen_v1_media.py

# Custom Extensions & Clients
src/deepgram/client.py
src/deepgram/extensions/

# Socket Client Implementations
src/deepgram/agent/v1/socket_client.py
# WebSocket socket clients: optional message parameter defaults for send_flush,
# send_close, send_clear, send_finalize, send_close_stream, send_keep_alive
src/deepgram/speak/v1/socket_client.py
src/deepgram/listen/v1/socket_client.py
src/deepgram/listen/v2/socket_client.py
src/deepgram/speak/v1/socket_client.py
src/deepgram/agent/v1/socket_client.py

# Manual standalone tests
tests/manual

# README with custom examples, migration guide links, and contributing section
README.md

# Changelog managed by release-please
CHANGELOG.md

# Contributing guide
CONTRIBUTING.md

# Reference with Fern-generated REST API docs plus manually maintained WebSocket sections
reference.md

# Bug Fixes
src/deepgram/listen/client.py
src/deepgram/core/client_wrapper.py
# Folders to ignore
.github
docs
examples
3 changes: 2 additions & 1 deletion .github/.commitlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@
100
]
}
}
}

1 change: 1 addition & 0 deletions .github/workflows/changelog-log.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ jobs:
# include_body_raw: "false"
# log_level: "warn" # trace, debug, info, warn, error, fatal
# extra_body_json: '{"custom":"field"}' # merge custom fields into payload

37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Add poetry to PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Compile
Expand All @@ -38,8 +41,42 @@ jobs:
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Add poetry to PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install

- name: Verify Docker is available
run: |
docker --version
docker compose version

- name: Test
run: poetry run pytest -rP .

publish:
needs: [compile, test]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: "3.8"
- name: Bootstrap poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
- name: Add poetry to PATH
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Build package
run: poetry build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ jobs:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "$PR_TITLE" | npx commitlint -g .github/.commitlintrc.json

5 changes: 5 additions & 0 deletions .github/workflows/tests-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@ jobs:
- name: Install dependencies
run: poetry install

- name: Verify Docker is available
run: |
docker --version
docker compose version

- name: Test
run: poetry run pytest -rP .
14 changes: 0 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,3 @@
__pycache__/
dist/
poetry.toml
.env
.pytest_cache/

# ignore example output files
examples/**/output.*

# ignore venv
venv/
.DS_Store

# ignore build artifacts and dependencies
Pipfile
Pipfile.lock
deepgram_sdk.egg-info/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Deepgram.
Copyright (c) 2026 Deepgram.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
66 changes: 34 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Comprehensive API documentation and guides are available at [developers.deepgram

### Migrating From Earlier Versions

- [v5 to v6](./docs/Migrating-v5-to-v6.md) (current)
- [v3+ to v5](./docs/Migrating-v3-to-v5.md)
- [v2 to v3+](./docs/Migrating-v2-to-v3.md)
- [v3+ to v5](./docs/Migrating-v3-to-v5.md) (current)

## Installation

Expand All @@ -26,8 +27,7 @@ pip install deepgram-sdk

## Reference

- **[API Reference](./reference.md)** - Complete reference for all SDK methods and parameters
- **[WebSocket Reference](./websockets-reference.md)** - Detailed documentation for real-time WebSocket connections
- **[API Reference](./reference.md)** - Complete reference for all SDK methods, parameters, and WebSocket connections

## Usage

Expand All @@ -37,7 +37,7 @@ The Deepgram SDK provides both synchronous and asynchronous clients for all majo

#### Real-time Speech Recognition (Listen v2)

Our newest and most advanced speech recognition model with contextual turn detection ([WebSocket Reference](./websockets-reference.md#listen-v2-connect)):
Our newest and most advanced speech recognition model with contextual turn detection ([Reference](./reference.md#listen-v2-connect)):

```python
from deepgram import DeepgramClient
Expand All @@ -48,7 +48,7 @@ client = DeepgramClient()
with client.listen.v2.connect(
model="flux-general-en",
encoding="linear16",
sample_rate="16000"
sample_rate=16000
) as connection:
def on_message(message):
print(f"Received {message.type} event")
Expand Down Expand Up @@ -118,39 +118,45 @@ response = client.read.v1.text.analyze(

#### Voice Agent (Conversational AI)

Build interactive voice agents ([WebSocket Reference](./websockets-reference.md#agent-v1-connect)):
Build interactive voice agents ([Reference](./reference.md#agent-v1-connect)):

```python
from deepgram import DeepgramClient
from deepgram.extensions.types.sockets import (
AgentV1SettingsMessage, AgentV1Agent, AgentV1AudioConfig,
AgentV1AudioInput, AgentV1Listen, AgentV1ListenProvider,
AgentV1Think, AgentV1OpenAiThinkProvider, AgentV1SpeakProviderConfig,
AgentV1DeepgramSpeakProvider
from deepgram.agent.v1.types import (
AgentV1Settings, AgentV1SettingsAgent,
AgentV1SettingsAgentListen, AgentV1SettingsAgentListenProvider_V1,
AgentV1SettingsAudio, AgentV1SettingsAudioInput,
)
from deepgram.types.think_settings_v1 import ThinkSettingsV1
from deepgram.types.think_settings_v1provider import ThinkSettingsV1Provider_OpenAi
from deepgram.types.speak_settings_v1 import SpeakSettingsV1
from deepgram.types.speak_settings_v1provider import SpeakSettingsV1Provider_Deepgram

client = DeepgramClient()

with client.agent.v1.connect() as agent:
settings = AgentV1SettingsMessage(
audio=AgentV1AudioConfig(
input=AgentV1AudioInput(encoding="linear16", sample_rate=44100)
settings = AgentV1Settings(
audio=AgentV1SettingsAudio(
input=AgentV1SettingsAudioInput(encoding="linear16", sample_rate=24000)
),
agent=AgentV1Agent(
listen=AgentV1Listen(
provider=AgentV1ListenProvider(type="deepgram", model="nova-3")
agent=AgentV1SettingsAgent(
listen=AgentV1SettingsAgentListen(
provider=AgentV1SettingsAgentListenProvider_V1(
type="deepgram", model="nova-3"
)
),
think=AgentV1Think(
provider=AgentV1OpenAiThinkProvider(
think=ThinkSettingsV1(
provider=ThinkSettingsV1Provider_OpenAi(
type="open_ai", model="gpt-4o-mini"
)
),
prompt="You are a helpful AI assistant.",
),
speak=AgentV1SpeakProviderConfig(
provider=AgentV1DeepgramSpeakProvider(
speak=SpeakSettingsV1(
provider=SpeakSettingsV1Provider_Deepgram(
type="deepgram", model="aura-2-asteria-en"
)
)
)
),
),
)

agent.send_settings(settings)
Expand All @@ -161,18 +167,14 @@ with client.agent.v1.connect() as agent:

For comprehensive documentation of all available methods, parameters, and options:

- **[API Reference](./reference.md)** - Complete reference for REST API methods including:
- **[API Reference](./reference.md)** - Complete reference for all SDK methods including:

- Listen (Speech-to-Text): File transcription, URL transcription, and media processing
- Speak (Text-to-Speech): Audio generation and voice synthesis
- Read (Text Intelligence): Text analysis, sentiment, summarization, and topic detection
- Manage: Project management, API keys, and usage analytics
- Auth: Token generation and authentication management

- **[WebSocket Reference](./websockets-reference.md)** - Detailed documentation for real-time connections:
- Listen v1/v2: Real-time speech recognition with different model capabilities
- Speak v1: Real-time text-to-speech streaming
- Agent v1: Conversational voice agents with integrated STT, LLM, and TTS
- WebSocket connections: Listen v1/v2, Speak v1, and Agent v1 real-time streaming

## Authentication

Expand Down Expand Up @@ -242,7 +244,7 @@ async def main():
async with client.listen.v2.connect(
model="flux-general-en",
encoding="linear16",
sample_rate="16000"
sample_rate=16000
) as connection:
async def on_message(message):
print(f"Received {message.type} event")
Expand Down Expand Up @@ -378,7 +380,7 @@ We welcome contributions to improve this SDK! However, please note that this lib

5. **Run examples**:
```bash
python -u examples/listen/v2/connect/main.py
python -u examples/07-transcription-live-websocket.py
```

### Contribution Guidelines
Expand Down
1 change: 1 addition & 0 deletions docs/Migrating-v2-to-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,3 +527,4 @@ result = deepgram.manage.v("1").get_balance("550e8400-e29b-41d4-a716-44665544000

- WebVTT and SRT captions are now available as a standalone package: [deepgram-python-captions](https://github.com/deepgram/deepgram-python-captions)
- Self-hosted API functionality remains unchanged but may have breaking changes in v4

1 change: 1 addition & 0 deletions docs/Migrating-v3-to-v5.md
Original file line number Diff line number Diff line change
Expand Up @@ -927,3 +927,4 @@ with client.agent.v1.connect() as agent:
- [ ] Update WebSocket keep alive implementation
- [ ] Update error handling for new exception types
- [ ] Test all functionality with new API structure

Loading