Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openai): remove response_format in model distil feat #1045

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

hassiebp
Copy link
Contributor

@hassiebp hassiebp commented Dec 16, 2024

Important

Remove response_format from metadata in get_openai_args() to comply with OpenAI's metadata restrictions during model distillation.

  • Behavior:
    • In get_openai_args() in openai.py, remove response_format from metadata if present when store is True.
    • This change addresses OpenAI's restriction on non-string metadata values during model distillation.

This description was created by Ellipsis for 31ab097. It will automatically update as commits are pushed.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: Experimental PR review

PR Summary

Fixes an issue with OpenAI's model distillation feature by removing 'response_format' from metadata to prevent API errors when using non-string values.

  • Modified langfuse/openai.py to exclude 'response_format' key from metadata when using model distillation to ensure compatibility with OpenAI's API requirements
  • Prevents potential runtime errors when using OpenAI's model distillation with complex response format objects
  • Maintains core functionality while ensuring metadata only contains string-compatible values

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@hassiebp hassiebp merged commit 37187cc into main Dec 16, 2024
9 of 10 checks passed
@hassiebp hassiebp deleted the fix-openai-response-format-model-distill branch December 16, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Passing metadata to OpenAI when model distillation feat is used breaks when response_format is also set
1 participant