Skip to content

When passing in a uri_base to config, a /v1/ is automatically added. #584

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

Open
oshea-patrick opened this issue Mar 27, 2025 · 1 comment

Comments

@oshea-patrick
Copy link

When passing in a base url like LLAMA's "https://api.llmapi.com/", /v1/ automatically gets inserted which breaks their url scheme. Currently use a custom faraway implementation to fix it.

@benbalter
Copy link

I'm running into the same problem trying to use this with GitHub Models. My work around was to create the following Middleware:

class WorkaroundMiddleware
  def initialize(app, options = {})
    @app = app
    @options = options
  end

  def call(env)
    env[:url].path = env[:url].path.gsub("v1/", "")
    @app.call(env)
  end
end

And then when creating the client:

OpenAI::Client.new do |f|
  f.use WorkaroundMiddleware
end

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

No branches or pull requests

2 participants