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

feat(client): LangfuseBaseCallbackHandler allow tags has non-str element (number, None, etc) #1130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

XenoAmess
Copy link

@XenoAmess XenoAmess commented Mar 3, 2025

Important

LangfuseBaseCallbackHandler now converts tags to strings, allowing non-string elements.

  • Behavior:
    • In LangfuseBaseCallbackHandler.__init__, tags are now converted to strings, allowing non-string elements (e.g., numbers, None).

This description was created by Ellipsis for 4cd6650. It will automatically update as commits are pushed.

Greptile Summary

Disclaimer: Experimental PR review

Modified the LangfuseBaseCallbackHandler class to ensure all tags are converted to strings, preventing type errors when non-string elements (numbers, None, etc.) are included in the tags list.

  • Changed self.tags = tags to self.tags = [str(tag) for tag in tags] if tags else None in langfuse/utils/base_callback_handler.py
  • Prevents type errors when processing tags with mixed data types in the Langfuse SDK
  • Maintains backward compatibility while improving robustness
  • Handles the case when tags is None by setting self.tags to None
  • Ensures consistent tag formatting for the Langfuse API

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

@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.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

@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.

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp self-requested a review March 3, 2025 08:44
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.

2 participants