Skip to content

v0.5.2

Choose a tag to compare

@Oaklight Oaklight released this 21 Apr 05:30
· 202 commits to master since this release

What's Changed

Fixed

  • Streaming round-trip event inflation (#157): Fixed multiple scenarios where Provider A → IR → Provider B streaming conversion produced more output events than input events:
    • OpenAI Chat, Anthropic, and Google GenAI converters emitted redundant content_block_end events when no content block was open
    • Google GenAI compound chunks (text + finish in the same SSE frame) triggered duplicate text and finish events. Deferred via StreamContext.pending_text / pending_finish
    • Tool call events generated spurious content_block_start / content_block_end wrappers in non-Anthropic targets

Refactored

  • Unified stream_response_to_provider dispatch (#73, #157): Extracted identical dispatch logic (10-entry _TO_P_DISPATCH table + dispatch skeleton) from all 4 provider converters into BaseConverter. Each converter now only implements a provider-specific _post_process_to_provider hook
  • StreamContext buffer convenience methods: Added buffer_usage() / pop_pending_usage() / buffer_finish() / pop_pending_finish() to replace manual set-and-clear patterns

Changed

  • Pinned dev tooling versions: ty>=0.0.31 and ruff>=0.15.0 in pyproject.toml dev dependencies. CI uses versions from pip install -e ".[all]"
  • Converter tests added to CI: tests/converters/ (1086+ tests) now runs in GitHub Actions
  • Roundtrip inflation regression test: New pytest-parametrized test suite (15 cases) verifies len(output_events) <= len(input_events) for all 4 providers

Full Changelog: v0.5.1...v0.5.2