Class: OpenAI::Batches
- Inherits:
-
Object
- Object
- OpenAI::Batches
- Defined in:
- lib/openai/batches.rb
Instance Method Summary collapse
- #cancel(id:) ⇒ Object
- #create(parameters: {}) ⇒ Object
-
#initialize(client:) ⇒ Batches
constructor
A new instance of Batches.
- #list(parameters: {}) ⇒ Object
- #retrieve(id:) ⇒ Object
Constructor Details
#initialize(client:) ⇒ Batches
Returns a new instance of Batches.
3 4 5 |
# File 'lib/openai/batches.rb', line 3 def initialize(client:) @client = client.beta(assistants: OpenAI::Assistants::BETA_VERSION) end |
Instance Method Details
#cancel(id:) ⇒ Object
19 20 21 |
# File 'lib/openai/batches.rb', line 19 def cancel(id:) @client.post(path: "/batches/#{id}/cancel") end |
#create(parameters: {}) ⇒ Object
15 16 17 |
# File 'lib/openai/batches.rb', line 15 def create(parameters: {}) @client.json_post(path: "/batches", parameters: parameters) end |
#list(parameters: {}) ⇒ Object
7 8 9 |
# File 'lib/openai/batches.rb', line 7 def list(parameters: {}) @client.get(path: "/batches", parameters: parameters) end |
#retrieve(id:) ⇒ Object
11 12 13 |
# File 'lib/openai/batches.rb', line 11 def retrieve(id:) @client.get(path: "/batches/#{id}") end |