runapi-core 0.3.5__tar.gz → 0.3.6__tar.gz
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.
- {runapi_core-0.3.5 → runapi_core-0.3.6}/PKG-INFO +2 -2
- {runapi_core-0.3.5 → runapi_core-0.3.6}/pyproject.toml +1 -1
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/contract_gen.py +36 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/resource.py +4 -2
- runapi_core-0.3.6/src/runapi/core/version.py +1 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_resource.py +10 -0
- runapi_core-0.3.5/src/runapi/core/version.py +0 -1
- {runapi_core-0.3.5 → runapi_core-0.3.6}/README.md +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/__init__.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/account.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/auth.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/config.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/constants.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/errors.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/files.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/http_client.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/models.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/multipart.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/options.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/polling.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/pricing.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/provider_client.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/py.typed +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/src/runapi/core/response.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_account.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_auth.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_config.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_errors.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_files.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_http_client.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_models.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_polling.py +0 -0
- {runapi_core-0.3.5 → runapi_core-0.3.6}/tests/test_pricing.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: runapi-core
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.6
|
|
4
4
|
Summary: RunAPI core SDK for JavaScript, Python, Ruby, Go, Java, and PHP
|
|
5
5
|
Project-URL: Homepage, https://runapi.ai/models
|
|
6
6
|
Project-URL: Documentation, https://runapi.ai/docs/resources/sdks
|
|
7
7
|
Project-URL: Source, https://github.com/runapi-ai/core-sdk
|
|
8
8
|
Project-URL: Issues, https://github.com/runapi-ai/core-sdk/issues
|
|
9
9
|
Project-URL: Changelog, https://github.com/runapi-ai/core-sdk/blob/main/CHANGELOG.md
|
|
10
|
-
Project-URL: Release Notes, https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.3.
|
|
10
|
+
Project-URL: Release Notes, https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.3.6
|
|
11
11
|
Author-email: RunAPI <contact@runapi.ai>
|
|
12
12
|
License-Expression: Apache-2.0
|
|
13
13
|
Keywords: api,core,golang,gradle,java,maven,pypi,python,ruby,runapi,runapi-ai,sdk,typescript
|
|
@@ -19,7 +19,7 @@ Documentation = "https://runapi.ai/docs/resources/sdks"
|
|
|
19
19
|
Source = "https://github.com/runapi-ai/core-sdk"
|
|
20
20
|
Issues = "https://github.com/runapi-ai/core-sdk/issues"
|
|
21
21
|
Changelog = "https://github.com/runapi-ai/core-sdk/blob/main/CHANGELOG.md"
|
|
22
|
-
"Release Notes" = "https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.3.
|
|
22
|
+
"Release Notes" = "https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.3.6"
|
|
23
23
|
|
|
24
24
|
[tool.hatch.version]
|
|
25
25
|
path = "src/runapi/core/version.py"
|
|
@@ -1007,6 +1007,9 @@ CONTRACT = {
|
|
|
1007
1007
|
"models": ["pixverse-v6"],
|
|
1008
1008
|
"fields_by_model": {
|
|
1009
1009
|
"pixverse-v6": {
|
|
1010
|
+
"enable_audio": {
|
|
1011
|
+
"enum": [True, False]
|
|
1012
|
+
},
|
|
1010
1013
|
"output_resolution": {
|
|
1011
1014
|
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1012
1015
|
}
|
|
@@ -1020,6 +1023,9 @@ CONTRACT = {
|
|
|
1020
1023
|
"aspect_ratio": {
|
|
1021
1024
|
"enum": ["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"]
|
|
1022
1025
|
},
|
|
1026
|
+
"enable_audio": {
|
|
1027
|
+
"enum": [True, False]
|
|
1028
|
+
},
|
|
1023
1029
|
"output_resolution": {
|
|
1024
1030
|
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1025
1031
|
}
|
|
@@ -1359,6 +1365,16 @@ CONTRACT = {
|
|
|
1359
1365
|
}
|
|
1360
1366
|
}
|
|
1361
1367
|
},
|
|
1368
|
+
"suno/add-samples": {
|
|
1369
|
+
"models": ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
|
|
1370
|
+
"fields_by_model": {
|
|
1371
|
+
"suno-v4": {},
|
|
1372
|
+
"suno-v4.5": {},
|
|
1373
|
+
"suno-v4.5-plus": {},
|
|
1374
|
+
"suno-v5": {},
|
|
1375
|
+
"suno-v5.5": {}
|
|
1376
|
+
}
|
|
1377
|
+
},
|
|
1362
1378
|
"suno/add-vocals": {
|
|
1363
1379
|
"models": ["suno-v4.5-plus", "suno-v5"],
|
|
1364
1380
|
"fields_by_model": {
|
|
@@ -1657,6 +1673,16 @@ CONTRACT = {
|
|
|
1657
1673
|
"_": {}
|
|
1658
1674
|
}
|
|
1659
1675
|
},
|
|
1676
|
+
"suno/remaster-audio": {
|
|
1677
|
+
"models": ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
|
|
1678
|
+
"fields_by_model": {
|
|
1679
|
+
"suno-v4": {},
|
|
1680
|
+
"suno-v4.5": {},
|
|
1681
|
+
"suno-v4.5-plus": {},
|
|
1682
|
+
"suno-v5": {},
|
|
1683
|
+
"suno-v5.5": {}
|
|
1684
|
+
}
|
|
1685
|
+
},
|
|
1660
1686
|
"suno/replace-section": {
|
|
1661
1687
|
"models": [],
|
|
1662
1688
|
"fields_by_model": {
|
|
@@ -1680,6 +1706,16 @@ CONTRACT = {
|
|
|
1680
1706
|
}
|
|
1681
1707
|
}
|
|
1682
1708
|
},
|
|
1709
|
+
"suno/stitch-audio": {
|
|
1710
|
+
"models": ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
|
|
1711
|
+
"fields_by_model": {
|
|
1712
|
+
"suno-v4": {},
|
|
1713
|
+
"suno-v4.5": {},
|
|
1714
|
+
"suno-v4.5-plus": {},
|
|
1715
|
+
"suno-v5": {},
|
|
1716
|
+
"suno-v5.5": {}
|
|
1717
|
+
}
|
|
1718
|
+
},
|
|
1683
1719
|
"suno/text-to-music": {
|
|
1684
1720
|
"models": ["suno-v4", "suno-v4.5", "suno-v4.5-all", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
|
|
1685
1721
|
"fields_by_model": {
|
|
@@ -162,8 +162,10 @@ class Resource:
|
|
|
162
162
|
def _enum_allowed(enum: Sequence[Any], value: Any) -> bool:
|
|
163
163
|
value_is_num = isinstance(value, (int, float)) and not isinstance(value, bool)
|
|
164
164
|
for allowed in enum:
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
if isinstance(allowed, bool):
|
|
166
|
+
if isinstance(value, bool) and value is allowed:
|
|
167
|
+
return True
|
|
168
|
+
elif isinstance(allowed, (int, float)):
|
|
167
169
|
if value_is_num and value == allowed:
|
|
168
170
|
return True
|
|
169
171
|
elif value_is_num:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.6"
|
|
@@ -135,6 +135,16 @@ def test_validate_integer_rejects_bool_and_whole_float():
|
|
|
135
135
|
assert _run_validate({"model": "m", "tolerance": 5}) == ""
|
|
136
136
|
|
|
137
137
|
|
|
138
|
+
def test_validate_boolean_enum_requires_boolean_value():
|
|
139
|
+
schema = {"models": ["m"], "fields_by_model": {"m": {"flag": {"enum": [True, False]}}}}
|
|
140
|
+
resource = SampleResource(FakeHttp())
|
|
141
|
+
|
|
142
|
+
resource._validate_contract(schema, {"model": "m", "flag": True})
|
|
143
|
+
resource._validate_contract(schema, {"model": "m", "flag": False})
|
|
144
|
+
with pytest.raises(ValidationError, match="^flag must be one of: True, False$"):
|
|
145
|
+
resource._validate_contract(schema, {"model": "m", "flag": "true"})
|
|
146
|
+
|
|
147
|
+
|
|
138
148
|
def test_validate_array_item_count_constraints():
|
|
139
149
|
schema = {
|
|
140
150
|
"models": ["m"],
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.5"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|