Skip to content

Conversation

@lochmueller
Copy link
Contributor

@lochmueller lochmueller commented Dec 18, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
Issues
License MIT

Fix:

  • Skip SSE comments in processing
  • Skip SSE errors in processing
  • Use getArrayData (JSON convert) in case of real SSE in RawHttpResult (Use JSON decode process from the ServerSentEvent)
  • Keep the manual json decode process of single data chunks (incl. the "Single items" handling of Google)
  • Fix also problems, if Provider like OpenRouter send comments like : OPENROUTER PROCESSING https://openrouter.ai/docs/api/reference/streaming#additional-information

@carsonbot carsonbot added Status: Needs Review Bug Something isn't working Platform Issues & PRs about the AI Platform component labels Dec 18, 2025
@OskarStark OskarStark changed the title [Platform] Streamline RawHttpResult for streaming [Platform] Streamline RawHttpResult for streaming Dec 18, 2025
@OskarStark
Copy link
Contributor

Can you please rebase?

@lochmueller lochmueller requested a review from Nyholm as a code owner December 18, 2025 12:40
@lochmueller lochmueller force-pushed the feature/streamline-raw-http-result branch 2 times, most recently from 9ac792b to 1645be2 Compare December 18, 2025 12:48
@lochmueller
Copy link
Contributor Author

Can you please rebase?

done. The workflow errors are not related to my changes...

@OskarStark
Copy link
Contributor

Lets merge #1204 first, rebase and adjust the testcase

OskarStark added a commit that referenced this pull request Dec 18, 2025
This PR was merged into the main branch.

Discussion
----------

[Platform] Add test for `RawHttpResult`

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Docs?         | no
| Issues        | --
| License       | MIT

Should be merged before #1191

Commits
-------

ff0ec93 [Platform] Add test for RawHttpResult
@OskarStark
Copy link
Contributor

I merged my PR, can you please update the test? thanks

Fix:
- Skip SSE comments
- Skip SSE errors
- Drop manual JSON convert process
- Use JSON decode from the ServerSentEvent
Re add the Google specific changes but split a real SSE and a Data
chunk in two processes.
@OskarStark
Copy link
Contributor

Can you cover this by tests?

@lochmueller
Copy link
Contributor Author

Hey @OskarStark
yes... but this is still a problem: #1184
Gemini send incomplete chunks, that we "can use" in streaming mode... but there should be some kind of fallback, that we buffer the information if the JSON decode do not work. I will add that and try to add some examples for different SSE event structures, especially for Gemini.
Regards, Tim

Others have also problems with the API specific behavior of google: googleapis/python-genai#1162
Notes: https://developer.chrome.com/docs/ai/streaming?hl=de

@chr-hertel
Copy link
Member

Please have a look as well at #754 and my latest comment there - not in conflict I think, but related

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

Labels

Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Needs Review Status: Needs Work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants