Skip to content

Commit b668599

Browse files
seratchhassiebp
andauthored
Resolve runtime error with openai extension when metadata is missing (#1115)
Co-authored-by: Hassieb Pakzad <[email protected]>
1 parent 4eaa4cf commit b668599

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

langfuse/openai.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def get_openai_args(self):
172172
# If OpenAI model distillation is enabled, we need to add the metadata to the kwargs
173173
# https://platform.openai.com/docs/guides/distillation
174174
if self.kwargs.get("store", False):
175-
self.kwargs["metadata"] = self.args.get("metadata", {})
175+
self.kwargs["metadata"] = {} if self.args.get("metadata", None) is None else self.args["metadata"]
176176

177177
# OpenAI does not support non-string type values in metadata when using
178178
# model distillation feature

0 commit comments

Comments
 (0)