feat(client): LangfuseBaseCallbackHandler allow tags has non-str element (number, None, etc)
[!IMPORTANT]
LangfuseBaseCallbackHandlernow convertstagsto strings, allowing non-string elements.
- Behavior:
- In
LangfuseBaseCallbackHandler.__init__,tagsare now converted to strings, allowing non-string elements (e.g., numbers,None).This description was created by
for 4cd66508c4becb6646c689c2a77abc68441d93b4. 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 = tagstoself.tags = [str(tag) for tag in tags] if tags else Noneinlangfuse/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!
Thanks again for raising this! Closing this PR as stale / no longer relevant with Python SDK v3. If you continue to encounter this issue, please open a Github issue for us to continue the discussion there