-
-
Notifications
You must be signed in to change notification settings - Fork 148
[Platform] Streamline RawHttpResult for streaming
#1191
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
base: main
Are you sure you want to change the base?
[Platform] Streamline RawHttpResult for streaming
#1191
Conversation
RawHttpResult for streaming
|
Can you please rebase? |
a325bd0 to
9ac792b
Compare
Fix: - Skip SSE comments - Skip SSE errors - Drop manual JSON convert process - Use JSON decode from the ServerSentEvent
9ac792b to
1645be2
Compare
done. The workflow errors are not related to my changes... |
|
Lets merge #1204 first, rebase and adjust the testcase |
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
|
I merged my PR, can you please update the test? thanks |
| // Split in case of multiple JSON objects | ||
| $deltas = explode(",\r\n", $jsonDelta); | ||
|
|
||
| foreach ($deltas as $delta) { | ||
| if ('' === trim($delta)) { | ||
| continue; | ||
| } | ||
|
|
||
| yield json_decode($delta, true, flags: \JSON_THROW_ON_ERROR); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason for removing this?
there is no replacement for this part or do i miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
background for having this was gemini api streaming parts of a larger json document - which cannot be decoded right away - testing with examples/gemini/stream.php might help
Fix:
: OPENROUTER PROCESSINGhttps://openrouter.ai/docs/api/reference/streaming#additional-information