Files
ChatMock/chatmock/utils.py
Alexx fd900eb7af fix: Add graceful error handling for ChunkedEncodingError during streaming (#57)
Fixes connection interruptions from ChatGPT API by catching ChunkedEncodingError
and gracefully ending the stream with [DONE] instead of returning 500 errors.

Two-level error handling:
1. Catches errors during stream initialization
2. Catches errors during stream iteration

This prevents abrupt failures when the upstream connection is interrupted mid-response.
2025-10-20 22:38:47 +05:00

37 KiB