runapi-gpt-image 0.2.7 → 0.2.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 74662bacab7fb4a6dd1e7fe2967cbe5a581fcb87114277886ff7e05b314a4cf4
|
|
4
|
+
data.tar.gz: dccc18ba6f46ec68e1459b58bb8bc45be7ad626f64b0c3f3a4bdd156a139c4a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 933dee7b56f26a5649f0ec03ed7e8c67c5a955483198a426a2a07187e5f361484315235affccb0ce8027bf2a854e23ce9a23f062b56c87293692cb563fa4d670
|
|
7
|
+
data.tar.gz: ba084d0db035a20d479b6053d36a7fdbc5819187da149baf095c34f4b20bfc631a1bbb3917af084512340c2e9cbf355a194dbae58e8f0ded1c890c1c34beab59
|
data/README.md
CHANGED
|
@@ -20,27 +20,27 @@ module RunApi
|
|
|
20
20
|
#
|
|
21
21
|
# @param params [Hash] edit parameters
|
|
22
22
|
# @return [RunApi::GptImage::Types::CompletedEditImageResponse] completed edit with images
|
|
23
|
-
def run(**params)
|
|
24
|
-
task = create(**params)
|
|
25
|
-
poll_until_complete { get(task.id) }
|
|
23
|
+
def run(options: nil, **params)
|
|
24
|
+
task = create(options: options, **params)
|
|
25
|
+
poll_until_complete { get(task.id, options: options) }
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# Create an image editing task.
|
|
29
29
|
#
|
|
30
30
|
# @param params [Hash] edit parameters
|
|
31
31
|
# @return [RunApi::GptImage::Types::EditImageResponse] task creation result with id
|
|
32
|
-
def create(**params)
|
|
32
|
+
def create(options: nil, **params)
|
|
33
33
|
params = compact_params(params)
|
|
34
34
|
validate_contract!(CONTRACT["edit-image"], params)
|
|
35
|
-
request(:post, ENDPOINT, body: params)
|
|
35
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
# Get edit status by task ID.
|
|
39
39
|
#
|
|
40
40
|
# @param id [String] task ID
|
|
41
41
|
# @return [RunApi::GptImage::Types::EditImageResponse] current edit status
|
|
42
|
-
def get(id)
|
|
43
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
42
|
+
def get(id, options: nil)
|
|
43
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -20,27 +20,27 @@ module RunApi
|
|
|
20
20
|
#
|
|
21
21
|
# @param params [Hash] generation parameters
|
|
22
22
|
# @return [RunApi::GptImage::Types::CompletedTextToImageResponse] completed generation with images
|
|
23
|
-
def run(**params)
|
|
24
|
-
task = create(**params)
|
|
25
|
-
poll_until_complete { get(task.id) }
|
|
23
|
+
def run(options: nil, **params)
|
|
24
|
+
task = create(options: options, **params)
|
|
25
|
+
poll_until_complete { get(task.id, options: options) }
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# Create a text-to-image generation task.
|
|
29
29
|
#
|
|
30
30
|
# @param params [Hash] generation parameters
|
|
31
31
|
# @return [RunApi::GptImage::Types::TextToImageResponse] task creation result with id
|
|
32
|
-
def create(**params)
|
|
32
|
+
def create(options: nil, **params)
|
|
33
33
|
params = compact_params(params)
|
|
34
34
|
validate_contract!(CONTRACT["text-to-image"], params)
|
|
35
|
-
request(:post, ENDPOINT, body: params)
|
|
35
|
+
request(:post, ENDPOINT, body: params, options: options)
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
# Get generation status by task ID.
|
|
39
39
|
#
|
|
40
40
|
# @param id [String] task ID
|
|
41
41
|
# @return [RunApi::GptImage::Types::TextToImageResponse] current generation status
|
|
42
|
-
def get(id)
|
|
43
|
-
request(:get, "#{ENDPOINT}/#{id}")
|
|
42
|
+
def get(id, options: nil)
|
|
43
|
+
request(:get, "#{ENDPOINT}/#{id}", options: options)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -14,6 +14,7 @@ module RunApi
|
|
|
14
14
|
class TextToImageResponse < RunApi::Core::TaskResponse
|
|
15
15
|
required :id, String
|
|
16
16
|
optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
|
|
17
|
+
optional :task_replayed
|
|
17
18
|
optional :images, [-> { Image }]
|
|
18
19
|
optional :error, String
|
|
19
20
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: runapi-gpt-image
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RunAPI
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: 0.3.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: 0.3.0
|
|
26
26
|
description: The GPT Image Ruby SDK is the language-specific package for GPT Image
|
|
27
27
|
on RunAPI. Use this package for image generation, image editing, and creative production
|
|
28
28
|
workflows when your application needs request bodies, task status lookup, and consistent
|
|
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '0'
|
|
69
69
|
requirements: []
|
|
70
|
-
rubygems_version: 4.0.
|
|
70
|
+
rubygems_version: 4.0.17
|
|
71
71
|
specification_version: 4
|
|
72
72
|
summary: GPT Image Ruby SDK for RunAPI
|
|
73
73
|
test_files: []
|