Skip to content

Conversation

@bewestphal
Copy link

@bewestphal bewestphal commented Jun 27, 2025

In OpenAI 1.92.0 some paths for imports were migrated. This change implements a max_version to prevent deprecated beta imports which have migrated from being referenced on versions after.

See issue: langfuse/langfuse#7533

Testing

I hacked changed lines on my end in the 2.60.8 SDK. Seeing traces successfully populate in Langfuse and no more import errors on application start.


Important

Adds max_version to OpenAiDefinition and updates register_tracing to prevent deprecated imports post version 1.91.0.

  • Behavior:
    • Adds max_version attribute to OpenAiDefinition class in openai.py.
    • Updates register_tracing() to skip imports with max_version less than current openai version.
  • Definitions:
    • Sets max_version to 1.91.0 for openai.resources.beta.chat.completions in OPENAI_METHODS_V1.
    • Adds new definitions for openai.resources.chat.completions with min_version 1.92.0.

This description was created by Ellipsis for 20ddd24. You can customize this summary. It will automatically update as commits are pushed.

Greptile Summary

Disclaimer: Experimental PR review

Adds version control for OpenAI SDK path migrations in version 1.92.0, ensuring compatibility with the new module structure while maintaining support for older versions.

  • Added max_version field to OpenAiDefinition class in langfuse/openai.py to handle version-specific imports
  • Implemented version check logic in register_tracing to prevent usage of deprecated beta paths after v1.92.0
  • Added new definitions for parse method in non-beta chat completions path for v1.92.0+

In OpenAI 1.92.0 some paths for imports were migrated. This change implements a max_version to prevent deprecated `beta` imports which have migrated from being referenced on versions after.

See issue: langfuse/langfuse#7533
@CLAassistant
Copy link

CLAassistant commented Jun 27, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@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.

LGTM

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@hassiebp
Copy link
Contributor

Merged in #1231 - thanks again @bewestphal !

@hassiebp hassiebp closed this Jun 30, 2025
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.

3 participants