Skip to content

Remove streaming dependencies and move to StreamCallbacks.jl#307

Open
Sixzero wants to merge 3 commits intosvilupp:mainfrom
Sixzero:refactor/move-streaming-to-streamcallbacks
Open

Remove streaming dependencies and move to StreamCallbacks.jl#307
Sixzero wants to merge 3 commits intosvilupp:mainfrom
Sixzero:refactor/move-streaming-to-streamcallbacks

Conversation

@Sixzero
Copy link
Copy Markdown
Collaborator

@Sixzero Sixzero commented Aug 11, 2025

This PR removes all streaming-related dependencies and implementation from PromptingTools.jl and moves them to the dedicated StreamCallbacks.jl package.

Summary of changes

  • streaming.jl file now is just an interface other packages can use, to develop any kind of streaming callback based IO based or with any kind of backend, HTTP.jl libCurl, EasyCurl etc.

Changes Made

Removed Dependencies:

  • Removed StreamCallbacks from direct dependencies in Project.toml
  • Cleaned up streaming-related imports from main module

Refactored Streaming Interface:

  • Replaced full streaming implementation with minimal interface in src/streaming.jl
  • Added abstract AbstractStreamCallback type for extensibility
  • Kept essential interface methods (configure_callback!, streamed_request!) as stubs

Updated Documentation:

  • Updated docstrings in aigenerate functions across all schemas (OpenAI, Anthropic, Ollama)
  • Added clear instructions for users to using StreamCallbacks for streaming functionality
  • Updated examples to show proper StreamCallbacks.jl usage

Test Cleanup:

  • Removed test/streaming.jl as streaming tests are now in StreamCallbacks.jl
  • Updated test runner to exclude streaming tests

Benefits

  1. Lighter Core Package: PromptingTools.jl is now lighter without heavy streaming dependencies
  2. Focused Development: Streaming functionality can evolve independently in StreamCallbacks.jl
  3. Better Separation of Concerns: Core prompting vs streaming concerns are properly separated
  4. Maintained Compatibility: Existing streaming code will work with using StreamCallbacks

Migration for Users

Users who use streaming features need to add one line:

using StreamCallbacks  # Add this line
# All existing streaming code works unchanged

Breaking Changes

  • Direct access to streaming types (e.g., PT.StreamCallback) now requires using StreamCallbacks
  • No functional breaking changes - all streaming features remain available through StreamCallbacks.jl

This change improves the package architecture while maintaining full backward compatibility for end users.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@f9304d8). Learn more about missing BASE report.
⚠️ Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
src/streaming.jl 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #307   +/-   ##
=======================================
  Coverage        ?   92.62%           
=======================================
  Files           ?       37           
  Lines           ?     3242           
  Branches        ?        0           
=======================================
  Hits            ?     3003           
  Misses          ?      239           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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