Skip to content

Commit 5dfb1aa

Browse files
feat(agent): support multi-provider speak/think configuration and typed listen parameters (#676)
## Summary - **Agent multi-provider TTS**: Configurable speak providers (AWS Polly, Cartesia, Deepgram, ElevenLabs, OpenAI) with endpoint settings and runtime updates - **Agent think restructured**: Multi-provider think settings with per-item configuration - **Typed listen parameters**: v1/v2 listen clients now use typed aliases (`ListenV1Model`, `ListenV2Encoding`, etc.) instead of raw strings — backward-compatible - **Native unknown WS message handling**: Generator now includes try/except with logging across all socket clients - **Fern generator upgrade**: `4.57.2` → `4.62.0`, CLI `3.77.1` → `4.46.0` ## Manual patches re-applied - `float` → `int` type fixes for `speaker`, `channel`, `num_words` fields (3 type files) - `_sanitize_numeric_types` helper in agent socket client - `construct_type` keyword arg fix — generator uses positional args but function signature is keyword-only - Broad `except Exception` catch in socket clients to support custom transports ## Known issues - 1 wire test failure (`test_manage_v1_projects_requests_list_`): Fern datetime serialization drops milliseconds, mismatching its own WireMock stub — Fern generator bug, not SDK ## Test plan - [x] `ruff check` passes - [x] `mypy` passes (844 source files) - [x] 72 custom tests pass - [x] 28/29 wire tests pass (1 Fern datetime bug) --------- Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 74f48c5 commit 5dfb1aa

386 files changed

Lines changed: 7398 additions & 2579 deletions

File tree

Some content is hidden

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

.fern/metadata.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"cliVersion": "3.77.1",
2+
"cliVersion": "4.46.0",
33
"generatorName": "fernapi/fern-python-sdk",
4-
"generatorVersion": "4.57.2",
4+
"generatorVersion": "4.62.0",
55
"generatorConfig": {
66
"client": {
77
"class_name": "BaseClient",
@@ -16,5 +16,6 @@
1616
"skip_validation": true
1717
}
1818
},
19-
"sdkVersion": "6.0.1"
19+
"originGitCommit": "879c76c78827f323e425c1640f76a6e50d6c68d3",
20+
"sdkVersion": "6.0.2"
2021
}

.fernignore

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,22 @@
44
# This file is manually maintained and should not be regenerated
55
src/deepgram/client.py
66

7-
# WireMock mappings: removed duplicate empty-body /v1/listen stub that causes
8-
# non-deterministic matching failures
9-
wiremock/wiremock-mappings.json
10-
11-
# Wire test with manual fix: transcribe_file() requires request=bytes parameter
12-
tests/wire/test_listen_v1_media.py
13-
147
# WebSocket socket clients:
15-
# - Optional message parameter defaults for send_flush, send_close, send_clear,
16-
# send_finalize, send_close_stream, send_keep_alive
17-
# - construct_type instead of parse_obj_as (skip_validation for unknown WS messages)
18-
# - except Exception (broad catch for custom transports)
8+
# - construct_type keyword args fix (generator uses positional, function requires keyword-only)
9+
# - except Exception broad catch (supports custom transports, generator narrows to WebSocketException)
1910
# - _sanitize_numeric_types in agent socket client (float→int for API)
20-
src/deepgram/speak/v1/socket_client.py
11+
# [temporarily frozen — generator bugs in construct_type call convention and exception handling]
12+
src/deepgram/agent/v1/socket_client.py
2113
src/deepgram/listen/v1/socket_client.py
2214
src/deepgram/listen/v2/socket_client.py
23-
src/deepgram/agent/v1/socket_client.py
15+
src/deepgram/speak/v1/socket_client.py
2416

2517
# Type files with manual int type corrections (Fern generates float for speaker/channel/num_words)
18+
# [temporarily frozen — waiting on internal-api-specs#205]
2619
src/deepgram/types/listen_v1response_results_utterances_item.py
2720
src/deepgram/types/listen_v1response_results_utterances_item_words_item.py
2821
src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py
2922

30-
# Redact type with Union[str, Sequence[str]] support (Fern narrows to Union[Literal, Any])
31-
src/deepgram/types/listen_v1redact.py
32-
33-
# Listen client files with Union[str, Sequence[str]] array param support
34-
src/deepgram/listen/v1/client.py
35-
src/deepgram/listen/v2/client.py
36-
3723
# Hand-written custom tests
3824
tests/custom/test_text_builder.py
3925
tests/custom/test_transport.py
@@ -75,4 +61,4 @@ AGENTS.md
7561
# Folders to ignore
7662
.github
7763
docs
78-
examples
64+
examples

poetry.lock

Lines changed: 181 additions & 165 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44

55
[tool.poetry]
66
name = "deepgram-sdk"
7-
version = "6.0.1"
7+
version = "6.0.2"
88
description = ""
99
readme = "README.md"
1010
authors = []

0 commit comments

Comments
 (0)