Skip to content

Conversation

soapergem
Copy link

Fixes #625. Adds back the compatibility layer that allows this library to be included via require "ruby/openai" so that it can cohabitate with OpenAI's official client library for Ruby. Please let me know if I missed anything here.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?

@alexrudall
Copy link
Owner

alexrudall commented Sep 25, 2025

Thanks @soapergem - looking into this, I believe using require "ruby/openai" should just work without this PR required. Did you already try that, if it doesn't work can I ask what error you get?

Edit: Thinking more about this, I guess the clash will still occur because even if you require with require ruby/openai, OpenAI::Client.new will still work for both gems. So we would need to figure out a way to force ruby-openai to only use Ruby::OpenAI in compatibility mode, if that's even possible. I wonder if reverting back to v3.2 would work for you, depending on which features you're using?

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.

Incompatible with official OpenAI library
2 participants