Skip to content

404 Error Using Azure #567

Open
Open
@antarr

Description

@antarr

Describe the bug
I'm getting a 404 error when attempting to invoke the Azure API

irb(main):001:0> client = OpenAI::Client.new
=> #<OpenAI::Client:25900 @access_token=[REDACTED], @admin_token=[REDACTED], @api_type=:azure, @api_version="2024-08-01-preview", @extra_headers=[REDACTED], @log_er...
irb(main):002:0>   client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})
Traceback (most recent call last):
        1: from (irb):2
Faraday::ResourceNotFound (the server responded with status 404)
irb(main):003:0> OpenAI::VERSION
=> "7.4.0"

To Reproduce
Steps to reproduce the behavior:

  1. open rails console
  2. client = OpenAI::Client.new
  3. client.embeddings(parameters: {model: "text-embedding-3-small", input: "test-input"})
  Traceback (most recent call last):
        1: from (irb):2
  Faraday::ResourceNotFound (the server responded with status 404

Expected behavior
No Error

Desktop (please complete the following information):

  • OS: Mac OS 15.2
  • Ruby: 3.12.7

Additional context

config/intializers/open_ai.rb

OpenAI.configure do |config|
  config.access_token = Rails.application.credentials.dig(:azure_open_ai, :api_key_1)
  config.uri_base = Rails.application.credentials.dig(:azure_open_ai, :end_point)
  config.api_type = :azure
  config.api_version = "2024-08-01-preview"
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions