Skip to content

fix: Add pluggable stream parser for Gemini JSON array streaming#26

Merged
nyo16 merged 1 commit intomasterfrom
fix/gemini-streaming-json-array-parser
Mar 5, 2026
Merged

fix: Add pluggable stream parser for Gemini JSON array streaming#26
nyo16 merged 1 commit intomasterfrom
fix/gemini-streaming-json-array-parser

Conversation

@nyo16
Copy link
Copy Markdown
Owner

@nyo16 nyo16 commented Mar 5, 2026

Gemini's streamGenerateContent endpoint returns a JSON array by default, not SSE. Instead of forcing SSE with alt=sse, this adds a proper JSON array stream parser and makes HTTP.stream's buffer parser pluggable.

  • Add Nous.Providers.HTTP.JSONArrayParser for JSON array responses
  • Add :stream_parser option to HTTP.stream/4 (defaults to SSE)
  • Gemini provider uses JSONArrayParser for native format support
  • 18 new tests for the JSON array parser

Bumps version to 0.12.2.

Gemini's streamGenerateContent endpoint returns a JSON array by default,
not SSE. Instead of forcing SSE with alt=sse, this adds a proper JSON
array stream parser and makes HTTP.stream's buffer parser pluggable.

- Add Nous.Providers.HTTP.JSONArrayParser for JSON array responses
- Add :stream_parser option to HTTP.stream/4 (defaults to SSE)
- Gemini provider uses JSONArrayParser for native format support
- 18 new tests for the JSON array parser

Bumps version to 0.12.2.
@nyo16 nyo16 merged commit f7a9b8d into master Mar 5, 2026
6 checks passed
@nyo16 nyo16 deleted the fix/gemini-streaming-json-array-parser branch March 5, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant