diff --git a/CHANGELOG.md b/CHANGELOG.md index a2dd771..2a808ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.5] - 2026-02-05 + +### Fixed + +- **Streaming JSON compatibility** - Exclude null fields from streaming chunks using `exclude_none=True`; OpenAI's API omits null fields entirely, and including them (e.g., `content: null`, `reasoning_content: null`) caused parsing issues in Open WebUI + ## [2.0.4] - 2026-02-05 ### Fixed diff --git a/pyproject.toml b/pyproject.toml index 5c1186e..f0aef4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "tatlock" -version = "2.0.4" +version = "2.0.5" description = "OpenAI-compatible API with Ollama backend" requires-python = ">=3.12" dependencies = [] diff --git a/src/chat/router.py b/src/chat/router.py index 26abf3c..dc3c59c 100644 --- a/src/chat/router.py +++ b/src/chat/router.py @@ -31,7 +31,7 @@ async def _stream_response( """ try: async for chunk in service.create_chat_completion_stream(request): - yield f"data: {chunk.model_dump_json()}\n\n" + yield f"data: {chunk.model_dump_json(exclude_none=True)}\n\n" yield "data: [DONE]\n\n"