Skip to content

feat(http-client-python): generate structured JSONL and SSE response streams - #11595

Draft
Libba Lawrence (l0lawrence) wants to merge 1 commit into
mainfrom
l0lawrence-response-native-streaming
Draft

feat(http-client-python): generate structured JSONL and SSE response streams#11595
Libba Lawrence (l0lawrence) wants to merge 1 commit into
mainfrom
l0lawrence-response-native-streaming

Conversation

@l0lawrence

Copy link
Copy Markdown
Member

Summary

  • generate Azure-flavor JSONL and SSE response methods as standard Generator / AsyncGenerator values yielding deserialized models
  • keep transport-neutral incremental framing private in _utils/streaming.py, while generated operations own JSON parsing, event dispatch, terminal filtering, customization, and cleanup
  • preserve unbranded raw-byte response iteration and add emitter, framing, generated-adapter, and live Spector coverage

Validation

  • TypeScript emitter compile
  • full emitter tests: 13 passed
  • focused structured-streaming emitter tests: 7 passed
  • framing/generated-adapter unit tests: 11 passed
  • regenerated Azure streaming clients; live sync/async Spector tests: 7 passed
  • regenerated unbranded streaming clients; live raw-byte compatibility tests: 6 passed
  • ESLint passed
  • Prettier/Black formatting checks passed
  • Python source compileall passed

Validation caveats

  • broad Python unit collection requires unrelated generated specialwords fixtures removed by targeted regeneration; focused streaming tests passed
  • pylint, mypy, and pyright were unavailable in the existing local environment, and no dependency restore was performed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: e57edafe-9764-4b99-a1ae-0efd56e8729e
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@11595

commit: 35e4f02

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - feature ✏️

Generate structured JSONL (application/jsonl) and SSE (text/event-stream) response streams for the Azure flavor. Generated methods return standard Generator[T, None, None] or AsyncGenerator[T, None] values that yield deserialized model instances. Unbranded response streams remain raw-byte iterators.,> ,> python,> for thing in client.receive():,> ...,>

@azure-sdk-automation

Copy link
Copy Markdown

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Python emitter diff

Baseline gh:d914a19848834644d233fbcc57fdd1f6eb18b28e vs this PR.

Diff summary: 122 file(s), +12456 / -38

Rendered diff: inline on the run summary, or the emitter-diff-html artifact.

Informational check (eng/emitter-diff); does not block the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant