Class: Eclaircir::Client
- Inherits:
-
Object
- Object
- Eclaircir::Client
- Includes:
- HTTParty
- Defined in:
- lib/eclaircir/client.rb,
lib/eclaircir/client/status_validator.rb
Defined Under Namespace
Classes: StatusValidator
Instance Method Summary collapse
-
#initialize(api_key) ⇒ Client
constructor
A new instance of Client.
- #models(options = {}) ⇒ Object
- #predict_outputs(model, inputs) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Client
Returns a new instance of Client.
11 12 13 |
# File 'lib/eclaircir/client.rb', line 11 def initialize(api_key) @api_key = api_key end |
Instance Method Details
#models(options = {}) ⇒ Object
15 16 17 |
# File 'lib/eclaircir/client.rb', line 15 def models( = {}) get('/models', query: ) end |
#predict_outputs(model, inputs) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/eclaircir/client.rb', line 19 def predict_outputs(model, inputs) with_response_parsing do validate post("/models/#{model.id}/outputs", body: { inputs: Array(inputs).map(&:to_api_hash) }.to_json) end end |