Skip to content

Commit b97fc2d

Browse files
authored
Merge branch 'main' into add-additional-headers
2 parents 42382f0 + acfc5a0 commit b97fc2d

3 files changed

Lines changed: 383 additions & 55 deletions

File tree

langfuse/_utils/serializer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ def default(self, obj: Any):
5757
if np is not None and isinstance(obj, np.generic):
5858
return obj.item()
5959

60+
# Check if numpy is available and if the object is a numpy array
61+
# If so, convert it to a Python list using the tolist() method
62+
if np is not None and isinstance(obj, np.ndarray):
63+
return obj.tolist()
64+
6065
if isinstance(obj, float) and math.isnan(obj):
6166
return None
6267

0 commit comments

Comments
 (0)