runapi-seedream 0.2.6 → 0.2.7

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: fd5375e0156b01735780ac14365797062e03a0e0659b2fa18077b8b00103d7a0
4
- data.tar.gz: 2a3501a778307978b225a90234903ae77ce518b3d6cb206604cb5efa72be4f03
3
+ metadata.gz: d8ca9b02c90b624e837c7652223020526592784b12d0f0a6f54f7afc6d9ed4d7
4
+ data.tar.gz: a7b2b5fe72b6135055d4f0838fd9e704f6222c9cd1410615d6b1ca718af078c2
5
5
  SHA512:
6
- metadata.gz: 00a681e2011e9a77015c55036e537aaa40f0d451142f1b2cd0582e91dd500c24599f17be6b2f226a46f986c6ac2c406fd0241b2fc6a22e309c930185f49e874d
7
- data.tar.gz: e6e1ac147c0b246d308571e541e6aa5f5782e7c5fb2bff7bcd51385646af17893f8537a1999d237e0e0337700e814fd31e546506a37e97e2fca48ca26cc6f93e
6
+ metadata.gz: f4a3270d5d1920a9151e5d9053aba445e7a07125522e4508a5da35585d9fc69ecbed5681607fe5895bd829ef50b79b8fb16021dfcb7c76174a8e14e5c090cf28
7
+ data.tar.gz: 2f5cfa1042a0b46d66c70586cd95b24e688eac376699708a8806c8c78bc1ee9aa5abce75eb98f5ef32bbc73985aadad9b99ebead702603dbfef2a2d64cbd60a6
data/README.md CHANGED
@@ -28,6 +28,8 @@ status = client.text_to_image.get(task.id)
28
28
 
29
29
  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.
30
30
 
31
+ RunAPI-generated file URLs are temporary. Download and store generated images, videos, audio, or other files in your own durable storage within 7 days; do not treat returned URLs as long-term assets.
32
+
31
33
  ## Language notes
32
34
 
33
35
  Use Ruby keyword arguments and the `RunApi::Seedream` error classes when building image jobs, Rails workers, or scripts. The package exposes `text_to_image` for text models and `edit_image` for editing models. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
@@ -2,14 +2,36 @@
2
2
 
3
3
  module RunApi
4
4
  module Seedream
5
- class Client
6
- attr_reader :text_to_image, :edit_image
5
+ # Seedream image generation and editing API client.
6
+ #
7
+ # Three model families with different field requirements:
8
+ # - 4.5: requires aspect_ratio and output_quality
9
+ # - 5-lite: same required fields as 4.5, faster generation
10
+ # - V4: uses output_resolution instead; supports seed and batch output_count
11
+ #
12
+ # @example
13
+ # client = RunApi::Seedream::Client.new(api_key: "your-api-key")
14
+ #
15
+ # # Seedream 4.5
16
+ # result = client.text_to_image.run(
17
+ # model: "seedream-4.5-text-to-image",
18
+ # prompt: "A beautiful product render",
19
+ # aspect_ratio: "16:9", output_quality: "high"
20
+ # )
21
+ #
22
+ # # Seedream V4 with batch output
23
+ # batch = client.text_to_image.run(
24
+ # model: "seedream-v4-text-to-image",
25
+ # prompt: "Minimalist logo design", output_count: 4
26
+ # )
27
+ class Client < RunApi::Core::Client
28
+ # @return [Resources::TextToImage] Text-to-image generation across model versions.
29
+ attr_reader :text_to_image
30
+ # @return [Resources::EditImage] Edit source images with a text prompt.
31
+ attr_reader :edit_image
7
32
 
8
33
  def initialize(api_key: nil, **options)
9
- @api_key = Core::Auth.resolve_api_key(api_key)
10
-
11
- client_options = Core::ClientOptions.new(api_key: @api_key, **options)
12
- http = client_options.http_client || Core::HttpClient.new(client_options)
34
+ super
13
35
  @text_to_image = Resources::TextToImage.new(http)
14
36
  @edit_image = Resources::EditImage.new(http)
15
37
  end
@@ -3,6 +3,9 @@
3
3
  module RunApi
4
4
  module Seedream
5
5
  module Resources
6
+ # Seedream image editing resource.
7
+ # Modifies source images according to a text prompt.
8
+ # V4 models accept up to 10 source images; 4.5 and 5-lite accept up to 14.
6
9
  class EditImage
7
10
  include RunApi::Core::ResourceHelpers
8
11
 
@@ -3,6 +3,9 @@
3
3
  module RunApi
4
4
  module Seedream
5
5
  module Resources
6
+ # Seedream text-to-image generation resource.
7
+ # Field requirements vary by model: 4.5/5-lite require aspect_ratio and
8
+ # output_quality; V4 uses output_resolution and supports seed/output_count.
6
9
  class TextToImage
7
10
  include RunApi::Core::ResourceHelpers
8
11
 
@@ -2,6 +2,9 @@
2
2
 
3
3
  module RunApi
4
4
  module Seedream
5
+ # Seedream type constants and response models.
6
+ # Model families differ in supported params: 4.5/5-lite require aspect_ratio
7
+ # and output_quality; V4 uses output_resolution and supports seed/output_count.
5
8
  module Types
6
9
  MODELS = %w[
7
10
  seedream-4.5-text-to-image
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-seedream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
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.5
18
+ version: 0.2.6
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.5
25
+ version: 0.2.6
26
26
  description: The seedream api Ruby SDK is the language-specific package for Seedream
27
27
  on RunAPI. Use this seedream api package for text-to-image, image editing, and creative
28
28
  production flows when your application needs JSON request bodies, task status lookup,