Skip to content

Commit b015e1f

Browse files
authored
feat: (regen) diarization v2 batch GA, listen-provider dedup, think/models route fix (#499)
## Summary Regenerate the SDK from the 2026-05-14 Fern build and reconcile the temporarily-frozen patches against the new generator output. ### Re-applied patches (existing freezes) - **`package.json`** — kept `@types/node ^20.17.57` pin, re-added `@commitlint/cli`, `@commitlint/config-conventional`, `tsx`, `playwright`, `vite`, `terser` (generator's `5.2.1` version bump kept). - **`src/api/.../keys/client/Client.ts`** — restored optional `request?` parameter to `manage.v1.projects.keys.create` (3 spots). - **`src/api/types/CreateKeyV1Request.ts`** — restored legacy `CreateKeyV1RequestOne` alias. - **`src/api/.../AgentV1Settings.ts`** — restored interface form of `Agent` with named sub-types + `AgentReference = Agent | string` opt-in alias. - **`src/api/.../AgentV1SettingsAgentListenProvider.ts`** — restored one-line alias to `AgentV1SettingsAgentContextListenProvider`. ### New freezes added this cycle - **`biome.json`** — generator emits `"vcs": { "enabled": false }`, which caused biome lint to scan the gitignored `examples/browser/deepgram.js` bundle. Restored `useIgnoreFile: true` and added to `.fernignore` so this patch survives the next regen. Documented in `AGENTS.md`. - **`src/api/.../AgentV1SettingsAgentContextListenProvider.ts`** — the 2026-05-14 regen dedup'd listen-provider sub-types into top-level `DeepgramListenProviderV1` / `DeepgramListenProviderV2` and dropped the nested `AgentV1SettingsAgentContextListenProviderV2.LanguageHint` namespace path. Restored the nested namespace as a one-line alias `type LanguageHint = DeepgramListenProviderV2.LanguageHint`. Regression coverage added in `tests/unit/compat-aliases.test.ts`. - **`src/Client.ts`** — generator switched the `client.fetch()` passthrough helper's default `baseUrl` from `env.base` (api.deepgram.com) to `env.agentRest` (agent.deepgram.com) after the upstream spec introduced the new `agentRest` slot for the think-models endpoint. The passthrough should default to the canonical Deepgram REST host. Reverted locally; likely a Fern generator artifact — drop this freeze when the upstream fix lands. ### Patches dropped None — every prior patch still addresses surface the new regen misses. ### Notable generator changes - **Intentional fix from [deepgram-docs#886](deepgram/deepgram-docs#886) + [#887](deepgram/deepgram-docs#887: `DeepgramEnvironment.Agent` removed; `Production` gained an `agentRest` slot; the `agent.v1.settings.think.models` endpoint now routes via HTTPS instead of WSS. Not a breaking change in practice — the old `DeepgramEnvironment.Agent` would have routed every REST client at `https://agent.deepgram.com` (404 on `/v1/listen`, etc.) and `think/models` was misrouted over WSS, so no consumer could have had a working flow through it. - New optional `diarize_model` field on `ListenV1RequestUrl` + `MediaTranscribeRequestOctetStream` (purely additive); new `MediaTranscribeRequestDiarizeModel` enum. - New top-level `DeepgramListenProviderV1` / `DeepgramListenProviderV2` exports. - Generator version bumped to `5.2.1`. - `pnpm-lock.yaml` rebuilt after the `package.json` reconciliation. ## Test plan - [x] `make build` passes (CJS + ESM + ESM validation) - [x] `make test` passes (535 unit tests + 132 wire tests, including 2 new regression cases for the `LanguageHint` shim) - [x] `make test-esm` passes (5 tests) - [x] `make lint` passes (warnings only, no errors) - [x] `make examples` — 30/36 pass against the real API; remaining 6 failures are env-config (missing `DEEPGRAM_PROJECT_ID`) or transient network, not regen-related - [x] Example 9 (Voice Agent) exercises the rerouted `agent.v1.settings.think.models.list()` endpoint and passes end-to-end - [x] All `.bak` files removed; `.fernignore` paths restored from `.bak` back to originals (plus 2 new freezes for `biome.json` and `AgentV1SettingsAgentContextListenProvider.ts`, plus 1 local-patch freeze for `Client.ts`)
2 parents 31ab1d1 + 56b8ce5 commit b015e1f

43 files changed

Lines changed: 856 additions & 305 deletions

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"shouldGenerateWebsocketClients": true,
1212
"enableForwardCompatibleEnums": true
1313
},
14-
"originGitCommit": "d1854cf6d560a0e27c9f46c1d83a6d7d9924f045",
14+
"originGitCommit": "abcbb3b91ae2fb48a85a3db83a94865804395740",
1515
"originGitCommitIsDirty": true,
1616
"invokedBy": "manual",
17-
"sdkVersion": "5.2.0"
17+
"sdkVersion": "5.2.1"
1818
}

.fernignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,29 @@ src/api/resources/agent/resources/v1/types/AgentV1Settings.ts
9696
# the new V2. Regression coverage in tests/unit/compat-aliases.test.ts.
9797
# Swap to .bak before regen.
9898
src/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.ts
99+
100+
# biome.json: Fern's generator emits `"vcs": { "enabled": false }`, which makes
101+
# biome lint every tracked-or-untracked file under the repo — including the
102+
# `examples/browser/deepgram.js` bundle produced by `make browser-serve`, which
103+
# is .gitignored but not biome-ignored. We restore `useIgnoreFile: true` so the
104+
# generated browser artifact stays out of lint. Swap to .bak before regen.
105+
biome.json
106+
107+
# src/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.ts:
108+
# the 2026-05-14 regen consolidated listen-provider sub-types into top-level
109+
# DeepgramListenProviderV1/V2 and dropped the nested
110+
# `AgentV1SettingsAgentContextListenProviderV2.LanguageHint` namespace path.
111+
# We restore the nested namespace as a one-line alias to
112+
# DeepgramListenProviderV2.LanguageHint so deep imports keep resolving.
113+
# Regression coverage in tests/unit/compat-aliases.test.ts.
114+
# Swap to .bak before regen.
115+
src/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.ts
116+
117+
# src/Client.ts: the 2026-05-14 regen switched the `client.fetch()` passthrough
118+
# helper's default baseUrl from `base` (api.deepgram.com) to `agentRest`
119+
# (agent.deepgram.com) after the upstream spec introduced the new agentRest
120+
# slot. The passthrough is documented as the catch-all for endpoints not yet
121+
# supported in the SDK and should default to the canonical Deepgram REST host.
122+
# Likely a Fern generator artifact — when the upstream fix lands, drop this
123+
# entry. Swap to .bak before regen.
124+
src/Client.ts

AGENTS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ Current temporarily frozen files:
6464
- `src/api/types/CreateKeyV1Request.ts` — preserve the old exported `CreateKeyV1RequestOne` alias alongside `CreateKeyV1Request` so existing type imports keep compiling.
6565
- `src/api/resources/agent/resources/v1/types/AgentV1Settings.ts` — backward-compat patch for the `AgentV1Settings.Agent` namespace. The 2026-05-06 regen restructured `Agent` from an interface with named sub-types into a union with anonymous shapes plus a string variant (`{...} | string`) for the new agent-by-ID-string flow. We restore the original interface form so existing imports of the sub-types (`Agent.Context`, `Agent.Listen`, `Agent.Think`, `Agent.Speak`, `Agent.Context.Messages.Item`) AND direct field reads (`settings.agent.context`, `.greeting`, etc.) keep compiling in TS strict mode without a `typeof` narrowing guard. The new agent-by-ID-string variant is surfaced as the opt-in `AgentReference = Agent | string` alias for callers who want to pass a string ID at the type level. Mirrors the Python SDK's compat shims for the same regen. Regression coverage in `tests/unit/compat-aliases.test.ts`.
6666
- `src/api/resources/agent/resources/v1/types/AgentV1SettingsAgentListenProvider.ts` — backward-compat alias for the type renamed by the 2026-05-06 regen to `AgentV1SettingsAgentContextListenProvider`. The new V2 only adds an optional `language_hint` field, so the regenerated duplicate is replaced with a one-line `type AgentV1SettingsAgentListenProvider = AgentV1SettingsAgentContextListenProvider` (plus namespace merge for `.V1`/`.V2` access). Purely additive at the type level — pinned-name callers (`const p: AgentV1SettingsAgentListenProvider = ...`) keep compiling without a cast. Regression coverage in `tests/unit/compat-aliases.test.ts`.
67+
- `biome.json` — Fern's generator emits `"vcs": { "enabled": false }`, which makes biome lint every tracked-or-untracked file under the repo, including `examples/browser/deepgram.js` (the bundle produced by `make browser-serve`, which is `.gitignore`d but not biome-ignored). We restore `clientKind: "git"`, `enabled: true`, `useIgnoreFile: true` so generated browser artifacts stay out of lint.
68+
- `src/api/resources/agent/resources/v1/types/AgentV1SettingsAgentContextListenProvider.ts` — backward-compat shim for the listen-provider dedup in the 2026-05-14 regen. The new spec consolidated 5 PascalCase listen-provider types into top-level `DeepgramListenProviderV1` / `DeepgramListenProviderV2` and dropped the nested `AgentV1SettingsAgentContextListenProviderV2.LanguageHint` namespace path. We restore the nested namespace as a one-line alias `type LanguageHint = DeepgramListenProviderV2.LanguageHint` inside the outer namespace so deep import paths keep resolving. Regression coverage in `tests/unit/compat-aliases.test.ts`.
69+
- `src/Client.ts` — patch for the `client.fetch()` passthrough helper's default `baseUrl`. The 2026-05-14 regen switched this default from `env.base` (api.deepgram.com) to `env.agentRest` (agent.deepgram.com) after the upstream spec introduced the new `agentRest` slot for the think-models endpoint. The passthrough is documented as the catch-all for "endpoints not yet supported in the SDK" and should default to the canonical Deepgram REST host, not the agent host. Likely a Fern generator artifact — when the upstream fix lands, drop this entry.
6770

6871
**Note:** If you need to patch a Fern-generated file, add it to `.fernignore` with a comment describing the patch, and add it to the "temporarily frozen" list above.
6972

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deepgram/sdk",
3-
"version": "5.2.0",
3+
"version": "5.2.1",
44
"private": false,
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)