sashabaranov / go-openai

OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go
Apache License 2.0
9.03k stars 1.39k forks source link

feat: Assistant stream mode and event callback #731

Closed CallOrRet closed 2 months ago

CallOrRet commented 5 months ago

This update enhances the existing functionality by adding support for Assistant stream mode and stream event callbacks without introducing any breaking changes or modifications to the existing API endpoints.

The implemented features are in line with the OpenAI Assistant streaming API, as documented here: OpenAI Assistant Streaming API

Stream.On("event1", callback1)
Stream.On("event2", callback2)
Stream.Run()
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.75%. Comparing base (774fc9d) to head (0ac6760). Report is 12 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #731 +/- ## ========================================== + Coverage 98.46% 98.75% +0.29% ========================================== Files 24 25 +1 Lines 1364 1205 -159 ========================================== - Hits 1343 1190 -153 + Misses 15 9 -6 Partials 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sashabaranov commented 4 months ago

Thank you for the PR! Sorry for a long review process :D