Replies: 1 comment 2 replies
-
Thanks a lot for sharing this! We track this idea here, I'll copy your note to this thread: https://github.com/orgs/langfuse/discussions/2488 |
Beta Was this translation helpful? Give feedback.
2 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
The
observe
decorators is really useful, and on many occasions using it as a context manager makes a lot of sense.For example, I might have in the same function multiple LLM calls which I would like to name for better auditibility, and it would be so convinient to just
instead of having to put a single LLM call code line inside a function just to be able to use the
observe
decorator.Since Python 3.2, decorators implemented using
@contextlib.contextmanager
can be used both as context managers and as decorators. I've looked at the implementation ofobserve
and it is quite complex for me to try and do it on my own.If it's implementation could utilize
@contextlib.contextmanager
that would be awesome or alternatively implement a separateobserve_context
context manager.Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions