runapi-core 0.3.4__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.4 → runapi_core-0.3.6}/PKG-INFO +2 -2
- {runapi_core-0.3.4 → runapi_core-0.3.6}/pyproject.toml +1 -1
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/contract_gen.py +92 -0
- {runapi_core-0.3.4 → 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.4 → runapi_core-0.3.6}/tests/test_resource.py +10 -0
- runapi_core-0.3.4/src/runapi/core/version.py +0 -1
- {runapi_core-0.3.4 → runapi_core-0.3.6}/README.md +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/__init__.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/account.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/auth.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/config.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/constants.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/errors.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/files.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/http_client.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/models.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/multipart.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/options.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/polling.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/pricing.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/provider_client.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/py.typed +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/src/runapi/core/response.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_account.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_auth.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_config.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_errors.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_files.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_http_client.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_models.py +0 -0
- {runapi_core-0.3.4 → runapi_core-0.3.6}/tests/test_polling.py +0 -0
- {runapi_core-0.3.4 → 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"
|
|
@@ -980,6 +980,68 @@ CONTRACT = {
|
|
|
980
980
|
"tts-1-hd": {}
|
|
981
981
|
}
|
|
982
982
|
},
|
|
983
|
+
"pixverse/edit-video": {
|
|
984
|
+
"models": ["pixverse-v6"],
|
|
985
|
+
"fields_by_model": {
|
|
986
|
+
"pixverse-v6": {
|
|
987
|
+
"aspect_ratio": {
|
|
988
|
+
"enum": ["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"]
|
|
989
|
+
},
|
|
990
|
+
"output_resolution": {
|
|
991
|
+
"enum": ["360p", "540p", "720p", "1080p"]
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
},
|
|
996
|
+
"pixverse/extend-video": {
|
|
997
|
+
"models": ["pixverse-v6"],
|
|
998
|
+
"fields_by_model": {
|
|
999
|
+
"pixverse-v6": {
|
|
1000
|
+
"output_resolution": {
|
|
1001
|
+
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
},
|
|
1006
|
+
"pixverse/image-to-video": {
|
|
1007
|
+
"models": ["pixverse-v6"],
|
|
1008
|
+
"fields_by_model": {
|
|
1009
|
+
"pixverse-v6": {
|
|
1010
|
+
"enable_audio": {
|
|
1011
|
+
"enum": [True, False]
|
|
1012
|
+
},
|
|
1013
|
+
"output_resolution": {
|
|
1014
|
+
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
},
|
|
1019
|
+
"pixverse/text-to-video": {
|
|
1020
|
+
"models": ["pixverse-v6"],
|
|
1021
|
+
"fields_by_model": {
|
|
1022
|
+
"pixverse-v6": {
|
|
1023
|
+
"aspect_ratio": {
|
|
1024
|
+
"enum": ["16:9", "4:3", "1:1", "3:4", "9:16", "2:3", "3:2", "21:9"]
|
|
1025
|
+
},
|
|
1026
|
+
"enable_audio": {
|
|
1027
|
+
"enum": [True, False]
|
|
1028
|
+
},
|
|
1029
|
+
"output_resolution": {
|
|
1030
|
+
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
"pixverse/transition-video": {
|
|
1036
|
+
"models": ["pixverse-v6"],
|
|
1037
|
+
"fields_by_model": {
|
|
1038
|
+
"pixverse-v6": {
|
|
1039
|
+
"output_resolution": {
|
|
1040
|
+
"enum": ["360p", "540p", "720p", "1080p"]
|
|
1041
|
+
}
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
},
|
|
983
1045
|
"producer/text-to-music": {
|
|
984
1046
|
"models": ["fuzz-0.8", "fuzz-1.0", "fuzz-1.0-pro", "fuzz-1.1", "fuzz-1.1-pro", "fuzz-2.0", "fuzz-2.0-pro", "fuzz-2.0-raw"],
|
|
985
1047
|
"fields_by_model": {
|
|
@@ -1303,6 +1365,16 @@ CONTRACT = {
|
|
|
1303
1365
|
}
|
|
1304
1366
|
}
|
|
1305
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
|
+
},
|
|
1306
1378
|
"suno/add-vocals": {
|
|
1307
1379
|
"models": ["suno-v4.5-plus", "suno-v5"],
|
|
1308
1380
|
"fields_by_model": {
|
|
@@ -1601,6 +1673,16 @@ CONTRACT = {
|
|
|
1601
1673
|
"_": {}
|
|
1602
1674
|
}
|
|
1603
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
|
+
},
|
|
1604
1686
|
"suno/replace-section": {
|
|
1605
1687
|
"models": [],
|
|
1606
1688
|
"fields_by_model": {
|
|
@@ -1624,6 +1706,16 @@ CONTRACT = {
|
|
|
1624
1706
|
}
|
|
1625
1707
|
}
|
|
1626
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
|
+
},
|
|
1627
1719
|
"suno/text-to-music": {
|
|
1628
1720
|
"models": ["suno-v4", "suno-v4.5", "suno-v4.5-all", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
|
|
1629
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.4"
|
|
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
|