runapi-imagen-4 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: ea234432febf88c1855e89f392cd149536bbe684e53ff1925ae96cef7389860c
4
- data.tar.gz: 01eaf089e6d251e3bb5c96c17b9f1a228bf8fca32869040796f1d961d42a96a6
3
+ metadata.gz: 5263659ace45593a8ec56856209acf33bdd3fc74e365233a57fd4eb0734da662
4
+ data.tar.gz: 267689f4d80d6f6eb9e60c14bafe491d07020b299b6f9e3b2eea8b8813c8c4b9
5
5
  SHA512:
6
- metadata.gz: 6192d061bdd620f15a8cf5436aaa2c53c6a0ec8a780650f10c92f46be7cc112a1398e6cb2769dca74f16df7b92bb3b4a53927fb6f77eb0075a2c4f978eb1ebca
7
- data.tar.gz: 5cba0828fa53be275b8e835b310a163d1d6b7fce906f3579b9a0f43509724138d5c40e58887c3ee8c1c1dc73dff89bc1a61aaf3faee378c7ca0f86e1eba510de
6
+ metadata.gz: 8e2c70344452ea99e8a103f5c34e12d8f75d32ef19e062f5056dc0327dfe0bb6ceb1a63d0d7f7c577e206cf63a58433a0b67cd85c12b9ed2e7bb84b2827641db
7
+ data.tar.gz: 6d7539f159e7ec94f0c6ea779ca019258a6e6d723bee1227a1db5eff8370a8206769370789c1581f837b9f1cba2e3ee0e7ef7a52522e01d53833433b35d39767
data/README.md CHANGED
@@ -13,7 +13,7 @@ gem install runapi-imagen-4
13
13
  ## Quick start
14
14
 
15
15
  ```ruby
16
- require "runapi-imagen-4"
16
+ require "runapi/imagen_4"
17
17
 
18
18
  client = RunApi::Imagen4::Client.new
19
19
  task = client.text_to_image.create(
@@ -29,20 +29,13 @@ module RunApi
29
29
  "aspect_ratio" => {
30
30
  "enum" => ["1:1", "16:9", "9:16", "3:4", "4:3"]
31
31
  },
32
- "output_count" => {
33
- "type" => "integer"
34
- },
35
32
  "seed" => {
36
33
  "type" => "integer"
37
34
  }
38
35
  },
39
36
  "imagen-4-fast" => {
40
37
  "aspect_ratio" => {
41
- "enum" => ["1:1", "16:9", "9:16", "3:4", "4:3"]
42
- },
43
- "output_count" => {
44
- "enum" => [1, 2, 3, 4],
45
- "type" => "integer"
38
+ "enum" => ["1:1", "16:9", "9:16", "3:4", "4:3", "auto"]
46
39
  },
47
40
  "seed" => {
48
41
  "type" => "integer"
@@ -52,9 +45,6 @@ module RunApi
52
45
  "aspect_ratio" => {
53
46
  "enum" => ["1:1", "16:9", "9:16", "3:4", "4:3"]
54
47
  },
55
- "output_count" => {
56
- "type" => "integer"
57
- },
58
48
  "seed" => {
59
49
  "type" => "integer"
60
50
  }
@@ -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_params!(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
 
35
35
  private
@@ -4,7 +4,7 @@ module RunApi
4
4
  module Imagen4
5
5
  module Resources
6
6
  # Imagen 4 text-to-image generation resource.
7
- # Generate images from text with three quality tiers; imagen-4-fast supports batch output.
7
+ # Generate images from text with three quality tiers.
8
8
  class TextToImage
9
9
  include RunApi::Core::ResourceHelpers
10
10
 
@@ -16,19 +16,19 @@ module RunApi
16
16
  @http = http
17
17
  end
18
18
 
19
- def run(**params)
20
- task = create(**params)
21
- poll_until_complete { get(task.id) }
19
+ def run(options: nil, **params)
20
+ task = create(options: options, **params)
21
+ poll_until_complete { get(task.id, options: options) }
22
22
  end
23
23
 
24
- def create(**params)
24
+ def create(options: nil, **params)
25
25
  params = compact_params(params)
26
26
  validate_params!(params)
27
- request(:post, ENDPOINT, body: params)
27
+ request(:post, ENDPOINT, body: params, options: options)
28
28
  end
29
29
 
30
- def get(id)
31
- request(:get, "#{ENDPOINT}/#{id}")
30
+ def get(id, options: nil)
31
+ request(:get, "#{ENDPOINT}/#{id}", options: options)
32
32
  end
33
33
 
34
34
  private
@@ -37,10 +37,6 @@ module RunApi
37
37
  validate_contract!(CONTRACT["text-to-image"], params)
38
38
 
39
39
  raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
40
-
41
- if param(params, :output_count) && param(params, :model) != "imagen-4-fast"
42
- raise Core::ValidationError, "output_count is only supported for imagen-4-fast"
43
- end
44
40
  end
45
41
  end
46
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-imagen-4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
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.2.7
18
+ version: 0.2.10
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.2.10
26
26
  description: The Imagen 4 Ruby SDK is the language-specific package for Imagen 4 on
27
27
  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