Skip to content

Commit

Permalink
fix(openai): pass metadata when model distillation feat is used (#1031)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassiebp authored Dec 9, 2024
1 parent 6d3c5b1 commit 89da281
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions langfuse/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ def get_langfuse_args(self):
return {**self.args, **self.kwargs}

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

return self.kwargs


Expand Down

0 comments on commit 89da281

Please sign in to comment.