Skip to content

Conversation

@hassiebp
Copy link
Contributor

No description provided.

@hassiebp hassiebp enabled auto-merge (squash) August 16, 2024 13:35
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: Experimental PR review

PR Summary

This pull request enhances the OpenAI integration in the Langfuse Python SDK by adding support for the __anext__ protocol in streaming responses.

  • Added __anext__ method to LangfuseResponseGeneratorAsync in langfuse/openai.py for compatibility with anext() built-in function
  • Implemented handling of StopAsyncIteration exception in __anext__ method to finalize generation
  • Added new test test_async_chat_stream_with_anext() in tests/test_openai.py to verify __anext__ functionality
  • Improved existing tests and cleaned up code in tests/test_openai.py

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@sinwoobang
Copy link

Our company is hesitating to introduce langfuse due to this bug. Would you please expedite it?

@sinwoobang
Copy link

I implemented a sync iterator. It may fix the test. #887

@hassiebp
Copy link
Contributor Author

hassiebp commented Sep 2, 2024

@sinwoobang Apologies for the delay on this. Will get this merged and released asap.

@hassiebp hassiebp merged commit a8920ab into main Sep 2, 2024
@hassiebp hassiebp deleted the openai-iteration-anext branch September 2, 2024 18:17
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.

bug: 'LangfuseResponseGeneratorSync' object is not an iterator

3 participants