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 +4 -4
- data/README.md +17 -0
- data/lib/runapi/core/constants.rb +1 -1
- data/lib/runapi/core/errors.rb +1 -6
- data/lib/runapi/core/http_client.rb +2 -2
- data/lib/runapi/core/resource_helpers.rb +1 -1
- data/lib/runapi/core/types.rb +1 -4
- data/lib/runapi/core/version.rb +1 -1
- metadata +10 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 43b27ac4a9c29db093d7efcad4686efe7730aa9ddb906a956c0f2a4b353e0ccd
|
|
4
|
+
data.tar.gz: a42105c4a366fa9a17642f519392ae6dd50978a32ae73fae6c62f38f8b02cb28
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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.
|
data/lib/runapi/core/errors.rb
CHANGED
|
@@ -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 = [
|
|
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
|
-
[
|
|
94
|
+
[base + jitter, @options.retry_max_delay].min
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
def parse_body(body)
|
data/lib/runapi/core/types.rb
CHANGED
|
@@ -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 = [
|
|
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
|
data/lib/runapi/core/version.rb
CHANGED
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
|
+
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
|
|
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:
|
|
75
|
+
summary: RunAPI Core Ruby SDK
|
|
71
76
|
test_files: []
|