Skip to content

feat(agent): support multi-provider speak/think configuration and typed listen parameters#676

Merged
lukeocodes merged 5 commits intomainfrom
lo/sdk-gen-2026-03-26
Mar 26, 2026
Merged

feat(agent): support multi-provider speak/think configuration and typed listen parameters#676
lukeocodes merged 5 commits intomainfrom
lo/sdk-gen-2026-03-26

Conversation

@lukeocodes
Copy link
Copy Markdown
Member

@lukeocodes lukeocodes commented Mar 26, 2026

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.24.62.0, CLI 3.77.14.46.0

Manual patches re-applied

  • floatint 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

  • ruff check passes
  • mypy passes (844 source files)
  • 72 custom tests pass
  • 28/29 wire tests pass (1 Fern datetime bug)

Swap temporarily frozen .fernignore entries to .bak paths so the Fern
generator can overwrite the originals. Our manually-patched versions
are preserved as .bak files for post-regen comparison.
Copilot AI review requested due to automatic review settings March 26, 2026 09:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR appears to prepare the repo for a Fern SDK regeneration by “freezing” the current manually-patched versions of several generated files (as *.bak) and updating .fernignore to point at those backups.

Changes:

  • Added *.bak copies of several previously patched Fern-generated files (socket clients, listen types, listen clients).
  • Added *.bak copies of WireMock mappings and a Wire test file used in the wiremock-based suite.
  • Updated .fernignore entries to ignore the .bak paths (temporarily freezing them during regeneration).

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.fernignore Switches ignore targets from original files to *.bak backups to preserve patches during regen.
wiremock/wiremock-mappings.json.bak Backup of WireMock mappings (to preserve pre-regen patched version).
tests/wire/test_listen_v1_media.py.bak Backup of wire test (to preserve pre-regen patched version).
src/deepgram/speak/v1/socket_client.py.bak Backup of patched Speak WS client.
src/deepgram/listen/v1/socket_client.py.bak Backup of patched Listen v1 WS client.
src/deepgram/listen/v2/socket_client.py.bak Backup of patched Listen v2 WS client.
src/deepgram/agent/v1/socket_client.py.bak Backup of patched Agent WS client (incl. numeric sanitization patch).
src/deepgram/listen/v1/client.py.bak Backup of patched Listen v1 client (query array param support).
src/deepgram/listen/v2/client.py.bak Backup of patched Listen v2 client (query array param support).
src/deepgram/types/listen_v1response_results_utterances_item.py.bak Backup of patched type (int vs float corrections).
src/deepgram/types/listen_v1response_results_utterances_item_words_item.py.bak Backup of patched type (int vs float corrections).
src/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py.bak Backup of patched type (int vs float corrections).
src/deepgram/types/listen_v1redact.py.bak Backup of patched redact type (Union/Sequence support).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

.fernignore Outdated
Comment on lines +22 to +26
# [temporarily frozen — .bak preserves our patches during regen]
src/deepgram/speak/v1/socket_client.py.bak
src/deepgram/listen/v1/socket_client.py.bak
src/deepgram/listen/v2/socket_client.py.bak
src/deepgram/agent/v1/socket_client.py.bak
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These newly added src/deepgram/**.py.bak files live inside the published deepgram package directory (see pyproject.toml package include config). With no packaging excludes configured, they are likely to be shipped in the wheel/sdist. If these backups are intended to be temporary for regeneration, consider keeping them outside src/ or adding an explicit packaging exclude for *.bak, and make sure they’re removed before merging/releasing.

Copilot uses AI. Check for mistakes.
.fernignore Outdated
Comment on lines +7 to +14
# WireMock mappings: removed duplicate empty-body /v1/listen stub that causes
# non-deterministic matching failures
wiremock/wiremock-mappings.json
# [temporarily frozen — .bak preserves our patch during regen]
wiremock/wiremock-mappings.json.bak

# Wire test with manual fix: transcribe_file() requires request=bytes parameter
tests/wire/test_listen_v1_media.py
# [temporarily frozen — .bak preserves our patch during regen]
tests/wire/test_listen_v1_media.py.bak
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says this adds support for the new "Think" agent message type, but the only functional change here is swapping .fernignore entries to point at .bak backups (plus adding those backup files). If this PR is just the "prepare repo for regeneration" step, please update the PR description/title accordingly and ensure a follow-up commit in this PR restores .fernignore to the real paths and removes the .bak files before merging; otherwise this PR won’t actually deliver the stated feature support.

Copilot uses AI. Check for mistakes.
@lukeocodes lukeocodes force-pushed the lo/sdk-gen-2026-03-26 branch from efdc2b3 to 78846e8 Compare March 26, 2026 16:54
fern-api bot and others added 2 commits March 26, 2026 18:56
- Float→int type fixes for speaker/channel/num_words fields
- _sanitize_numeric_types helper in agent socket client
- construct_type keyword arg fix (generator uses positional, function requires keyword-only)
- Broad exception catch in socket clients (supports custom transports)
- Remove .bak files and update .fernignore
@lukeocodes lukeocodes force-pushed the lo/sdk-gen-2026-03-26 branch from 1db521e to 0e2a77a Compare March 26, 2026 19:43
@lukeocodes lukeocodes changed the title chore: SDK regeneration 2026-03-26 feat(agent): support multi-provider speak/think configuration and typed listen parameters Mar 26, 2026
Fern generator 4.62.0 serializes datetimes without milliseconds
(2024-01-15T09:30:00Z) but generated the WireMock stub expecting
milliseconds (.000Z). Updated stub to match.
@lukeocodes lukeocodes merged commit 5dfb1aa into main Mar 26, 2026
14 checks passed
@lukeocodes lukeocodes deleted the lo/sdk-gen-2026-03-26 branch March 26, 2026 20:00
lukeocodes pushed a commit that referenced this pull request Mar 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[6.1.0](v6.0.1...v6.1.0)
(2026-03-26)


### Features

* **agent:** support multi-provider speak/think configuration and typed
listen parameters
([#676](#676))
([5dfb1aa](5dfb1aa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants