replicate-ruby 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/replicate/client/prediction.rb +1 -0
- data/lib/replicate/configurable.rb +2 -2
- data/lib/replicate/record/prediction.rb +20 -0
- data/lib/replicate/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e58708bf432115af17aef8f67789838f4044526a851785a04dd3f206d17f727
|
4
|
+
data.tar.gz: f1422c952891c61df45c4a4bd69e27f13b724185edc883df8dec00addec7679a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 234415f451e806a5d2c800cf11da2aa626b131f4c8f5d3df501c317607a5637c267bc757d75115bb8fd5c6378500bd6c38c749c722f7a38ebad4f6bd8b7b5f7d
|
7
|
+
data.tar.gz: ea46776b902acd5cec2283fd8bd390127244771c0250e05623303f1d5284e1aa982240eecd5227b2b2f243d01ccc8d8c099442a33c28f114287b97e9765e26ba
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
replicate-ruby (0.1.
|
4
|
+
replicate-ruby (0.1.7)
|
5
5
|
addressable
|
6
6
|
faraday (>= 2.0)
|
7
7
|
faraday-retry
|
@@ -15,7 +15,7 @@ GEM
|
|
15
15
|
coderay (1.1.3)
|
16
16
|
crack (0.4.5)
|
17
17
|
rexml
|
18
|
-
faraday (2.7.
|
18
|
+
faraday (2.7.2)
|
19
19
|
faraday-net_http (>= 2.0, < 3.1)
|
20
20
|
ruby2_keywords (>= 0.0.4)
|
21
21
|
faraday-net_http (3.0.2)
|
@@ -21,6 +21,7 @@ module Replicate
|
|
21
21
|
# Create a prediction
|
22
22
|
# @see https://replicate.com/docs/reference/http#create-prediction
|
23
23
|
def create_prediction(params)
|
24
|
+
params[:webhook_completed] ||= webhook_url
|
24
25
|
Replicate::Record::Prediction.new(self, post("predictions", params))
|
25
26
|
end
|
26
27
|
|
@@ -2,14 +2,14 @@
|
|
2
2
|
|
3
3
|
module Replicate
|
4
4
|
module Configurable
|
5
|
-
attr_accessor :api_token
|
5
|
+
attr_accessor :api_token, :webhook_url
|
6
6
|
attr_writer :api_endpoint
|
7
7
|
|
8
8
|
class << self
|
9
9
|
# List of configurable keys for {Datatrans::Client}
|
10
10
|
# @return [Array] of option keys
|
11
11
|
def keys
|
12
|
-
@keys ||= %i[api_token api_endpoint]
|
12
|
+
@keys ||= %i[api_token api_endpoint webhook_url]
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -19,6 +19,26 @@ module Replicate
|
|
19
19
|
false
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
def starting?
|
24
|
+
status == "starting"
|
25
|
+
end
|
26
|
+
|
27
|
+
def processing?
|
28
|
+
status == "processing"
|
29
|
+
end
|
30
|
+
|
31
|
+
def succeeded?
|
32
|
+
status == "succeeded"
|
33
|
+
end
|
34
|
+
|
35
|
+
def failed?
|
36
|
+
status == "failed"
|
37
|
+
end
|
38
|
+
|
39
|
+
def canceled?
|
40
|
+
status == "canceled"
|
41
|
+
end
|
22
42
|
end
|
23
43
|
end
|
24
44
|
end
|
data/lib/replicate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: replicate-ruby
|
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
|
- Dreaming Tulpa
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
-
description:
|
83
|
+
description:
|
84
84
|
email:
|
85
85
|
- hey@dreamingtulpa.com
|
86
86
|
executables: []
|
@@ -111,7 +111,7 @@ metadata:
|
|
111
111
|
homepage_uri: https://github.com/dreamingtulpa/replicate-ruby
|
112
112
|
source_code_uri: https://github.com/dreamingtulpa/replicate-ruby
|
113
113
|
changelog_uri: https://github.com/dreamingtulpa/replicate-ruby/blob/master/CHANGELOG.md
|
114
|
-
post_install_message:
|
114
|
+
post_install_message:
|
115
115
|
rdoc_options: []
|
116
116
|
require_paths:
|
117
117
|
- lib
|
@@ -126,8 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.
|
130
|
-
signing_key:
|
129
|
+
rubygems_version: 3.3.26
|
130
|
+
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Ruby client for Replicate
|
133
133
|
test_files: []
|