Class: LeonardoAI::Datasets

Inherits:
Object
  • Object
show all
Defined in:
lib/leonardoai/datasets.rb

Instance Method Summary collapse

Constructor Details

#initialize(client: nil) ⇒ Datasets

Returns a new instance of Datasets.



3
4
5
# File 'lib/leonardoai/datasets.rb', line 3

def initialize(client: nil)
  @client = client
end

Instance Method Details

#create_dataset(parameters: {}) ⇒ Object

params: string|null, description: string|null



8
9
10
# File 'lib/leonardoai/datasets.rb', line 8

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

#delete_dataset(id:) ⇒ Object

id: string



18
19
20
# File 'lib/leonardoai/datasets.rb', line 18

def delete_dataset(id:)
  @client.delete(path: "/datasets/#{id}")
end

#get_dataset_by_id(id:) ⇒ Object

id: string



13
14
15
# File 'lib/leonardoai/datasets.rb', line 13

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

#upload_dataset_image(dataset_id:, parameters: {}) ⇒ Object

dataset_id: string (req’d0, params: string|null



23
24
25
# File 'lib/leonardoai/datasets.rb', line 23

def upload_dataset_image(dataset_id:, parameters: {})
  @client.json_post(path: "/datasets/#{dataset_id}/upload", parameters: parameters)
end