runapi-gpt-image 0.2.7 → 0.2.9
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: c5e5bb791e8707990e6a27e001c56daad008d72b6ba145869f15e602b34b5e49
|
|
4
|
+
data.tar.gz: b0327442f5d41fab854c5f3f58c464d546ea6660c91bf3088decd49273426144
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4307e323e33e63016bd65d5ec942109f87b3ef44e60b387830c031395e393c588cffbb94ed5c740d07f4e77f25e109f8421544d120b5dfba62312c5f1219ea4f
|
|
7
|
+
data.tar.gz: cd506242d8ba27e45ca7247c154b10221cb0dec217ce0e90b730335dbf8b2dea161ef5ba1f0330622c8f4d537f48112932c591d8c1a5f350ebcf1cd83ba917a4
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The GPT Image Ruby SDK is the language-specific package for GPT Image on RunAPI. Use this package for image generation, image editing, and creative production workflows when your application needs request bodies, task status lookup, and consistent RunAPI errors in Ruby.
|
|
4
4
|
|
|
5
|
-
This README is the Ruby package guide inside the public `gpt-image-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/gpt-image; for API reference, use https://runapi.ai/docs
|
|
5
|
+
This README is the Ruby package guide inside the public `gpt-image-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/gpt-image; for API reference, use https://runapi.ai/docs/api/gpt-image/text-to-image; for SDK docs, use https://runapi.ai/docs/resources/sdks.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -13,11 +13,11 @@ gem install runapi-gpt-image
|
|
|
13
13
|
## Quick start
|
|
14
14
|
|
|
15
15
|
```ruby
|
|
16
|
-
require "runapi
|
|
16
|
+
require "runapi/gpt_image"
|
|
17
17
|
|
|
18
18
|
client = RunApi::GptImage::Client.new
|
|
19
19
|
task = client.text_to_image.create(
|
|
20
|
-
# Pass the GPT Image JSON request body from https://runapi.ai/docs
|
|
20
|
+
# Pass the GPT Image JSON request body from https://runapi.ai/docs/api/gpt-image/text-to-image.
|
|
21
21
|
)
|
|
22
22
|
status = client.text_to_image.get(task.id)
|
|
23
23
|
```
|
|
@@ -33,8 +33,8 @@ Use Ruby keyword arguments and the `RunApi::GptImage` error classes when buildin
|
|
|
33
33
|
## Links
|
|
34
34
|
|
|
35
35
|
- Model page: https://runapi.ai/models/gpt-image
|
|
36
|
-
- SDK docs: https://runapi.ai/docs
|
|
37
|
-
- Product docs: https://runapi.ai/docs
|
|
36
|
+
- SDK docs: https://runapi.ai/docs/resources/sdks
|
|
37
|
+
- Product docs: https://runapi.ai/docs/api/gpt-image/text-to-image
|
|
38
38
|
- Pricing and rate limits: https://runapi.ai/models/gpt-image
|
|
39
39
|
- Provider comparison: https://runapi.ai/providers/openai
|
|
40
40
|
- Full catalog: https://runapi.ai/models
|
|
@@ -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.9
|
|
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.4.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.4.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
|