Class: Roseflow::StabilityAI::Client
- Inherits:
-
Object
- Object
- Roseflow::StabilityAI::Client
- Defined in:
- lib/roseflow/stabilityai/client.rb
Constant Summary collapse
- FARADAY_RETRY_OPTIONS =
{ max: 3, interval: 0.05, interval_randomness: 0.5, backoff_factor: 2, }
Instance Method Summary collapse
-
#initialize(config = Config.new, provider = nil) ⇒ Client
constructor
A new instance of Client.
- #models ⇒ Object
- #post(operation) ⇒ Object
Constructor Details
Instance Method Details
#models ⇒ Object
26 27 28 29 |
# File 'lib/roseflow/stabilityai/client.rb', line 26 def models response = connection.get("/v1/engines/list") body = JSON.parse(response.body) end |
#post(operation) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/roseflow/stabilityai/client.rb', line 31 def post(operation) if operation.multipart? response = multipart_connection.post(operation.path) do |request| request.body = operation.body end else response = connection.post(operation.path) do |request| request.body = operation.body end end response end |