runapi-nano-banana 0.2.9 → 0.2.11

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: 3737c1cd6272c4da25d7e643354bd6994e1e5f7deecf0d8e50a477498aaf4069
4
- data.tar.gz: 91c62e9bf1e746a6aff3e3532045d3a44fee21bc11ee745ed4927d5bb2f9e823
3
+ metadata.gz: d5f3abde20ddbde997ac45b189e30db3a876b7e643d72bcf364c5e87838a881d
4
+ data.tar.gz: d18271b8269cd6caae4e075e81dee9f5dc95ac6a68aab2340876301bbeb76a20
5
5
  SHA512:
6
- metadata.gz: e336b5616cbb7537a6c7f12df8d5e18536c397af22d656549cf6e57f867b2b30e33265f1892f9b128cb2187695063f6e71896bb6e893088133c033c1ba21c70e
7
- data.tar.gz: 6029e2fd0b8b712b86ca2ff62c9c397a0479478630f4f77a10305e9608eb7961bfaf695f0a4947b0dd4dccc3111bf237d49fcf9f8c94d64c7c66dd95ea7c5397
6
+ metadata.gz: 449e22c7c0d85c10e117b7d342a39c99502fb6a0844622be97686b7971619291d226c5cd196f0ffe949ddcfbecbce1d88431169155515302871de08704ccb7e7
7
+ data.tar.gz: f6fcca9337bbab265d726c1ecbaedc941b5efe5af4193967687a675e0dc39624c28425de5b5fd2070ca07656c639274f2ce17cc9adef06e24fec2800dacf8f4b
@@ -4,9 +4,8 @@ module RunApi
4
4
  module NanoBanana
5
5
  # NanoBanana image generation and editing API client.
6
6
  #
7
- # Three generation tiers: standard (fast), pro (higher resolution, more
8
- # reference images), and v2 (longest prompts, extreme aspect ratios, up to
9
- # 14 reference images). Editing uses the dedicated +nano-banana-edit+ model.
7
+ # Generation tiers include standard, pro, v2, and v2 lite. Image editing
8
+ # supports +nano-banana-2-lite+ and the dedicated +nano-banana-edit+ model.
10
9
  #
11
10
  # @example
12
11
  # client = RunApi::NanoBanana::Client.new(api_key: "your-api-key")
@@ -4,8 +4,25 @@ module RunApi
4
4
  module NanoBanana
5
5
  CONTRACT = {
6
6
  "edit-image" => {
7
- "models" => ["nano-banana-edit"],
7
+ "models" => ["nano-banana-2-lite", "nano-banana-edit"],
8
8
  "fields_by_model" => {
9
+ "nano-banana-2-lite" => {
10
+ "aspect_ratio" => {
11
+ "enum" => ["1:1", "1:4", "1:8", "2:3", "3:2", "3:4", "4:1", "4:3", "4:5", "5:4", "8:1", "9:16", "16:9", "21:9", "auto"],
12
+ "required" => true
13
+ },
14
+ "prompt" => {
15
+ "required" => true,
16
+ "min" => 1,
17
+ "max" => 20000,
18
+ "length" => true
19
+ },
20
+ "source_image_urls" => {
21
+ "required" => true,
22
+ "min_items" => 1,
23
+ "max_items" => 10
24
+ }
25
+ },
9
26
  "nano-banana-edit" => {
10
27
  "aspect_ratio" => {
11
28
  "enum" => ["1:1", "9:16", "16:9", "3:4", "4:3", "3:2", "2:3", "5:4", "4:5", "21:9", "auto"]
@@ -17,7 +34,13 @@ module RunApi
17
34
  "required" => true
18
35
  }
19
36
  }
20
- }
37
+ },
38
+ "rules" => [{
39
+ "when" => {
40
+ "model" => "nano-banana-2-lite"
41
+ },
42
+ "forbidden" => ["output_format"]
43
+ }]
21
44
  },
22
45
  "text-to-image" => {
23
46
  "models" => ["nano-banana", "nano-banana-2", "nano-banana-2-lite", "nano-banana-pro"],
@@ -51,6 +74,9 @@ module RunApi
51
74
  "min" => 1,
52
75
  "max" => 20000,
53
76
  "length" => true
77
+ },
78
+ "reference_image_urls" => {
79
+ "max_items" => 10
54
80
  }
55
81
  },
56
82
  "nano-banana-pro" => {
@@ -4,11 +4,12 @@ module RunApi
4
4
  module NanoBanana
5
5
  module Resources
6
6
  # NanoBanana image editing resource.
7
- # Edit existing images using text prompts and reference images.
7
+ # Edit existing images using text prompts and source images.
8
8
  class EditImage
9
9
  include RunApi::Core::ResourceHelpers
10
10
 
11
11
  ENDPOINT = "/api/v1/nano_banana/edit_image"
12
+ DEFAULT_MODEL = "nano-banana-2-lite"
12
13
 
13
14
  RESPONSE_CLASS = Types::EditImageResponse
14
15
  COMPLETED_RESPONSE_CLASS = Types::CompletedEditImageResponse
@@ -32,6 +33,7 @@ module RunApi
32
33
  # @return [RunApi::NanoBanana::Types::EditImageResponse] task creation result with id
33
34
  def create(options: nil, **params)
34
35
  params = compact_params(params)
36
+ params[:model] = DEFAULT_MODEL unless param(params, :model)
35
37
  validate_params!(params)
36
38
  request(:post, ENDPOINT, body: params, options: options)
37
39
  end
@@ -9,6 +9,7 @@ module RunApi
9
9
  include RunApi::Core::ResourceHelpers
10
10
 
11
11
  ENDPOINT = "/api/v1/nano_banana/text_to_image"
12
+ DEFAULT_MODEL = "nano-banana-2-lite"
12
13
 
13
14
  RESPONSE_CLASS = Types::TextToImageResponse
14
15
  COMPLETED_RESPONSE_CLASS = Types::CompletedTextToImageResponse
@@ -29,7 +30,7 @@ module RunApi
29
30
  # Create an image generation task.
30
31
  #
31
32
  # @param params [Hash] generation parameters
32
- # @option params [String] :model model slug, e.g. "nano-banana", "nano-banana-pro", "nano-banana-2", "nano-banana-2-lite"
33
+ # @option params [String] :model optional; defaults to "nano-banana-2-lite"
33
34
  # @option params [String] :prompt required; image description
34
35
  # @option params [String] :aspect_ratio optional; required for nano-banana-2-lite
35
36
  # @option params [String] :output_format optional; "png", "jpeg", or "jpg" (not supported by nano-banana-2-lite)
@@ -39,6 +40,7 @@ module RunApi
39
40
  # @return [RunApi::NanoBanana::Types::TextToImageResponse] task creation result with id
40
41
  def create(options: nil, **params)
41
42
  params = compact_params(params)
43
+ params[:model] = DEFAULT_MODEL unless param(params, :model)
42
44
  validate_params!(params)
43
45
  request(:post, ENDPOINT, body: params, options: options)
44
46
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-nano-banana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.11
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.9
18
+ version: 0.2.14
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.9
25
+ version: 0.2.14
26
26
  description: The Nano Banana Ruby SDK is the language-specific package for Nano Banana
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