runapi-gpt-4o-image 0.2.3 → 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: 8baa03d12ef44490c88c9041dea336e7e46788909e2ec904d00885a1fb84c46c
4
- data.tar.gz: 55c388c3d12c333e1bf9eebc33847bad30a8751ad8ecdeb915ff7fdb026d1788
3
+ metadata.gz: 2472cd75263166ddf4f6f6dcbe222c458bae3ccfc1acd0c106e9a2ce42241b1f
4
+ data.tar.gz: adaa442f974bf4101270ab1bbc057e95045594fdd0ec487d09edd60300729908
5
5
  SHA512:
6
- metadata.gz: 15041952b0ac0dc09e6c72869642c7f3c03b6082dce41df90430b2bb4598f7096a5b19b2b06dd0fae352c8383a62459dc4f683f4d8790bb3d27302954915345e
7
- data.tar.gz: 57367a8847e2187baa587dbfe732bd7a34f264675f0e2709db6b9b8b180f274587e16e679aed1c70aad1fe4d476d451239aa62ddd3113af53deff66344916b1f
6
+ metadata.gz: 6471cd4c36028b46fc900d4d3236a8cd1f45eb14ad12aa343c6b8114ab89865a371769c9b57b215f94c5afd93ec873dc35dd32bde83fedfb6703c794d6843beb
7
+ data.tar.gz: f5211a22702956fec1df59e764c4b3d7c45498b768f69673c08ce6c375f8eb36fe7e4534d01293aab469ee4c08e6ebab0838489c49631df4cbc13c72402699f4
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # GPT-4o Image API Ruby SDK for RunAPI
2
+
3
+ The gpt-4o image api Ruby SDK is the language-specific package for GPT-4o Image on RunAPI. Use this gpt-4o image 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 gpt-4o image api README is the Ruby package guide inside the public `gpt4o-image-sdk` repository. For the repository overview, start at `../README.md`; for model details, use https://runapi.ai/models/gpt-4o-image; for API reference, use https://runapi.ai/docs#gpt-4o-image; for SDK docs, use https://runapi.ai/docs#sdk-gpt-4o-image.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ gem install runapi-gpt4o-image
11
+ ```
12
+
13
+ ## Quick start
14
+
15
+ ```ruby
16
+ require "runapi-gpt4o-image"
17
+
18
+ client = RunApi::Gpt4oImage::Client.new
19
+ task = client.generations.create(
20
+ # Pass the GPT-4o Image JSON request body from https://runapi.ai/docs#gpt-4o-image.
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::Gpt4oImage` 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.
30
+
31
+ ## Links
32
+
33
+ - Model page: https://runapi.ai/models/gpt-4o-image
34
+ - SDK docs: https://runapi.ai/docs#sdk-gpt-4o-image
35
+ - Product docs: https://runapi.ai/docs#gpt-4o-image
36
+ - Pricing and rate limits: https://runapi.ai/models/gpt-4o-image
37
+ - Provider comparison: https://runapi.ai/providers/openai
38
+ - Full catalog: https://runapi.ai/models
39
+ - Repository: https://github.com/runapi-ai/gpt4o-image-sdk
40
+
41
+ ## License
42
+
43
+ Licensed under the Apache License, Version 2.0.
@@ -34,16 +34,15 @@ module RunApi
34
34
 
35
35
  def validate_params!(params)
36
36
  raise Core::ValidationError, "model is required" unless param(params, :model)
37
- raise Core::ValidationError, "size is required" unless param(params, :size)
37
+ raise Core::ValidationError, "aspect_ratio is required" unless param(params, :aspect_ratio)
38
38
 
39
39
  model = param(params, :model)
40
40
  unless Types::MODELS.include?(model)
41
41
  raise Core::ValidationError, "Invalid model: #{model}. Must be: #{Types::MODELS.join(", ")}"
42
42
  end
43
43
 
44
- validate_optional!(params, :size, Types::SIZES)
45
- validate_optional!(params, :n_variants, Types::N_VARIANTS)
46
- validate_optional!(params, :fallback_model, Types::FALLBACK_MODELS)
44
+ validate_optional!(params, :aspect_ratio, Types::ASPECT_RATIOS)
45
+ validate_optional!(params, :output_count, Types::OUTPUT_COUNTS)
47
46
  end
48
47
  end
49
48
  end
@@ -4,9 +4,8 @@ module RunApi
4
4
  module Gpt4oImage
5
5
  module Types
6
6
  MODELS = %w[gpt-4o-image].freeze
7
- SIZES = %w[1:1 3:2 2:3].freeze
8
- FALLBACK_MODELS = %w[GPT_IMAGE_1 FLUX_MAX].freeze
9
- N_VARIANTS = [ 1, 2, 4 ].freeze
7
+ ASPECT_RATIOS = %w[1:1 3:2 2:3].freeze
8
+ OUTPUT_COUNTS = [1, 2, 4].freeze
10
9
 
11
10
  class Image < RunApi::Core::BaseModel
12
11
  optional :url, String
@@ -15,7 +14,7 @@ module RunApi
15
14
  class TextToImageResponse < RunApi::Core::TaskResponse
16
15
  required :id, String
17
16
  optional :status, String, enum: -> { RunApi::Core::TaskResponse::Status::ALL }
18
- optional :images, [ -> { Image } ]
17
+ optional :images, [-> { Image }]
19
18
  optional :progress, String
20
19
  optional :error, String
21
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-gpt-4o-image
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
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.3
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.3
26
- description: RunAPI GPT-4o Image SDK for JavaScript, Ruby, and Go
25
+ version: 0.2.5
26
+ description: The gpt-4o image api Ruby SDK is the language-specific package for GPT-4o
27
+ Image on RunAPI. Use this gpt-4o image 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-gpt_4o_image.rb
35
40
  - lib/runapi/gpt_4o_image.rb
36
41
  - lib/runapi/gpt_4o_image/client.rb
@@ -41,7 +46,7 @@ licenses:
41
46
  - Apache-2.0
42
47
  metadata:
43
48
  homepage_uri: https://runapi.ai/models/gpt-4o-image
44
- documentation_uri: https://runapi.ai/models/gpt-4o-image
49
+ documentation_uri: https://github.com/runapi-ai/gpt-4o-image-sdk/blob/main/ruby/README.md
45
50
  source_code_uri: https://github.com/runapi-ai/gpt-4o-image-sdk
46
51
  changelog_uri: https://github.com/runapi-ai/gpt-4o-image-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: GPT-4o Image API SDKs for JavaScript, Ruby, and Go on RunAPI.
68
+ summary: GPT-4o Image API Ruby SDK for RunAPI
64
69
  test_files: []