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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/replicate-client/model/version.rb +31 -0
- data/lib/replicate-client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6798a521201c15a08cd456167052ac6de82b43f60487ea454dabda1865a28ce
|
4
|
+
data.tar.gz: cd44ea8758209f771645f2d9755438d6ad890758f83ef2ce8dd03d39f1162d4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b0f59e6ae5803a0cefc0ec8a0d2312cf45b4205a7052cfae84bc70b13c062ebd533fed18c92971513139235418cb1a08662eff816cfa211fdc854451133df29
|
7
|
+
data.tar.gz: 18e5cb1d7eb54ceddb10eac736da1e56baa8245eb558b4670da2fcd4e99a1d5519bc473313bee0bb5ba7a191cf1f3aeeafccbedea24a202a474df6a716684dba
|
data/Gemfile.lock
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2024-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|