alexrudall/ruby-openai

Support for Assistants v2

josegm opened this issue · 3 comments

A new version of Assistants API is available.

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

Any update on supporting v2 @alexrudall?

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)

Released in v7