Sha256: 36e8135f7d370b32329d1c9dd1043ab120531684ff01561a6e171fb23ff4158e

Contents?: true

Size: 506 Bytes

Versions: 4

Compression:

Stored size: 506 Bytes

Contents

module OpenAI
  class Batches
    def initialize(client:)
      @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION)
    end

    def list(parameters: {})
      @client.get(path: "/batches", parameters: parameters)
    end

    def retrieve(id:)
      @client.get(path: "/batches/#{id}")
    end

    def create(parameters: {})
      @client.json_post(path: "/batches", parameters: parameters)
    end

    def cancel(id:)
      @client.post(path: "/batches/#{id}/cancel")
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-openai-7.3.1 lib/openai/batches.rb
ruby-openai-7.3.0 lib/openai/batches.rb
ruby-openai-7.2.0 lib/openai/batches.rb
ruby-openai-7.1.0 lib/openai/batches.rb