diff --git a/AGENTS.md b/AGENTS.md index 5ec640ed..50530d7a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,9 +83,9 @@ Current temporarily frozen files: - `src/deepgram/listen/v2/types/listen_v2connected.py`, `src/deepgram/listen/v2/types/listen_v2turn_info.py`, `src/deepgram/listen/v2/types/listen_v2turn_info_words_item.py`, `src/deepgram/listen/v2/types/listen_v2configure_success.py`, `src/deepgram/listen/v2/types/listen_v2configure_success_thresholds.py`, `src/deepgram/listen/v2/types/listen_v2configure_failure.py`, `src/deepgram/listen/v2/types/listen_v2fatal_error.py`, `src/deepgram/listen/v2/types/listen_v2warning.py` — read-side compatibility for the SDK 7.7 Listen V2 response retype. Through 7.6, `V2SocketClientResponse` contained `typing.Any`, so every response was returned as a raw dict; fixing the union made responses typed models and broke callers using `response["field"]`. These generated response classes inherit the hand-written base above, preserving read-only wire-key subscript access alongside canonical attribute access. Restore direct `UncheckedBaseModel` inheritance and unfreeze these files in the next major release. - `src/deepgram/types/deepgram_listen_provider_v2.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_listen_provider.py`, `src/deepgram/agent/v1/types/agent_v1settings_agent_context_listen_provider.py` — behavioural back-compat shim for the `language_hint` -> `language_hints` rename (2026-06-15 regen). The public field was historically (incorrectly) singular and accepted a str or a list; the API field is `language_hints` (a list, and the server uses `deny_unknown_fields` so the singular key is rejected on the wire). Each carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that remaps a legacy `language_hint=` kwarg and drops the dead singular key. Remove and unfreeze the language alias when it is retired in a future major. - `src/deepgram/types/shared_topics.py`, `src/deepgram/types/shared_intents.py`, `src/deepgram/requests/shared_topics.py`, `src/deepgram/requests/shared_intents.py`, and the generated root/type/request barrels — direct Topics and Intents segments plus their generated exports remain Fern-owned, but carry the v7 deprecated `results` construction facade and Params shape for the hand-written wrappers above. The models normalize legacy `results.{topics,intents}.segments` input to direct `segments` while preserving direct fields and deprecated read facades. Freeze these generated files during the parent reconciliation; retain all direct generated segments and exports alongside the compatibility surface. -- `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained `7.20.0` fallback carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. +- `src/deepgram/core/client_wrapper.py` — Fern's `runtime_version: true` wrapper correctly uses installed package metadata, but its `PackageNotFoundError` fallback must remain the latest published version for source checkouts, vendored copies, zipapps, and frozen bundles. The retained fallback (always the latest published version, never a hardcoded number here) carries `# x-release-please-version`, and `.github/release-please-config.json` includes the file as a generic extra file so Release Please updates it with `pyproject.toml` and `.fern/metadata.json`. Unfreeze when Fern emits a release-managed fallback. - `src/deepgram/speak/v2/types/speak_v2warning.py`, `src/deepgram/speak/v2/requests/speak_v2warning.py`, `src/deepgram/agent/v1/types/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/agent/v1/requests/agent_v1inject_dynamic_agent_message.py`, `src/deepgram/listen/v1/types/listen_v1configure_failure.py`, `src/deepgram/listen/v1/requests/listen_v1configure_failure.py` — whitespace cleanup for generated docstrings. Unfreeze when Fern emits whitespace-clean output. -- `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.20 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. Every argument defaults to the `OMIT` sentinel, so an explicit `None` uniformly means a null value rather than an omitted one, and `request=None` still sends the empty body it did on 7.20. `comment` and `scopes` had to be widened to optional to accept the legacy form, which costs mypy's missing-argument check, but only for code importing `KeysClient`/`RawKeysClient` directly: `BaseClient.manage` has no return annotation, so `client.manage.v1.projects.keys.create` was always `Any` to mypy. A runtime `TypeError` naming the argument covers both paths. Body-level coverage is `tests/custom/test_create_key_legacy_request.py`, which mutation-tests the merge and passthrough branches; `tests/wire/test_manage_v1_projects_keys.py` only counts requests. Remove and unfreeze when the legacy call shape is retired in a future major. +- `src/deepgram/manage/v1/projects/keys/client.py`, `src/deepgram/manage/v1/projects/keys/raw_client.py` — backward-compat patch for the 2026-12-01 create-key signature change. The generated `create()` now takes `comment`/`scopes`/`tags`/`expiration_date`/`time_to_live_in_seconds` as keyword arguments, which raises `TypeError` for every caller written against 7.21 or earlier. Both files carry a hand-added optional `request` argument, and `raw_client.py` carries `_build_create_key_body`, which forwards the legacy mapping verbatim (it was typed `Any` and never validated) with explicit keyword arguments applied on top. Every argument defaults to the `OMIT` sentinel, so an explicit `None` uniformly means a null value rather than an omitted one, and `request=None` still sends the empty body it did on 7.21 and earlier. `comment` and `scopes` had to be widened to optional to accept the legacy form, which costs mypy's missing-argument check, but only for code importing `KeysClient`/`RawKeysClient` directly: `BaseClient.manage` has no return annotation, so `client.manage.v1.projects.keys.create` was always `Any` to mypy. A runtime `TypeError` naming the argument covers both paths. Body-level coverage is `tests/custom/test_create_key_legacy_request.py`, which mutation-tests the merge and passthrough branches; `tests/wire/test_manage_v1_projects_keys.py` only counts requests. Remove and unfreeze when the legacy call shape is retired in a future major. - `src/deepgram/agent/v1/types/agent_v1update_listen_listen.py` — backward-compat patch for the 2026-07-31 `AgentV1UpdateListen` provider retype. The `provider` field changed from a bare `DeepgramListenProviderV2` to the required discriminated union `AgentV1UpdateListenListenProvider` (`_V1`/`_V2`, discriminant `version`). Carries a hand-added `model_validator(mode='before')` / `root_validator(pre=True)` that coerces a legacy `DeepgramListenProviderV1`/`V2` (or a dict lacking the `version` discriminant) into the new shape so existing callers keep working. Remove and unfreeze when the old provider payloads are retired in a future major. NOTE: this patch was silently lost once (it was absent from `.fernignore`, so a regen overwrote it) — keep it frozen. - `src/deepgram/agent/v1/types/agent_v1conversation_text.py`, `src/deepgram/agent/v1/requests/agent_v1conversation_text.py` — compatibility for the 2026-10 Think Live schema update that made `conversational_behavior` required. The runtime response model defaults an omitted field to `"default"` so older/self-hosted server payloads continue to parse, while the request TypedDict accepts the pre-update shape for typed callers. SDK-created runtime models still serialize the current wire-required field. Remove and unfreeze when those legacy payloads are retired. - `tests/wire/test_manage_v1_projects_keys.py` — restored wire coverage for the legacy `CreateKeyV1RequestOneParams` request alias so future regens do not silently drop that compatibility check diff --git a/reference.md b/reference.md index 22c7be03..bcd8ec57 100644 --- a/reference.md +++ b/reference.md @@ -1529,9 +1529,6 @@ client.manage.v1.projects.keys.create(