Skip to content

Conversation

@ktdjiren
Copy link

@ktdjiren ktdjiren commented Jul 4, 2025

This PR fixes a JSON parsing issue that arises due to improperly formatted or incomplete chunks in the streaming API response from OpenRouter (Mistral API).

Changes made:

  • Safely parses streaming JSON chunks with json.loads
  • Skips malformed lines to prevent FormatException / Unterminated string errors
  • Preserves streaming output in terminal with stable decoding

🔗 Related Issue: #245 (Unterminated string error)

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.

2 participants