Skip to content

Document Python stream_abstraction config option - #6719

Merged
devalog merged 4 commits into
mainfrom
devin/1787418465-python-stream-abstraction
Aug 24, 2026
Merged

devalog merged 4 commits into
mainfrom
devin/1787418465-python-stream-abstraction

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

stream_abstraction is 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 event id, event type, and retry interval) through with_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, via close(), 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 — new stream_abstraction <ParamField> (alphabetical position, matching neighbors), with a with_metadata() snippet, the laziness/response-lifecycle behavior, AsyncStream awaitability, and the breaking-change reason for the false default.
  • 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

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

Copy link
Copy Markdown
Contributor

devalog and others added 3 commits August 24, 2026 17:12
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
devalog merged commit edb5a7f into main Aug 24, 2026
4 checks passed
@devalog
devalog deleted the devin/1787418465-python-stream-abstraction branch August 24, 2026 17:40
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.

1 participant