runapi-gpt-image-2 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: e679c62e55353ec2c36187098975de7770b69c8407f994aacdb5ea17a794c351
4
- data.tar.gz: 9286a4d151ae82e9df3b045f1c241b4c738bac936c550c8bcfc4b9cf3b2e5d67
3
+ metadata.gz: 383291717c0c577f02b6f11183dc172f6bd32a2255dfc7db52567110c9c3935e
4
+ data.tar.gz: dd28c95e23c30806d10798a8a8ca0b68fba6037fd7afe5f227f1a274e9989beb
5
5
  SHA512:
6
- metadata.gz: eb53d80ad81e29e7339bfb845b78fb50f9554d62473559609999deac7c2f55ecebb5041ce296cafe7db807dfd9dab2c8463baaeb35a5b372a27e6b6dfefd29c8
7
- data.tar.gz: 3685800e58e240512d0533f895ede39d1445c2f00971442aa6000e6b1f3d7ee8c21a2289bec4a49955b81706cd3a33b6f82802859be7fbec8ed47e4e81de014e
6
+ metadata.gz: cfbe16568a8a464d2a345c8f38aa4e61942a9c2a68e1c57e1b196e206dfc218d1647fc4c7deecef7177ef4569d1ffc987e9ac1ea6a779ab83319579b9aeac14c
7
+ data.tar.gz: 4a59bb201b2dcb20a67459992c6a53a3752c8026a0f499057871879e76a977b6c102d7b9bf5a40351a15fbbfb7a10d896c3032f3b82ab25c0648d7c37c77a24e
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The GPT Image 2 Ruby SDK is the language-specific package for GPT Image 2 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-2-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/gpt-image-2; for API reference, use https://runapi.ai/docs#gpt-image-2; for SDK docs, use https://runapi.ai/docs#sdk-gpt-image-2.
5
+ This README is the Ruby package guide inside the public `gpt-image-2-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/gpt-image-2; for API reference, use https://runapi.ai/docs/api/gpt-image-2/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-2
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-gpt-image-2"
16
+ require "runapi/gpt_image_2"
17
17
 
18
18
  client = RunApi::GptImage2::Client.new
19
19
  task = client.text_to_image.create(
20
- # Pass the GPT Image 2 JSON request body from https://runapi.ai/docs#gpt-image-2.
20
+ # Pass the GPT Image 2 JSON request body from https://runapi.ai/docs/api/gpt-image-2/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::GptImage2` error classes when buildi
33
33
  ## Links
34
34
 
35
35
  - Model page: https://runapi.ai/models/gpt-image-2
36
- - SDK docs: https://runapi.ai/docs#sdk-gpt-image-2
37
- - Product docs: https://runapi.ai/docs#gpt-image-2
36
+ - SDK docs: https://runapi.ai/docs/resources/sdks
37
+ - Product docs: https://runapi.ai/docs/api/gpt-image-2/text-to-image
38
38
  - Pricing and rate limits: https://runapi.ai/models/gpt-image-2/text-to-image
39
39
  - Provider comparison: https://runapi.ai/providers/openai
40
40
  - Full catalog: https://runapi.ai/models
@@ -17,19 +17,19 @@ module RunApi
17
17
  @http = http
18
18
  end
19
19
 
20
- def run(**params)
21
- task = create(**params)
22
- poll_until_complete { get(task.id) }
20
+ def run(options: nil, **params)
21
+ task = create(options: options, **params)
22
+ poll_until_complete { get(task.id, options: options) }
23
23
  end
24
24
 
25
- def create(**params)
25
+ def create(options: nil, **params)
26
26
  params = compact_params(params)
27
27
  validate_contract!(CONTRACT["edit-image"], params)
28
- request(:post, ENDPOINT, body: params)
28
+ request(:post, ENDPOINT, body: params, options: options)
29
29
  end
30
30
 
31
- def get(id)
32
- request(:get, "#{ENDPOINT}/#{id}")
31
+ def get(id, options: nil)
32
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
33
33
  end
34
34
  end
35
35
  end
@@ -17,19 +17,19 @@ module RunApi
17
17
  @http = http
18
18
  end
19
19
 
20
- def run(**params)
21
- task = create(**params)
22
- poll_until_complete { get(task.id) }
20
+ def run(options: nil, **params)
21
+ task = create(options: options, **params)
22
+ poll_until_complete { get(task.id, options: options) }
23
23
  end
24
24
 
25
- def create(**params)
25
+ def create(options: nil, **params)
26
26
  params = compact_params(params)
27
27
  validate_contract!(CONTRACT["text-to-image"], params)
28
- request(:post, ENDPOINT, body: params)
28
+ request(:post, ENDPOINT, body: params, options: options)
29
29
  end
30
30
 
31
- def get(id)
32
- request(:get, "#{ENDPOINT}/#{id}")
31
+ def get(id, options: nil)
32
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
33
33
  end
34
34
  end
35
35
  end
@@ -13,6 +13,7 @@ module RunApi
13
13
  class TextToImageResponse < RunApi::Core::TaskResponse
14
14
  required :id, String
15
15
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
16
+ optional :task_replayed
16
17
  optional :images, [-> { Image }]
17
18
  optional :error, String
18
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-gpt-image-2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
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.2.7
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.2.7
25
+ version: 0.4.0
26
26
  description: The GPT Image 2 Ruby SDK is the language-specific package for GPT Image
27
27
  2 on RunAPI. Use this package for image generation, image editing, and creative
28
28
  production workflows when your application needs request bodies, task status lookup,