replicate-client 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5556c24e737090c5fb8425f5e947822e4b43dee0fbda7703d3fb1bc0f2bf4dd7
4
- data.tar.gz: 6340ba5606a808c35fa4bf9f181ea82aa85c6108906ec93aaa0c5387d6a1a11e
3
+ metadata.gz: f6798a521201c15a08cd456167052ac6de82b43f60487ea454dabda1865a28ce
4
+ data.tar.gz: cd44ea8758209f771645f2d9755438d6ad890758f83ef2ce8dd03d39f1162d4e
5
5
  SHA512:
6
- metadata.gz: c934a95922c925246279b3c59f6412c309508d926e14f1a0734c63728580db0ca0323a148fde5596563f703d2c8ee5adf08bdc89a87b4d52d4aac95e997dcf3a
7
- data.tar.gz: 47e28051e876e484f43f993dc78a9fe9f14c3ddab29241974dc35693713fce0a845bb4a2c3f744d36a6a20b6680a40230921a6f89600a2c19ba365aef907c1e8
6
+ metadata.gz: 7b0f59e6ae5803a0cefc0ec8a0d2312cf45b4205a7052cfae84bc70b13c062ebd533fed18c92971513139235418cb1a08662eff816cfa211fdc854451133df29
7
+ data.tar.gz: 18e5cb1d7eb54ceddb10eac736da1e56baa8245eb558b4670da2fcd4e99a1d5519bc473313bee0bb5ba7a191cf1f3aeeafccbedea24a202a474df6a716684dba
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- replicate-client (0.1.4)
4
+ replicate-client (0.1.6)
5
5
  faraday (>= 1)
6
6
 
7
7
  GEM
@@ -127,6 +127,37 @@ module ReplicateClient
127
127
  webhook_events_filter: webhook_events_filter
128
128
  )
129
129
  end
130
+
131
+ # Get the prediction input schema from the openapi schema.
132
+ #
133
+ # @return [Hash] The prediction input schema.
134
+ def prediction_input_schema
135
+ resolve_ref(openapi_schema.dig("components", "schemas", "PredictionRequest", "properties", "input"))
136
+ end
137
+
138
+ # Get the training input schema from the openapi schema.
139
+ #
140
+ # @return [Hash] The training input schema.
141
+ def training_input_schema
142
+ resolve_ref(openapi_schema.dig("components", "schemas", "TrainingRequest", "properties", "input"))
143
+ end
144
+
145
+ private
146
+
147
+ # Resolve a reference in the openapi schema.
148
+ #
149
+ # @param schema [Hash] The schema to resolve.
150
+ #
151
+ # @return [Hash] The resolved schema.
152
+ def resolve_ref(schema)
153
+ if schema.is_a?(Hash) && schema["$ref"]
154
+ ref_path = schema["$ref"].split("/").drop(1)
155
+ resolved_schema = openapi_schema.dig(*ref_path)
156
+ resolve_ref(resolved_schema)
157
+ else
158
+ schema
159
+ end
160
+ end
130
161
  end
131
162
  end
132
163
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReplicateClient
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: replicate-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Player
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-01 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday