Skip to content
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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Lifei/branch from ajgray #238

wants to merge 10 commits into from

Conversation

lifeizhou-ap
Copy link
Collaborator

No description provided.

Copy link

github-actions bot commented Nov 12, 2024

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:

No release type found in pull request title "Lifei/branch from ajgray". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

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)
Copy link
Collaborator Author

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:
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

@lifeizhou-ap lifeizhou-ap Nov 12, 2024

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

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.

3 participants