runapi-nano-banana 0.2.4 → 0.2.5

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: ad7b97a266bf40926a5a50411bf11f7d39dee8be80fe47c7c97ef9ae3ef41684
4
- data.tar.gz: '09678684916edba28b6a02e3df4bbbc4f6f6869b9447acce18c937eee67995c0'
3
+ metadata.gz: 3eee5aec4249b7737dbe3f214b9b8a201fbeb1896b4a5173c008d98ed2295f3e
4
+ data.tar.gz: 4989e0ecf05cc139c723fa0287789e0365b7ab43dc69204bb71424d3484d34ce
5
5
  SHA512:
6
- metadata.gz: 945ae7da15e1c54507af064c254f4a9b417965cbd1bbfea947644e0dc69c516e9a6a34af43a842c941d45aeaabd84b17902d3cba8f9fcb2696351eb310a0c778
7
- data.tar.gz: 102d78f223c3ccd3baef8525e41336418431fec1ade4b5785be0b78feb70ac0acb323b3142a2f2ff141032218f22298564bad872ae7f49a5f7d08c7428e9e03f
6
+ metadata.gz: 45090f80b467bbab5d7b28081a862414da36afcc5af4db686b67b993f2a1b027b038f7b6e837d82ca4a0d4d6bcc896356f1c86efb333e641d3e9902549561376
7
+ data.tar.gz: 5167144f59027642ec67cd602df5eac0dfc560f61ac641b228e48c6666ea06a00cc1c82923a5ca1fe9d3b827ae32113d8fe2fc400d40020578a785b968845e30
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Nano Banana API Ruby SDK for RunAPI
2
+
3
+ The nano banana api Ruby SDK is the language-specific package for Nano Banana on RunAPI. Use this nano banana api package for text-to-image, image editing, and creative production flows when your application needs JSON request bodies, task status lookup, and consistent RunAPI errors in Ruby.
4
+
5
+ This nano banana api README is the Ruby package guide inside the public `nano-banana-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/nano-banana; for API reference, use https://runapi.ai/docs#nano-banana; for SDK docs, use https://runapi.ai/docs#sdk-nano-banana.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-nano-banana
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-nano-banana"
17
+
18
+ client = RunApi::NanoBanana::Client.new
19
+ task = client.generations.create(
20
+ # Pass the Nano Banana JSON request body from https://runapi.ai/docs#nano-banana.
21
+ )
22
+ status = client.generations.get(task.id)
23
+ ```
24
+
25
+ Use `create` when you want to submit a task and return quickly, `get` when you need the latest task state, and `run` when a script should create and poll until completion. In web request handlers, prefer `create` plus webhook or later `get` polling so a worker is not held open.
26
+
27
+ ## Language notes
28
+
29
+ Use Ruby keyword arguments and the `RunApi::NanoBanana` error classes when building image jobs, Rails workers, or scripts. The available resources include generations, and edits. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
30
+
31
+ ## Links
32
+
33
+ - Model page: https://runapi.ai/models/nano-banana
34
+ - SDK docs: https://runapi.ai/docs#sdk-nano-banana
35
+ - Product docs: https://runapi.ai/docs#nano-banana
36
+ - Pricing and rate limits: https://runapi.ai/models/nano-banana/nano-banana
37
+ - Provider comparison: https://runapi.ai/providers/google
38
+ - Full catalog: https://runapi.ai/models
39
+ - Repository: https://github.com/runapi-ai/nano-banana-sdk
40
+
41
+ ## License
42
+
43
+ Licensed under the Apache License, Version 2.0.
@@ -20,7 +20,7 @@ module RunApi
20
20
  # Edit an image and wait until complete.
21
21
  #
22
22
  # @param params [Hash] edit parameters
23
- # @return [RunApi::NanoBanana::Types::CompletedEditImageResponse] completed edit with result URLs
23
+ # @return [RunApi::NanoBanana::Types::CompletedEditImageResponse] completed edit with image results
24
24
  def run(**params)
25
25
  task = create(**params)
26
26
  poll_until_complete { get(task.id) }
@@ -49,7 +49,7 @@ module RunApi
49
49
  def validate_params!(params)
50
50
  raise Core::ValidationError, "model is required" unless param(params, :model)
51
51
  raise Core::ValidationError, "prompt is required" unless param(params, :prompt)
52
- raise Core::ValidationError, "image_urls is required" unless param(params, :image_urls)
52
+ raise Core::ValidationError, "source_image_urls is required" unless param(params, :source_image_urls)
53
53
 
54
54
  model = param(params, :model)
55
55
  unless Types::EDIT_MODELS.include?(model)
@@ -57,6 +57,7 @@ module RunApi
57
57
  end
58
58
 
59
59
  validate_optional!(params, :output_format, Types::OUTPUT_FORMATS)
60
+ validate_optional!(params, :aspect_ratio, Types::BASE_ASPECT_RATIOS)
60
61
  end
61
62
  end
62
63
  end
@@ -20,7 +20,7 @@ module RunApi
20
20
  # Generate an image and wait until complete.
21
21
  #
22
22
  # @param params [Hash] generation parameters
23
- # @return [RunApi::NanoBanana::Types::CompletedTextToImageResponse] completed generation with result URLs
23
+ # @return [RunApi::NanoBanana::Types::CompletedTextToImageResponse] completed generation with image results
24
24
  def run(**params)
25
25
  task = create(**params)
26
26
  poll_until_complete { get(task.id) }
@@ -56,7 +56,7 @@ module RunApi
56
56
  end
57
57
 
58
58
  validate_optional!(params, :aspect_ratio, Types::ASPECT_RATIOS)
59
- validate_optional!(params, :resolution, Types::RESOLUTIONS)
59
+ validate_optional!(params, :output_resolution, Types::OUTPUT_RESOLUTIONS)
60
60
  validate_optional!(params, :output_format, Types::OUTPUT_FORMATS)
61
61
  end
62
62
  end
@@ -6,15 +6,14 @@ module RunApi
6
6
  GENERATION_MODELS = %w[nano-banana nano-banana-pro nano-banana-2].freeze
7
7
  EDIT_MODELS = %w[nano-banana-edit].freeze
8
8
 
9
- IMAGE_SIZES = %w[1:1 9:16 16:9 3:4 4:3 3:2 2:3 5:4 4:5 21:9 auto].freeze
9
+ BASE_ASPECT_RATIOS = %w[1:1 9:16 16:9 3:4 4:3 3:2 2:3 5:4 4:5 21:9 auto].freeze
10
10
  ASPECT_RATIOS = %w[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].freeze
11
- RESOLUTIONS = %w[1K 2K 4K].freeze
11
+ OUTPUT_RESOLUTIONS = %w[1k 2k 4k].freeze
12
12
  OUTPUT_FORMATS = %w[png jpg jpeg].freeze
13
13
 
14
14
  class Image < RunApi::Core::BaseModel
15
- optional :id, String
16
15
  optional :url, String
17
- optional :image_url, String
16
+ optional :origin_url, String
18
17
  end
19
18
 
20
19
  class AsyncTaskResponse < RunApi::Core::TaskResponse
@@ -23,24 +22,22 @@ module RunApi
23
22
  end
24
23
 
25
24
  class TextToImageResponse < AsyncTaskResponse
26
- optional :result_urls, [ String ]
27
- optional :image, -> { Image }
25
+ optional :images, [-> { Image }]
28
26
  end
29
27
 
30
28
  class EditImageResponse < AsyncTaskResponse
31
- optional :result_urls, [ String ]
32
- optional :image, -> { Image }
29
+ optional :images, [-> { Image }]
33
30
  end
34
31
 
35
32
  # Narrowed responses returned by `run()` methods once polling observes
36
- # `status: "completed"`. `result_urls` is required so consumers never
33
+ # `status: "completed"`. `images` is required so consumers never
37
34
  # have to null-check it on a successful task.
38
35
  class CompletedTextToImageResponse < TextToImageResponse
39
- required :result_urls, [ String ]
36
+ required :images, [-> { Image }]
40
37
  end
41
38
 
42
39
  class CompletedEditImageResponse < EditImageResponse
43
- required :result_urls, [ String ]
40
+ required :images, [-> { Image }]
44
41
  end
45
42
  end
46
43
  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.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - RunAPI
@@ -15,22 +15,27 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 0.2.4
18
+ version: 0.2.5
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.4
26
- description: RunAPI Nano Banana SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.5
26
+ description: The nano banana api Ruby SDK is the language-specific package for Nano
27
+ Banana on RunAPI. Use this nano banana api package for text-to-image, image editing,
28
+ and creative production flows when your application needs JSON request bodies, task
29
+ status lookup, and consistent RunAPI errors in Ruby.
27
30
  email:
28
31
  - contact@runapi.ai
29
32
  executables: []
30
33
  extensions: []
31
- extra_rdoc_files: []
34
+ extra_rdoc_files:
35
+ - README.md
32
36
  files:
33
37
  - LICENSE
38
+ - README.md
34
39
  - lib/runapi-nano_banana.rb
35
40
  - lib/runapi/nano_banana.rb
36
41
  - lib/runapi/nano_banana/client.rb
@@ -42,7 +47,7 @@ licenses:
42
47
  - Apache-2.0
43
48
  metadata:
44
49
  homepage_uri: https://runapi.ai/models/nano-banana
45
- documentation_uri: https://github.com/runapi-ai/nano-banana-sdk/blob/main/README.md
50
+ documentation_uri: https://github.com/runapi-ai/nano-banana-sdk/blob/main/ruby/README.md
46
51
  source_code_uri: https://github.com/runapi-ai/nano-banana-sdk
47
52
  changelog_uri: https://github.com/runapi-ai/nano-banana-sdk/blob/main/CHANGELOG.md
48
53
  rdoc_options: []
@@ -61,5 +66,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
66
  requirements: []
62
67
  rubygems_version: 4.0.10
63
68
  specification_version: 4
64
- summary: Nano Banana API SDKs for JavaScript, Ruby, and Go on RunAPI.
69
+ summary: Nano Banana API Ruby SDK for RunAPI
65
70
  test_files: []