-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lifei/branch from ajgray #238
base: main
Are you sure you want to change the base?
Conversation
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details:
|
session_id_function = kwargs.pop("session_id") | ||
session_id_value = session_id_function(fargs[0]) | ||
modified_fn = self.session_id_wrapper(fn, session_id_value) | ||
return langfuse_context.observe(*args, **kwargs)(modified_fn)(*fargs, **fkwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap the update_current_trace call inside the observer wrapper
@wraps(fn) | ||
def wrapped_fn(*fargs, **fkwargs) -> Callable: # noqa: ANN002, ANN003 | ||
# group all traces under the same session | ||
if "session_id" in kwargs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used the session_id param in decorator instead of checking the function name "reply". (This is not related to the issue)
@@ -211,12 +207,9 @@ def run(self, new_session: bool = True) -> None: | |||
time_end = datetime.now() | |||
self._log_cost(start_time=time_start, end_time=time_end) | |||
|
|||
@observe_wrapper() | |||
@observe_wrapper(session_id=lambda instance: instance.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added session_id function parameter in the decorator. This is not directly related to the issue
No description provided.