python generator request - return values #3862
benji-finster
started this conversation in
Ideas
Replies: 1 comment
-
Hi @benji-finster - thank for raising this discussion! Although this is a somewhat odd pattern as described in that stackoverflow answer, the decorator should not impede the original functionality of the wrapped generator. Happy to review your contribution on this if you rely on this! 🙏🏾 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature or potential improvement
Hi!
I noticed that your generator wrapping doesn't support return values. Was wondering if it could be added in?
Something like:
Then in
_wrap_sync_generator_result
in the try block you could do:I want to get the return value of a generator (e.g. like in https://stackoverflow.com/questions/34073370/best-way-to-receive-the-return-value-from-a-python-generator), however I think currently the langfuse observe decorator destroys this.
Cheers! I hope this might be a very small but nice change.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions