We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d8ae65 commit fa0b660Copy full SHA for fa0b660
1 file changed
langfuse/_client/attributes.py
@@ -152,7 +152,10 @@ def create_generation_attributes(
152
153
154
def _serialize(obj: Any) -> Optional[str]:
155
- return json.dumps(obj, cls=EventSerializer) if obj is not None else None
+ if obj is None or isinstance(obj, str):
156
+ return obj
157
+
158
+ return json.dumps(obj, cls=EventSerializer)
159
160
161
def _flatten_and_serialize_metadata(
0 commit comments