Skip to content

Commit 0959b2b

Browse files
committed
fix(openai): add check for metadata NotGiven
1 parent 83d7fea commit 0959b2b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

langfuse/openai.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,11 @@ def _get_langfuse_data_from_kwargs(resource: OpenAiDefinition, kwargs):
355355
raise ValueError("parent_observation_id requires trace_id to be set")
356356

357357
metadata = kwargs.get("metadata", {})
358-
if metadata is not None and not isinstance(metadata, dict):
358+
if (
359+
metadata is not None
360+
and not isinstance(metadata, NotGiven)
361+
and not isinstance(metadata, dict)
362+
):
359363
raise TypeError("metadata must be a dictionary")
360364

361365
model = kwargs.get("model", None) or None

0 commit comments

Comments
 (0)