This SDK is generated by Fern. Most files under src/deepgram/ are auto-generated and should not be edited directly. Some files have manual patches and are listed in .fernignore to prevent the generator from overwriting them.
When a new Fern generator release is available, we prepare the repo so the generator can overwrite previously-frozen files, then re-apply manual patches after reviewing the diff.
Every entry in .fernignore falls into one of two categories. The comment above each entry in .fernignore indicates which category it belongs to, but when in doubt, apply these rules:
These files are entirely hand-written — they have no Fern-generated counterpart. The generator would delete or replace them with something unrelated. They must stay in .fernignore at all times.
How to identify:
- The file was created by us, not by Fern (e.g.,
src/deepgram/client.py, custom tests, helpers, transport layer) - The file is a doc, config, or folder we maintain independently (README, CHANGELOG, .github, examples, etc.)
- The file lives outside
src/deepgram/in a hand-maintained location (e.g.,.claude/,docs/)
Current permanently frozen files:
src/deepgram/client.py— entirely custom (Bearer auth, session ID); no Fern equivalentsrc/deepgram/helpers/— hand-written TextBuilder helperssrc/deepgram/transport_interface.py,src/deepgram/transport.py,src/deepgram/transports/— custom transport layertests/custom/test_text_builder.py,tests/custom/test_transport.py— hand-written teststests/manual/— manual standalone testsREADME.md,CHANGELOG.md,CONTRIBUTING.md,reference.md— docsCLAUDE.md,AGENTS.md,.claude/— agent files.github/,docs/,examples/— folders
These files are Fern-generated but carry manual patches to fix issues in the generator output. We freeze them to protect our patches between regenerations, but unfreeze them before a regen so we can compare the new output against our patches.
How to identify:
- The file exists in Fern's output — if you removed it from
.fernignoreand ran the generator, Fern would produce a version of it - Our version is a modified copy of what Fern generates (e.g., changed
floattoint, added optional defaults, broadened a Union type)
Current temporarily frozen files:
src/deepgram/speak/v1/socket_client.py— optional message param defaults, broad exception catchsrc/deepgram/listen/v1/socket_client.py— same +construct_typefor unknown WS messagessrc/deepgram/listen/v2/socket_client.py— samesrc/deepgram/agent/v1/socket_client.py— same +_sanitize_numeric_typessrc/deepgram/types/listen_v1response_results_utterances_item.py—float→intfixsrc/deepgram/types/listen_v1response_results_utterances_item_words_item.py—float→intfixsrc/deepgram/types/listen_v1response_results_channels_item_alternatives_item_paragraphs_paragraphs_item.py—float→intfixsrc/deepgram/types/listen_v1redact.py— Union[str, Sequence[str]] supportsrc/deepgram/listen/v1/client.py— Union[str, Sequence[str]] array param supportsrc/deepgram/listen/v2/client.py— sametests/wire/test_listen_v1_media.py—transcribe_file()bytes param fixwiremock/wiremock-mappings.json— removed duplicate stub
- Create a new branch off
mainnamedlo/sdk-gen-<YYYY-MM-DD>. - Push the branch and create a PR titled
chore: SDK regeneration <YYYY-MM-DD>(empty commit if needed). - Read
.fernignoreand classify each entry using the rules above. - For each temporarily frozen file only:
- Copy the file to
<filename>.bakalongside the original. - In
.fernignore, replace the original path with the.bakpath. This protects our patched version from the generator while allowing Fern to overwrite the original.
- Copy the file to
- Never touch permanently frozen entries. Leave them in
.fernignoreas-is. - Commit as
chore: unfreeze files pending regenand push. - The branch is now ready for the Fern generator to push changes.
The .bak files are our manually-patched versions (protected by .fernignore). The original paths now contain the freshly generated versions. By comparing the two, we can see what the generator now produces vs what we had patched.
- Diff each
.bakfile against the new generated version to understand what changed and whether our patches are still needed. - Re-apply any patches that are still necessary to the newly generated files.
- In
.fernignore, replace each.bakpath back to the original path for any files that still need manual patches. - Remove
.fernignoreentries entirely for any files where the generator now produces correct output (patches no longer needed). - Delete all
.bakfiles once review is complete. - Run tests (
pytest) and linting (ruff check,mypy) to verify. - Commit as
chore: re-apply manual patches after regenand push.