replicate-client 0.1.4 → 0.1.5
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/LICENSE +21 -0
- data/lib/replicate-client/training.rb +6 -6
- data/lib/replicate-client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f066662aa759a5881284f5008568d092d3ec28b8cbc1d87a2221c42a6c6fd4d4
|
4
|
+
data.tar.gz: ced72f79a1601dd5c0702e726d508c7226130de8c92b890df6e55fbaeeeb5552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ba457621a0fdfc737c83a5e632abe315735fa45bcf792dab468a2d620aed526012a4f49c06bc43451c1d7702064b596d1ae32c9af07765295a54bd3b78f7017
|
7
|
+
data.tar.gz: a3dcf6a0153b84b7c44b0137dee34072e3d0ca89b5127cf12d96ba8e4edac14488a178c931034879b6444fc21fb8862c2472fad9a9a3f40071fca59559a7e727
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 851 Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
@@ -42,11 +42,11 @@ module ReplicateClient
|
|
42
42
|
# @param destination [ReplicateClient::Model, String] The destination model instance or string in "owner/name"
|
43
43
|
# format.
|
44
44
|
# @param input [Hash] The input data for the training.
|
45
|
-
# @param
|
45
|
+
# @param webhook_url [String, nil] A URL to receive webhook notifications.
|
46
46
|
# @param webhook_events_filter [Array, nil] The events to trigger webhook requests.
|
47
47
|
#
|
48
48
|
# @return [ReplicateClient::Training]
|
49
|
-
def create!(owner:, name:, version:, destination:, input:,
|
49
|
+
def create!(owner:, name:, version:, destination:, input:, webhook_url: nil, webhook_events_filter: nil)
|
50
50
|
destination_str = destination.is_a?(ReplicateClient::Model) ? destination.full_name : destination
|
51
51
|
version_id = version.is_a?(ReplicateClient::Model::Version) ? version.id : version
|
52
52
|
|
@@ -54,7 +54,7 @@ module ReplicateClient
|
|
54
54
|
body = {
|
55
55
|
destination: destination_str,
|
56
56
|
input: input,
|
57
|
-
webhook:
|
57
|
+
webhook: webhook_url || ReplicateClient.configuration.webhook_url,
|
58
58
|
webhook_events_filter: webhook_events_filter
|
59
59
|
}
|
60
60
|
|
@@ -67,11 +67,11 @@ module ReplicateClient
|
|
67
67
|
# @param model [ReplicateClient::Model, String] The model instance or a string representing the model ID.
|
68
68
|
# @param destination [ReplicateClient::Model, String] The destination model or full name in "owner/name" format.
|
69
69
|
# @param input [Hash] The input data for the training.
|
70
|
-
# @param
|
70
|
+
# @param webhook_url [String, nil] A URL to receive webhook notifications.
|
71
71
|
# @param webhook_events_filter [Array, nil] The events to trigger webhook requests.
|
72
72
|
#
|
73
73
|
# @return [ReplicateClient::Training]
|
74
|
-
def create_for_model!(model:, destination:, input:,
|
74
|
+
def create_for_model!(model:, destination:, input:, webhook_url: nil, webhook_events_filter: nil)
|
75
75
|
model_instance = model.is_a?(ReplicateClient::Model) ? model : ReplicateClient::Model.find(model)
|
76
76
|
raise ArgumentError, "Invalid model" unless model_instance
|
77
77
|
|
@@ -81,7 +81,7 @@ module ReplicateClient
|
|
81
81
|
version: model_instance.version_id,
|
82
82
|
destination: destination,
|
83
83
|
input: input,
|
84
|
-
webhook:
|
84
|
+
webhook: webhook_url || ReplicateClient.configuration.webhook_url,
|
85
85
|
webhook_events_filter: webhook_events_filter
|
86
86
|
)
|
87
87
|
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.5
|
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-08-
|
11
|
+
date: 2024-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -35,6 +35,7 @@ files:
|
|
35
35
|
- ".ruby-version"
|
36
36
|
- Gemfile
|
37
37
|
- Gemfile.lock
|
38
|
+
- LICENSE
|
38
39
|
- README.md
|
39
40
|
- Rakefile
|
40
41
|
- lib/replicate-client.rb
|