Skip to content

Support Rails usage without an explicit require "openai" #307

Description

@jbeckwith-oai

Carried over from #126 and originally reported in detail by @agarcher.

The specific tapioca dsl early-return problem was fixed in 0.5.0, but the broader request in #126 was for Rails applications to be able to reference OpenAI after normal application boot without adding an application-level require "openai".

We should make this behavior explicit and regression-tested.

Desired behavior

  • A minimal Rails application with gem "openai" in its Gemfile can reference OpenAI::Client after normal boot without a manual require "openai".
  • The behavior continues to work when Tapioca is present and during tapioca dsl.
  • The README documents the expected Rails/Bundler setup.
  • Add a focused integration or smoke test so this does not regress.

Source: #126.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgeneratorTouches generated SDK files

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions