runapi-core 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: df4b7518746af7dc568a3fbda315ef3b1f9e683fb1a7919431c2654cafb54f53
4
- data.tar.gz: d2b57145c7d3d2855df5cd360e31a01614234a4d0ff9fde121ca7a1a7cd1ab7f
3
+ metadata.gz: 43b27ac4a9c29db093d7efcad4686efe7730aa9ddb906a956c0f2a4b353e0ccd
4
+ data.tar.gz: a42105c4a366fa9a17642f519392ae6dd50978a32ae73fae6c62f38f8b02cb28
5
5
  SHA512:
6
- metadata.gz: 0e7b6a5a46d3170cdc14a3ee1046d1ca5efc3a5a068150e909a6130cd04ad28701e9904e161bd1f064c8637a911410e52d34f05dbbb14355644eac24f6d8836e
7
- data.tar.gz: '0873f8ed32e8f8ac2aef057e784be881be9dc587abaa97eeb2773ab57309851dd97c59ed7005837e4794050a79fe301d4e98313d525e4945ff7375ea834cb18b'
6
+ metadata.gz: 9bee66f588446e79bbbf8eea48964bb2505bfee41c4dc9c68ce1622359e0a536e498a895c065ef8efb54c2ee41b5df19b8d7c55b8707d181c3585d2887cb29b5
7
+ data.tar.gz: bb4dc1ff3c4f564c89bc20e4838263864704d54a80f315f093dba9d77e6efabce80bc4087748b816aec20ac0674141e30b1d3ee632e6d92b1f006bb4c07d2b3b
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # RunAPI Core Ruby SDK
2
+
3
+ The RunAPI Core Ruby SDK provides shared authentication, HTTP, retry, error, and polling primitives for RunAPI model gems. Install `runapi-core` only when you are building SDK infrastructure or shared Ruby tooling; application code should normally install a concrete model gem such as `runapi-suno`.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ gem install runapi-core
9
+ ```
10
+
11
+ ## Notes
12
+
13
+ Use the core gem for common client options, error classes, request helpers, and task polling behavior that model SDKs share. Public SDK docs live at https://runapi.ai/docs#runapi-sdks and the model catalog lives at https://runapi.ai/models.
14
+
15
+ ## License
16
+
17
+ Licensed under the Apache License, Version 2.0.
@@ -21,7 +21,7 @@ module RunApi
21
21
 
22
22
  IDEMPOTENT_METHODS = %w[GET HEAD PUT DELETE OPTIONS].freeze
23
23
 
24
- RETRYABLE_STATUS_CODES = [ 429, 500, 502, 503, 504 ].freeze
24
+ RETRYABLE_STATUS_CODES = [429, 500, 502, 503, 504].freeze
25
25
  end
26
26
  end
27
27
  end
@@ -39,15 +39,12 @@ module RunApi
39
39
  409 => "ConflictError",
40
40
  422 => "ValidationError",
41
41
  429 => "RateLimitError",
42
- 451 => "ValidationError",
43
- 455 => "ServiceUnavailableError",
44
42
  500 => "ServerError",
45
43
  501 => "ServerError",
46
44
  502 => "ServerError",
47
45
  503 => "ServiceUnavailableError",
48
46
  504 => "ServerError",
49
- 505 => "ServerError",
50
- 531 => "ServerError"
47
+ 505 => "ServerError"
51
48
  }.freeze
52
49
 
53
50
  DEFAULT_MESSAGES = {
@@ -61,8 +58,6 @@ module RunApi
61
58
  415 => "Unsupported media type",
62
59
  422 => "Validation failed",
63
60
  429 => "Too many requests",
64
- 451 => "Failed to fetch image",
65
- 455 => "Service unavailable (maintenance)",
66
61
  503 => "Service unavailable"
67
62
  }.freeze
68
63
 
@@ -3,7 +3,7 @@
3
3
  module RunApi
4
4
  module Core
5
5
  class HttpClient
6
- STALE_CONNECTION_ERRORS = [ Errno::EPIPE, EOFError, IOError, OpenSSL::SSL::SSLError ].freeze
6
+ STALE_CONNECTION_ERRORS = [Errno::EPIPE, EOFError, IOError, OpenSSL::SSL::SSLError].freeze
7
7
 
8
8
  def initialize(options)
9
9
  @options = options
@@ -91,7 +91,7 @@ module RunApi
91
91
 
92
92
  base = @options.retry_base_delay * (2**(attempt - 1))
93
93
  jitter = rand * base * 0.5
94
- [ base + jitter, @options.retry_max_delay ].min
94
+ [base + jitter, @options.retry_max_delay].min
95
95
  end
96
96
 
97
97
  def parse_body(body)
@@ -15,7 +15,7 @@ module RunApi
15
15
  @http.request(method, path)
16
16
  end
17
17
  else
18
- kwargs = { body: body }
18
+ kwargs = {body: body}
19
19
  kwargs[:options] = options if options
20
20
  @http.request(method, path, **kwargs)
21
21
  end
@@ -107,8 +107,6 @@ module RunApi
107
107
  # @return [String, nil] Current task status.
108
108
  # @!attribute [r] error
109
109
  # @return [String, nil] Error message if task failed.
110
- # @!attribute [r] data
111
- # @return [RunApi::Core::DynamicModel, nil] Task-specific result data.
112
110
  class TaskResponse < BaseModel
113
111
  module Status
114
112
  PENDING = "pending"
@@ -116,13 +114,12 @@ module RunApi
116
114
  COMPLETED = "completed"
117
115
  FAILED = "failed"
118
116
 
119
- ALL = [ PENDING, PROCESSING, COMPLETED, FAILED ].freeze
117
+ ALL = [PENDING, PROCESSING, COMPLETED, FAILED].freeze
120
118
  end
121
119
 
122
120
  optional :id, String
123
121
  optional :status, String
124
122
  optional :error, String
125
- optional :data, -> { DynamicModel }
126
123
  end
127
124
  end
128
125
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module RunApi
4
4
  module Core
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.5"
6
6
  end
7
7
 
8
8
  VERSION = Core::VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runapi-core
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
@@ -23,14 +23,19 @@ dependencies:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '2.4'
26
- description: RunAPI core SDK for JavaScript, Ruby, and Go
26
+ description: The RunAPI Core Ruby SDK provides shared authentication, HTTP, retry,
27
+ error, and polling primitives for RunAPI model gems. Install `runapi-core` only
28
+ when you are building SDK infrastructure or shared Ruby tooling; application code
29
+ should normally install a concrete model gem such as `runapi-suno`.
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-core.rb
35
40
  - lib/runapi/core.rb
36
41
  - lib/runapi/core/auth.rb
@@ -48,7 +53,7 @@ licenses:
48
53
  - Apache-2.0
49
54
  metadata:
50
55
  homepage_uri: https://runapi.ai/models
51
- documentation_uri: https://github.com/runapi-ai/core-sdk/blob/main/README.md
56
+ documentation_uri: https://github.com/runapi-ai/core-sdk/blob/main/ruby/README.md
52
57
  source_code_uri: https://github.com/runapi-ai/core-sdk
53
58
  changelog_uri: https://github.com/runapi-ai/core-sdk/blob/main/CHANGELOG.md
54
59
  rdoc_options: []
@@ -67,5 +72,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
72
  requirements: []
68
73
  rubygems_version: 4.0.10
69
74
  specification_version: 4
70
- summary: Shared SDK primitives for RunAPI JavaScript, Ruby, and Go SDKs.
75
+ summary: RunAPI Core Ruby SDK
71
76
  test_files: []