Skip to content

Commit 89da281

Browse files
authored
fix(openai): pass metadata when model distillation feat is used (#1031)
1 parent 6d3c5b1 commit 89da281

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

langfuse/openai.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ def get_langfuse_args(self):
170170
return {**self.args, **self.kwargs}
171171

172172
def get_openai_args(self):
173+
# If OpenAI model distillation is enabled, we need to add the metadata to the kwargs
174+
# https://platform.openai.com/docs/guides/distillation
175+
if self.kwargs.get("store", False):
176+
self.kwargs["metadata"] = self.args.get("metadata", {})
177+
173178
return self.kwargs
174179

175180

0 commit comments

Comments
 (0)