alexrudall / ruby-openai

OpenAI API + Ruby! 🤖❤️ NEW: Assistant Vector Stores
MIT License
2.61k stars 302 forks source link

Support for Assistants v2 #455

Closed josegm closed 2 months ago

josegm commented 2 months ago

A new version of Assistants API is available.

Here's the migration path and changes needed: https://platform.openai.com/docs/assistants/migration

bladerunnn commented 2 months ago

Any update on supporting v2 @alexrudall?

willywg commented 2 months ago

TIP: You can use Assistants API v2 setting this monkey patch until someone make the correct solution:

module OpenAIPatch
  def beta(apis)
    dup.tap do |client|
      client.add_headers("OpenAI-Beta": apis.map { |k, v| "#{k}=v2" }.join(";"))
    end  
  end
end

OpenAI::Client.prepend(OpenAIPatch)
alexrudall commented 2 months ago

Released in v7