Document Python stream_abstraction config option - #6719
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
🌿 Preview your docs: https://fern-preview-devin-1787418465-python-stream-abstraction.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devalog
approved these changes
Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
stream_abstractionis a new Python SDK generator option that gives streaming endpoints a real stream object instead of a bare generator. With it enabled, SSE consumers can read event metadata (the eventid,eventtype, andretryinterval) throughwith_metadata()— a supported public API — rather than reaching into SDK internals to re-parse the raw response. The stream also owns the HTTP response and releases it for them (on exhaustion, on error, viaclose(), or as a context manager), and stays lazy so errors still surface on first iteration. It's off by default because turning it on changes the return type of streaming methods.Implements docs for: feat(python): add stream_abstraction for SSE event metadata (fern-api/fern#17482)
Pages changed:
fern/products/sdks/generators/python/configuration.mdx— newstream_abstraction<ParamField>(alphabetical position, matching neighbors), with awith_metadata()snippet, the laziness/response-lifecycle behavior,AsyncStreamawaitability, and the breaking-change reason for thefalsedefault.fern/products/sdks/deep-dives/sse-metadata.mdx— Python added to the metadata-aware iteration section (this is where a customer looks for SSE metadata; TypeScript and Go were already there), plus the version note now covers Python 5.29.0+ and links to the config option that gates it.No SDK changelog entry, per the generator changelog being handled separately.
Link to Devin session: https://app.devin.ai/sessions/49f2b332dc3147dd971e9b371031f8b8