Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSONL stream #39478

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

JSONL stream #39478

wants to merge 15 commits into from

Conversation

kristapratico
Copy link
Member

@kristapratico kristapratico commented Jan 30, 2025

Part of #38806

Implements the design described in https://gist.github.com/kristapratico/d330af39962ea05b10384b865e37b36f

PR adds types for JSONL streaming, SSE will come later.

@kristapratico kristapratico changed the title Jsonl stream JSONL stream Jan 31, 2025
Copy link
Contributor

@iscai-msft iscai-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks great, thanks @kristapratico !

sdk/core/corehttp/corehttp/streaming/_events.py Outdated Show resolved Hide resolved
@kristapratico kristapratico marked this pull request as ready for review February 5, 2025 21:48

if decoder is not None:
self._decoder = decoder
elif self._response.headers.get("Content-Type", "").lower() == "application/jsonl":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would fail if the service provided any parameters in the MIME type. Should we make the decoder a required parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - making it required. The generated code should know which flavor of decoder to pass, anyway.

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

Successfully merging this pull request may close these issues.

4 participants