runapi-core 0.4.0__tar.gz → 0.5.1__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.
Files changed (33) hide show
  1. {runapi_core-0.4.0 → runapi_core-0.5.1}/PKG-INFO +3 -3
  2. {runapi_core-0.4.0 → runapi_core-0.5.1}/pyproject.toml +1 -1
  3. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/contract_gen.py +40 -3
  4. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/errors.py +0 -5
  5. runapi_core-0.5.1/src/runapi/core/version.py +1 -0
  6. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_errors.py +6 -7
  7. runapi_core-0.4.0/src/runapi/core/version.py +0 -1
  8. {runapi_core-0.4.0 → runapi_core-0.5.1}/README.md +0 -0
  9. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/__init__.py +0 -0
  10. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/account.py +0 -0
  11. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/auth.py +0 -0
  12. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/config.py +0 -0
  13. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/constants.py +0 -0
  14. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/files.py +0 -0
  15. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/http_client.py +0 -0
  16. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/models.py +0 -0
  17. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/multipart.py +0 -0
  18. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/options.py +0 -0
  19. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/polling.py +0 -0
  20. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/pricing.py +0 -0
  21. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/provider_client.py +0 -0
  22. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/py.typed +0 -0
  23. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/resource.py +0 -0
  24. {runapi_core-0.4.0 → runapi_core-0.5.1}/src/runapi/core/response.py +0 -0
  25. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_account.py +0 -0
  26. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_auth.py +0 -0
  27. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_config.py +0 -0
  28. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_files.py +0 -0
  29. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_http_client.py +0 -0
  30. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_models.py +0 -0
  31. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_polling.py +0 -0
  32. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_pricing.py +0 -0
  33. {runapi_core-0.4.0 → runapi_core-0.5.1}/tests/test_resource.py +0 -0
@@ -1,13 +1,13 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: runapi-core
3
- Version: 0.4.0
3
+ Version: 0.5.1
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.4.0
10
+ Project-URL: Release Notes, https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.5.1
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.4.0"
22
+ "Release Notes" = "https://github.com/runapi-ai/core-sdk/releases/tag/python%2Fv0.5.1"
23
23
 
24
24
  [tool.hatch.version]
25
25
  path = "src/runapi/core/version.py"
@@ -1342,7 +1342,7 @@ CONTRACT = {
1342
1342
  }
1343
1343
  },
1344
1344
  "seedance/text-to-video": {
1345
- "models": ["seedance-1.5-pro", "seedance-2-mini", "seedance-2.0", "seedance-2.0-fast", "seedance-v1-pro", "seedance-v1-pro-fast"],
1345
+ "models": ["seedance-1.5-pro", "seedance-2-mini", "seedance-2.0", "seedance-2.0-fast", "seedance-2.5", "seedance-v1-pro", "seedance-v1-pro-fast"],
1346
1346
  "fields_by_model": {
1347
1347
  "seedance-1.5-pro": {
1348
1348
  "aspect_ratio": {
@@ -1376,6 +1376,20 @@ CONTRACT = {
1376
1376
  "enum": ["480p", "720p"]
1377
1377
  }
1378
1378
  },
1379
+ "seedance-2.5": {
1380
+ "aspect_ratio": {
1381
+ "enum": ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "auto"]
1382
+ },
1383
+ "duration_seconds": {
1384
+ "enum": [-1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
1385
+ },
1386
+ "output_format": {
1387
+ "enum": ["mp4", "mov"]
1388
+ },
1389
+ "output_resolution": {
1390
+ "enum": ["480p", "720p"]
1391
+ }
1392
+ },
1379
1393
  "seedance-v1-pro": {
1380
1394
  "aspect_ratio": {
1381
1395
  "enum": ["1:1", "4:3", "3:4", "16:9", "9:16", "21:9"]
@@ -1397,6 +1411,19 @@ CONTRACT = {
1397
1411
  }
1398
1412
  }
1399
1413
  },
1414
+ "seedream/decompose-layers": {
1415
+ "models": ["seedream-5-pro-layer-decomposition"],
1416
+ "fields_by_model": {
1417
+ "seedream-5-pro-layer-decomposition": {
1418
+ "output_format": {
1419
+ "enum": ["png", "jpeg"]
1420
+ },
1421
+ "size": {
1422
+ "enum": ["auto", "1K", "1.5K", "2K"]
1423
+ }
1424
+ }
1425
+ }
1426
+ },
1400
1427
  "seedream/edit-image": {
1401
1428
  "models": ["seedream-4.5-edit", "seedream-5-lite-edit", "seedream-5-pro-edit", "seedream-v4-edit"],
1402
1429
  "fields_by_model": {
@@ -1416,7 +1443,7 @@ CONTRACT = {
1416
1443
  "enum": ["png", "jpeg"]
1417
1444
  },
1418
1445
  "output_quality": {
1419
- "enum": ["basic", "high"]
1446
+ "enum": ["basic", "high", "ultra"]
1420
1447
  }
1421
1448
  },
1422
1449
  "seedream-5-pro-edit": {
@@ -1462,7 +1489,7 @@ CONTRACT = {
1462
1489
  "enum": ["png", "jpeg"]
1463
1490
  },
1464
1491
  "output_quality": {
1465
- "enum": ["basic", "high"]
1492
+ "enum": ["basic", "high", "ultra"]
1466
1493
  }
1467
1494
  },
1468
1495
  "seedream-5-pro-text-to-image": {
@@ -1811,6 +1838,16 @@ CONTRACT = {
1811
1838
  "_": {}
1812
1839
  }
1813
1840
  },
1841
+ "suno/inspire-music": {
1842
+ "models": ["suno-v4", "suno-v4.5", "suno-v4.5-plus", "suno-v5", "suno-v5.5"],
1843
+ "fields_by_model": {
1844
+ "suno-v4": {},
1845
+ "suno-v4.5": {},
1846
+ "suno-v4.5-plus": {},
1847
+ "suno-v5": {},
1848
+ "suno-v5.5": {}
1849
+ }
1850
+ },
1814
1851
  "suno/regenerate-validation-phrase": {
1815
1852
  "models": [],
1816
1853
  "fields_by_model": {
@@ -270,11 +270,6 @@ def _extract_message(body: Any) -> Optional[str]:
270
270
  if message:
271
271
  return message
272
272
 
273
- errors = body.get("errors")
274
- if isinstance(errors, list) and errors:
275
- first = errors[0]
276
- return first.get("message") if isinstance(first, dict) else first
277
-
278
273
  return body.get("message") or body.get("detail") or body.get("errorMessage") or body.get("msg")
279
274
 
280
275
 
@@ -0,0 +1 @@
1
+ __version__ = "0.5.1"
@@ -100,9 +100,9 @@ def test_continuation_errors_preserve_codes_and_status_classification():
100
100
  assert error.code == code
101
101
 
102
102
 
103
- def test_extracts_message_from_errors_array():
103
+ def test_does_not_extract_message_from_legacy_errors_array():
104
104
  error = errors.error_from_response(response(400, body='{"errors":["First error"]}'))
105
- assert error.message == "First error"
105
+ assert error.message == "Bad request"
106
106
 
107
107
 
108
108
  def test_handles_html_error_page():
@@ -144,10 +144,9 @@ def test_service_unavailable_defaults_to_503():
144
144
  assert errors.ServiceUnavailableError().status == 503
145
145
 
146
146
 
147
- def test_extracts_message_from_errors_array_of_dicts():
148
- # Regression: an errors-array whose elements are dicts must yield the dict's
149
- # message string, not the raw dict.
147
+ def test_resource_validation_uses_summary_and_preserves_field_errors():
150
148
  error = errors.error_from_response(
151
- response(400, body='{"errors":[{"field":"prompt","message":"too long"}]}')
149
+ response(422, body='{"error":"Validation failed","errors":{"prompt":["too long"]}}')
152
150
  )
153
- assert error.message == "too long"
151
+ assert error.message == "Validation failed"
152
+ assert error.details["errors"] == {"prompt": ["too long"]}
@@ -1 +0,0 @@
1
- __version__ = "0.4.0"
File without changes