Skip to content

fix: parse Server-Sent Events in Agent Engine streaming responses - #7049

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_959194089
Open

fix: parse Server-Sent Events in Agent Engine streaming responses#7049
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_959194089

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: parse Server-Sent Events in Agent Engine streaming responses

Agent Engine streaming responses are newline-delimited JSON. A response may
instead arrive as Server-Sent Events, with each JSON object wrapped in a
data: frame. The streaming readers now remove that framing before parsing, so
both shapes yield the same parsed objects rather than raw data: {...}
strings, and the HttpBody reader parses a text/event-stream response rather
than yielding the unparsed message.

Newline-delimited JSON responses are unaffected.

@copybara-service
copybara-service Bot requested a review from a team as a code owner August 4, 2026 21:10
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Aug 4, 2026
@copybara-service
copybara-service Bot force-pushed the copybara_959194089 branch 3 times, most recently from c8a7b6f to 4a1f38a Compare August 4, 2026 22:40
Agent Engine streaming responses are newline-delimited JSON. A response may
instead arrive as Server-Sent Events, with each JSON object wrapped in a
`data:` frame. The streaming readers now remove that framing before parsing, so
both shapes yield the same parsed objects rather than raw `data: {...}`
strings, and the `HttpBody` reader parses a `text/event-stream` response rather
than yielding the unparsed message.

Newline-delimited JSON responses are unaffected.

PiperOrigin-RevId: 959194089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. google-contributor size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant