Skip to content

Commit 69a6a0a

Browse files
authored
fix(openai): apply langfuse_mask (#1123)
1 parent b668599 commit 69a6a0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

langfuse/openai.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ 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"] = {} if self.args.get("metadata", None) is None else self.args["metadata"]
175+
self.kwargs["metadata"] = (
176+
{} if self.args.get("metadata", None) is None else self.args["metadata"]
177+
)
176178

177179
# OpenAI does not support non-string type values in metadata when using
178180
# model distillation feature
@@ -771,6 +773,7 @@ def initialize(self):
771773
enabled=openai.langfuse_enabled,
772774
sdk_integration="openai",
773775
sample_rate=openai.langfuse_sample_rate,
776+
mask=openai.langfuse_mask,
774777
)
775778

776779
return self._langfuse

0 commit comments

Comments
 (0)