Closed
Description
Describe the bug
From the version 7.3.0
, Faraday::ResourceNotFound: the server responded with status 404
occurs when calling #embeddings
method to send a request to Azure.
To Reproduce
Steps to reproduce the behavior:
- Configure to use Azure OpenAI
OpenAI.configure do |config|
config.access_token = ENV.fetch("AZURE_OPENAI_API_ACCESS_TOKEN", "")
config.uri_base = ENV.fetch("AZURE_OPENAI_API_URI_BASE", "")
config.api_type = :azure
config.api_version = ENV.fetch("AZURE_OPENAI_API_VERSION", "")
config.request_timeout = 60
end
- Call
#embeddings
> client = OpenAI::Client.new
> client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})
- See error
Faraday::ResourceNotFound: the server responded with status 404
from /Users/your-name/.asdf/installs/ruby/3.2.5/lib/ruby/gems/3.2.0/gems/faraday-1.10.4/lib/faraday/response/raise_error.rb:22:in `on_complete'
I have confirmed that it works on the version 7.2.0
Expected behavior
No errors occurred
Screenshots
N/A
Desktop :
- OS: macOS (Sonoma 14.6.1)
- Browser: N/A
- Version: N/A
Possible solution
Maybe the following change might be the cause:
ruby-openai/lib/openai/http.rb
Lines 21 to 26 in a5714d3
ruby-openai/lib/openai/http.rb
Lines 88 to 91 in a5714d3
If we use Azure, req.params
already has the api_key
param. So should we merge query_params
instead of overwriting ?
Metadata
Metadata
Assignees
Labels
No labels