runapi-flux-kontext 0.2.4 → 0.2.6

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: f193fb776ccc4e27f15a68ab2382ff4ed6240b15eb2fed043649ca6166ba7b9f
4
- data.tar.gz: 332267483e79e90e7262bafbf7614e004d27d7562be616b20fb775285f777fa6
3
+ metadata.gz: a7a15941bf71d6217337b7d0dfa6b1136a57f2f9763c24b3a1d4aed5533d8278
4
+ data.tar.gz: 0b126bee144555fba38ffe81675fdbef5933c3eb21017e54c70e86cf75a2c96f
5
5
  SHA512:
6
- metadata.gz: 30b6a4d1ce8e031ca5ed8e3efc53cac9617e250275f754cc3c5898c4e76a9b8bacb0de9dc652c8bafcb82dc4bffab4d4532d7da9742ca507538038f9966ec9e7
7
- data.tar.gz: dbe3121b42f41445e749e705aa2f1472c95e0b267bd05dca64a8cfe3a786f9c2008bc818aaad435326697f2ae909a0b41e86a249948ff2bdcacdc7b4f1c4a1c7
6
+ metadata.gz: 43a7d9be562a0877a517d0a36fe7c485f82e6ea543443787fc158721de1e968661108d0f6875a61da7e115856987384f1c9bb254f7ee239ac10b4458d5ca515c
7
+ data.tar.gz: 9c441b767fb721514c06266d43a3198599c27ac597b79c7cac0c8b0e630766844221a0b9f00d99d8363c5e1e38eca88ebc3d37f8272f9a74c90453ab0fa51723
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Flux Kontext API Ruby SDK for RunAPI
2
+
3
+ The flux kontext api Ruby SDK is the language-specific package for Flux Kontext on RunAPI. Use this flux kontext 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 flux kontext api README is the Ruby package guide inside the public `flux-kontext-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/flux-kontext; for API reference, use https://runapi.ai/docs#flux-kontext; for SDK docs, use https://runapi.ai/docs#sdk-flux-kontext.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-flux-kontext
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-flux-kontext"
17
+
18
+ client = RunApi::FluxKontext::Client.new
19
+ task = client.generations.create(
20
+ # Pass the Flux Kontext JSON request body from https://runapi.ai/docs#flux-kontext.
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
+ 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.
28
+
29
+ ## Language notes
30
+
31
+ Use Ruby keyword arguments and the `RunApi::FluxKontext` error classes when building image jobs, Rails workers, or scripts. The available resources include generations. Keep `RUNAPI_API_KEY` in the environment or your secret manager; never commit API keys or callback secrets.
32
+
33
+ ## Links
34
+
35
+ - Model page: https://runapi.ai/models/flux-kontext
36
+ - SDK docs: https://runapi.ai/docs#sdk-flux-kontext
37
+ - Product docs: https://runapi.ai/docs#flux-kontext
38
+ - Pricing and rate limits: https://runapi.ai/models/flux-kontext/pro
39
+ - Provider comparison: https://runapi.ai/providers/black-forest-labs
40
+ - Full catalog: https://runapi.ai/models
41
+ - Repository: https://github.com/runapi-ai/flux-kontext-sdk
42
+
43
+ ## License
44
+
45
+ Licensed under the Apache License, Version 2.0.
@@ -2,22 +2,22 @@
2
2
 
3
3
  module RunApi
4
4
  module FluxKontext
5
- # Flux Kontext image generation API client.
5
+ # Flux Kontext image generation and editing API client.
6
+ #
7
+ # Supports pure text-to-image generation and image editing via
8
+ # source_image_url. Pro and max quality tiers available.
6
9
  #
7
10
  # @example
8
11
  # client = RunApi::FluxKontext::Client.new(api_key: "your-api-key")
9
12
  # result = client.text_to_image.run(
10
13
  # model: "flux-kontext-pro", prompt: "A futuristic cityscape"
11
14
  # )
12
- class Client
15
+ class Client < RunApi::Core::Client
13
16
  # @return [Resources::TextToImage] Image generation operations.
14
17
  attr_reader :text_to_image
15
18
 
16
19
  def initialize(api_key: nil, **options)
17
- @api_key = Core::Auth.resolve_api_key(api_key)
18
-
19
- client_options = Core::ClientOptions.new(api_key: @api_key, **options)
20
- http = client_options.http_client || Core::HttpClient.new(client_options)
20
+ super
21
21
  @text_to_image = Resources::TextToImage.new(http)
22
22
  end
23
23
  end
@@ -16,7 +16,7 @@ module RunApi
16
16
  class TextToImageResponse < RunApi::Core::TaskResponse
17
17
  required :id, String
18
18
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
19
- optional :images, [ -> { Image } ]
19
+ optional :images, [-> { Image }]
20
20
  optional :error, String
21
21
  end
22
22
 
@@ -24,7 +24,7 @@ module RunApi
24
24
  # `status: "completed"`. `images` is required so consumers never have to
25
25
  # null-check it on a successful task.
26
26
  class CompletedTextToImageResponse < TextToImageResponse
27
- required :images, [ -> { Image } ]
27
+ required :images, [-> { Image }]
28
28
  end
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-flux-kontext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
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.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.4
26
- description: RunAPI Flux Kontext SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.6
26
+ description: The flux kontext api Ruby SDK is the language-specific package for Flux
27
+ Kontext on RunAPI. Use this flux kontext 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-flux_kontext.rb
35
40
  - lib/runapi/flux_kontext.rb
36
41
  - lib/runapi/flux_kontext/client.rb
@@ -41,7 +46,7 @@ licenses:
41
46
  - Apache-2.0
42
47
  metadata:
43
48
  homepage_uri: https://runapi.ai/models/flux-kontext
44
- documentation_uri: https://github.com/runapi-ai/flux-kontext-sdk/blob/main/README.md
49
+ documentation_uri: https://github.com/runapi-ai/flux-kontext-sdk/blob/main/ruby/README.md
45
50
  source_code_uri: https://github.com/runapi-ai/flux-kontext-sdk
46
51
  changelog_uri: https://github.com/runapi-ai/flux-kontext-sdk/blob/main/CHANGELOG.md
47
52
  rdoc_options: []
@@ -60,5 +65,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
65
  requirements: []
61
66
  rubygems_version: 4.0.10
62
67
  specification_version: 4
63
- summary: Flux Kontext API SDKs for JavaScript, Ruby, and Go on RunAPI.
68
+ summary: Flux Kontext API Ruby SDK for RunAPI
64
69
  test_files: []