runwayml 2.0.0__tar.gz → 2.1.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 (71) hide show
  1. runwayml-2.1.1/.release-please-manifest.json +3 -0
  2. {runwayml-2.0.0 → runwayml-2.1.1}/CHANGELOG.md +32 -0
  3. {runwayml-2.0.0 → runwayml-2.1.1}/PKG-INFO +11 -14
  4. {runwayml-2.0.0 → runwayml-2.1.1}/README.md +8 -8
  5. {runwayml-2.0.0 → runwayml-2.1.1}/mypy.ini +4 -1
  6. {runwayml-2.0.0 → runwayml-2.1.1}/pyproject.toml +6 -11
  7. {runwayml-2.0.0 → runwayml-2.1.1}/requirements-dev.lock +12 -14
  8. {runwayml-2.0.0 → runwayml-2.1.1}/requirements.lock +4 -4
  9. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_base_client.py +17 -6
  10. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_client.py +4 -4
  11. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_compat.py +8 -8
  12. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_models.py +11 -8
  13. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_response.py +3 -0
  14. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_types.py +4 -2
  15. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/__init__.py +1 -0
  16. runwayml-2.1.1/src/runwayml/_utils/_sync.py +71 -0
  17. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_transform.py +12 -2
  18. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_utils.py +17 -0
  19. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_version.py +1 -1
  20. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/resources/image_to_video.py +13 -10
  21. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/types/image_to_video_create_params.py +23 -8
  22. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/types/image_to_video_create_response.py +4 -2
  23. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/types/task_retrieve_response.py +1 -0
  24. {runwayml-2.0.0 → runwayml-2.1.1}/tests/api_resources/test_image_to_video.py +2 -2
  25. {runwayml-2.0.0 → runwayml-2.1.1}/tests/conftest.py +8 -6
  26. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_client.py +59 -2
  27. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_models.py +16 -15
  28. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_response.py +50 -0
  29. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_transform.py +15 -0
  30. runwayml-2.0.0/.release-please-manifest.json +0 -3
  31. runwayml-2.0.0/src/runwayml/_utils/_sync.py +0 -81
  32. {runwayml-2.0.0 → runwayml-2.1.1}/.gitignore +0 -0
  33. {runwayml-2.0.0 → runwayml-2.1.1}/CONTRIBUTING.md +0 -0
  34. {runwayml-2.0.0 → runwayml-2.1.1}/LICENSE +0 -0
  35. {runwayml-2.0.0 → runwayml-2.1.1}/SECURITY.md +0 -0
  36. {runwayml-2.0.0 → runwayml-2.1.1}/api.md +0 -0
  37. {runwayml-2.0.0 → runwayml-2.1.1}/bin/check-release-environment +0 -0
  38. {runwayml-2.0.0 → runwayml-2.1.1}/bin/publish-pypi +0 -0
  39. {runwayml-2.0.0 → runwayml-2.1.1}/examples/.keep +0 -0
  40. {runwayml-2.0.0 → runwayml-2.1.1}/noxfile.py +0 -0
  41. {runwayml-2.0.0 → runwayml-2.1.1}/release-please-config.json +0 -0
  42. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/__init__.py +0 -0
  43. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_constants.py +0 -0
  44. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_exceptions.py +0 -0
  45. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_files.py +0 -0
  46. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_qs.py +0 -0
  47. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_resource.py +0 -0
  48. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_streaming.py +0 -0
  49. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_logs.py +0 -0
  50. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_proxy.py +0 -0
  51. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_reflection.py +0 -0
  52. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_streams.py +0 -0
  53. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/_utils/_typing.py +0 -0
  54. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/lib/.keep +0 -0
  55. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/py.typed +0 -0
  56. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/resources/__init__.py +0 -0
  57. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/resources/tasks.py +0 -0
  58. {runwayml-2.0.0 → runwayml-2.1.1}/src/runwayml/types/__init__.py +0 -0
  59. {runwayml-2.0.0 → runwayml-2.1.1}/tests/__init__.py +0 -0
  60. {runwayml-2.0.0 → runwayml-2.1.1}/tests/api_resources/__init__.py +0 -0
  61. {runwayml-2.0.0 → runwayml-2.1.1}/tests/api_resources/test_tasks.py +0 -0
  62. {runwayml-2.0.0 → runwayml-2.1.1}/tests/sample_file.txt +0 -0
  63. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_deepcopy.py +0 -0
  64. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_extract_files.py +0 -0
  65. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_files.py +0 -0
  66. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_qs.py +0 -0
  67. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_required_args.py +0 -0
  68. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_streaming.py +0 -0
  69. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_utils/test_proxy.py +0 -0
  70. {runwayml-2.0.0 → runwayml-2.1.1}/tests/test_utils/test_typing.py +0 -0
  71. {runwayml-2.0.0 → runwayml-2.1.1}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.1.1"
3
+ }
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.1 (2024-11-28)
4
+
5
+ Full Changelog: [v2.1.0...v2.1.1](https://github.com/runwayml/sdk-python/compare/v2.1.0...v2.1.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **client:** compat with new httpx 0.28.0 release ([#28](https://github.com/runwayml/sdk-python/issues/28)) ([f5e637e](https://github.com/runwayml/sdk-python/commit/f5e637eb373bc6fa85ca6d123bbdaaa1161bc814))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** exclude mypy from running on tests ([#27](https://github.com/runwayml/sdk-python/issues/27)) ([d724387](https://github.com/runwayml/sdk-python/commit/d724387c6546ba476e2773f2249475285dca32c9))
15
+ * **internal:** fix compat model_dump method when warnings are passed ([#24](https://github.com/runwayml/sdk-python/issues/24)) ([61c8490](https://github.com/runwayml/sdk-python/commit/61c849057b971f8b19846ed08b5145c4321adf04))
16
+ * rebuild project due to codegen change ([#19](https://github.com/runwayml/sdk-python/issues/19)) ([2a4cf56](https://github.com/runwayml/sdk-python/commit/2a4cf56335868d88e07aac767260c0c7509b1c94))
17
+ * rebuild project due to codegen change ([#21](https://github.com/runwayml/sdk-python/issues/21)) ([e680d5b](https://github.com/runwayml/sdk-python/commit/e680d5b5bf3ee7fcdede74c7d5c5a971ea18675e))
18
+ * rebuild project due to codegen change ([#22](https://github.com/runwayml/sdk-python/issues/22)) ([ecddf51](https://github.com/runwayml/sdk-python/commit/ecddf51a41704e42f2612541d3841990f22f7220))
19
+ * remove now unused `cached-property` dep ([#26](https://github.com/runwayml/sdk-python/issues/26)) ([21e64d0](https://github.com/runwayml/sdk-python/commit/21e64d0603003c58918dde0b5b6e94b7df28707c))
20
+
21
+
22
+ ### Documentation
23
+
24
+ * add info log level to readme ([#25](https://github.com/runwayml/sdk-python/issues/25)) ([d6e4ed4](https://github.com/runwayml/sdk-python/commit/d6e4ed45841a88e13c30dd318706a18bf86a8550))
25
+
26
+ ## 2.1.0 (2024-11-06)
27
+
28
+ Full Changelog: [v2.0.0...v2.1.0](https://github.com/runwayml/sdk-python/compare/v2.0.0...v2.1.0)
29
+
30
+ ### Features
31
+
32
+ * **api:** API version 2024-11-06 ([#15](https://github.com/runwayml/sdk-python/issues/15)) ([39c096f](https://github.com/runwayml/sdk-python/commit/39c096fdc4784cc726e8688dcc3263e6cb322607))
33
+ * **api:** Set latest default API version ([#17](https://github.com/runwayml/sdk-python/issues/17)) ([2ad66fd](https://github.com/runwayml/sdk-python/commit/2ad66fd753321eaae28fa09755bfdb6bbfc07949))
34
+
3
35
  ## 2.0.0 (2024-10-04)
4
36
 
5
37
  Full Changelog: [v1.0.0...v2.0.0](https://github.com/runwayml/sdk-python/compare/v1.0.0...v2.0.0)
@@ -1,12 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 2.0.0
3
+ Version: 2.1.1
4
4
  Summary: The official Python library for the runwayml API
5
5
  Project-URL: Homepage, https://github.com/runwayml/sdk-python
6
6
  Project-URL: Repository, https://github.com/runwayml/sdk-python
7
7
  Author-email: RunwayML <dev-feedback@runwayml.com>
8
- License-Expression: Apache-2.0
9
- License-File: LICENSE
8
+ License: Apache-2.0
10
9
  Classifier: Intended Audience :: Developers
11
10
  Classifier: License :: OSI Approved :: Apache Software License
12
11
  Classifier: Operating System :: MacOS
@@ -14,7 +13,6 @@ Classifier: Operating System :: Microsoft :: Windows
14
13
  Classifier: Operating System :: OS Independent
15
14
  Classifier: Operating System :: POSIX
16
15
  Classifier: Operating System :: POSIX :: Linux
17
- Classifier: Programming Language :: Python :: 3.7
18
16
  Classifier: Programming Language :: Python :: 3.8
19
17
  Classifier: Programming Language :: Python :: 3.9
20
18
  Classifier: Programming Language :: Python :: 3.10
@@ -22,9 +20,8 @@ Classifier: Programming Language :: Python :: 3.11
22
20
  Classifier: Programming Language :: Python :: 3.12
23
21
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
22
  Classifier: Typing :: Typed
25
- Requires-Python: >=3.7
23
+ Requires-Python: >=3.8
26
24
  Requires-Dist: anyio<5,>=3.5.0
27
- Requires-Dist: cached-property; python_version < '3.8'
28
25
  Requires-Dist: distro<2,>=1.7.0
29
26
  Requires-Dist: httpx<1,>=0.23.0
30
27
  Requires-Dist: pydantic<3,>=1.9.0
@@ -36,7 +33,7 @@ Description-Content-Type: text/markdown
36
33
 
37
34
  [![PyPI version](https://img.shields.io/pypi/v/runwayml.svg)](https://pypi.org/project/runwayml/)
38
35
 
39
- The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.7+
36
+ The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.8+
40
37
  application. The library includes type definitions for all request params and response fields,
41
38
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
42
39
 
@@ -62,8 +59,7 @@ import os
62
59
  from runwayml import RunwayML
63
60
 
64
61
  client = RunwayML(
65
- # This is the default and can be omitted
66
- api_key=os.environ.get("RUNWAYML_API_SECRET"),
62
+ api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
67
63
  )
68
64
 
69
65
  image_to_video = client.image_to_video.create(
@@ -89,8 +85,7 @@ import asyncio
89
85
  from runwayml import AsyncRunwayML
90
86
 
91
87
  client = AsyncRunwayML(
92
- # This is the default and can be omitted
93
- api_key=os.environ.get("RUNWAYML_API_SECRET"),
88
+ api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
94
89
  )
95
90
 
96
91
 
@@ -224,12 +219,14 @@ Note that requests that time out are [retried twice by default](https://github.c
224
219
 
225
220
  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
226
221
 
227
- You can enable logging by setting the environment variable `RUNWAYML_LOG` to `debug`.
222
+ You can enable logging by setting the environment variable `RUNWAYML_LOG` to `info`.
228
223
 
229
224
  ```shell
230
- $ export RUNWAYML_LOG=debug
225
+ $ export RUNWAYML_LOG=info
231
226
  ```
232
227
 
228
+ Or to `debug` for more verbose logging.
229
+
233
230
  ### How to tell whether `None` means `null` or missing
234
231
 
235
232
  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
@@ -376,7 +373,7 @@ print(runwayml.__version__)
376
373
 
377
374
  ## Requirements
378
375
 
379
- Python 3.7 or higher.
376
+ Python 3.8 or higher.
380
377
 
381
378
  ## Contributing
382
379
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![PyPI version](https://img.shields.io/pypi/v/runwayml.svg)](https://pypi.org/project/runwayml/)
4
4
 
5
- The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.7+
5
+ The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.8+
6
6
  application. The library includes type definitions for all request params and response fields,
7
7
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
8
8
 
@@ -28,8 +28,7 @@ import os
28
28
  from runwayml import RunwayML
29
29
 
30
30
  client = RunwayML(
31
- # This is the default and can be omitted
32
- api_key=os.environ.get("RUNWAYML_API_SECRET"),
31
+ api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
33
32
  )
34
33
 
35
34
  image_to_video = client.image_to_video.create(
@@ -55,8 +54,7 @@ import asyncio
55
54
  from runwayml import AsyncRunwayML
56
55
 
57
56
  client = AsyncRunwayML(
58
- # This is the default and can be omitted
59
- api_key=os.environ.get("RUNWAYML_API_SECRET"),
57
+ api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
60
58
  )
61
59
 
62
60
 
@@ -190,12 +188,14 @@ Note that requests that time out are [retried twice by default](#retries).
190
188
 
191
189
  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
192
190
 
193
- You can enable logging by setting the environment variable `RUNWAYML_LOG` to `debug`.
191
+ You can enable logging by setting the environment variable `RUNWAYML_LOG` to `info`.
194
192
 
195
193
  ```shell
196
- $ export RUNWAYML_LOG=debug
194
+ $ export RUNWAYML_LOG=info
197
195
  ```
198
196
 
197
+ Or to `debug` for more verbose logging.
198
+
199
199
  ### How to tell whether `None` means `null` or missing
200
200
 
201
201
  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
@@ -342,7 +342,7 @@ print(runwayml.__version__)
342
342
 
343
343
  ## Requirements
344
344
 
345
- Python 3.7 or higher.
345
+ Python 3.8 or higher.
346
346
 
347
347
  ## Contributing
348
348
 
@@ -5,7 +5,10 @@ show_error_codes = True
5
5
  # Exclude _files.py because mypy isn't smart enough to apply
6
6
  # the correct type narrowing and as this is an internal module
7
7
  # it's fine to just use Pyright.
8
- exclude = ^(src/runwayml/_files\.py|_dev/.*\.py)$
8
+ #
9
+ # We also exclude our `tests` as mypy doesn't always infer
10
+ # types correctly and Pyright will still catch any type errors.
11
+ exclude = ^(src/runwayml/_files\.py|_dev/.*\.py|tests/.*)$
9
12
 
10
13
  strict_equality = True
11
14
  implicit_reexport = True
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runwayml"
3
- version = "2.0.0"
3
+ version = "2.1.1"
4
4
  description = "The official Python library for the runwayml API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -14,13 +14,11 @@ dependencies = [
14
14
  "anyio>=3.5.0, <5",
15
15
  "distro>=1.7.0, <2",
16
16
  "sniffio",
17
- "cached-property; python_version < '3.8'",
18
17
  ]
19
- requires-python = ">= 3.7"
18
+ requires-python = ">= 3.8"
20
19
  classifiers = [
21
20
  "Typing :: Typed",
22
21
  "Intended Audience :: Developers",
23
- "Programming Language :: Python :: 3.7",
24
22
  "Programming Language :: Python :: 3.8",
25
23
  "Programming Language :: Python :: 3.9",
26
24
  "Programming Language :: Python :: 3.10",
@@ -56,6 +54,7 @@ dev-dependencies = [
56
54
  "dirty-equals>=0.6.0",
57
55
  "importlib-metadata>=6.7.0",
58
56
  "rich>=13.7.1",
57
+ "nest_asyncio==1.6.0"
59
58
  ]
60
59
 
61
60
  [tool.rye.scripts]
@@ -63,11 +62,11 @@ format = { chain = [
63
62
  "format:ruff",
64
63
  "format:docs",
65
64
  "fix:ruff",
65
+ # run formatting again to fix any inconsistencies when imports are stripped
66
+ "format:ruff",
66
67
  ]}
67
- "format:black" = "black ."
68
68
  "format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
69
69
  "format:ruff" = "ruff format"
70
- "format:isort" = "isort ."
71
70
 
72
71
  "lint" = { chain = [
73
72
  "check:ruff",
@@ -125,10 +124,6 @@ path = "README.md"
125
124
  pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
126
125
  replacement = '[\1](https://github.com/runwayml/sdk-python/tree/main/\g<2>)'
127
126
 
128
- [tool.black]
129
- line-length = 120
130
- target-version = ["py37"]
131
-
132
127
  [tool.pytest.ini_options]
133
128
  testpaths = ["tests"]
134
129
  addopts = "--tb=short"
@@ -143,7 +138,7 @@ filterwarnings = [
143
138
  # there are a couple of flags that are still disabled by
144
139
  # default in strict mode as they are experimental and niche.
145
140
  typeCheckingMode = "strict"
146
- pythonVersion = "3.7"
141
+ pythonVersion = "3.8"
147
142
 
148
143
  exclude = [
149
144
  "_dev",
@@ -16,8 +16,6 @@ anyio==4.4.0
16
16
  # via runwayml
17
17
  argcomplete==3.1.2
18
18
  # via nox
19
- attrs==23.1.0
20
- # via pytest
21
19
  certifi==2023.7.22
22
20
  # via httpcore
23
21
  # via httpx
@@ -28,8 +26,9 @@ distlib==0.3.7
28
26
  # via virtualenv
29
27
  distro==1.8.0
30
28
  # via runwayml
31
- exceptiongroup==1.1.3
29
+ exceptiongroup==1.2.2
32
30
  # via anyio
31
+ # via pytest
33
32
  filelock==3.12.4
34
33
  # via virtualenv
35
34
  h11==0.14.0
@@ -49,9 +48,10 @@ markdown-it-py==3.0.0
49
48
  # via rich
50
49
  mdurl==0.1.2
51
50
  # via markdown-it-py
52
- mypy==1.11.2
51
+ mypy==1.13.0
53
52
  mypy-extensions==1.0.0
54
53
  # via mypy
54
+ nest-asyncio==1.6.0
55
55
  nodeenv==1.8.0
56
56
  # via pyright
57
57
  nox==2023.4.22
@@ -60,27 +60,25 @@ packaging==23.2
60
60
  # via pytest
61
61
  platformdirs==3.11.0
62
62
  # via virtualenv
63
- pluggy==1.3.0
64
- # via pytest
65
- py==1.11.0
63
+ pluggy==1.5.0
66
64
  # via pytest
67
- pydantic==2.7.1
65
+ pydantic==2.9.2
68
66
  # via runwayml
69
- pydantic-core==2.18.2
67
+ pydantic-core==2.23.4
70
68
  # via pydantic
71
69
  pygments==2.18.0
72
70
  # via rich
73
71
  pyright==1.1.380
74
- pytest==7.1.1
72
+ pytest==8.3.3
75
73
  # via pytest-asyncio
76
- pytest-asyncio==0.21.1
74
+ pytest-asyncio==0.24.0
77
75
  python-dateutil==2.8.2
78
76
  # via time-machine
79
77
  pytz==2023.3.post1
80
78
  # via dirty-equals
81
79
  respx==0.20.2
82
80
  rich==13.7.1
83
- ruff==0.6.5
81
+ ruff==0.6.9
84
82
  setuptools==68.2.2
85
83
  # via nodeenv
86
84
  six==1.16.0
@@ -90,10 +88,10 @@ sniffio==1.3.0
90
88
  # via httpx
91
89
  # via runwayml
92
90
  time-machine==2.9.0
93
- tomli==2.0.1
91
+ tomli==2.0.2
94
92
  # via mypy
95
93
  # via pytest
96
- typing-extensions==4.8.0
94
+ typing-extensions==4.12.2
97
95
  # via anyio
98
96
  # via mypy
99
97
  # via pydantic
@@ -19,7 +19,7 @@ certifi==2023.7.22
19
19
  # via httpx
20
20
  distro==1.8.0
21
21
  # via runwayml
22
- exceptiongroup==1.1.3
22
+ exceptiongroup==1.2.2
23
23
  # via anyio
24
24
  h11==0.14.0
25
25
  # via httpcore
@@ -30,15 +30,15 @@ httpx==0.25.2
30
30
  idna==3.4
31
31
  # via anyio
32
32
  # via httpx
33
- pydantic==2.7.1
33
+ pydantic==2.9.2
34
34
  # via runwayml
35
- pydantic-core==2.18.2
35
+ pydantic-core==2.23.4
36
36
  # via pydantic
37
37
  sniffio==1.3.0
38
38
  # via anyio
39
39
  # via httpx
40
40
  # via runwayml
41
- typing-extensions==4.8.0
41
+ typing-extensions==4.12.2
42
42
  # via anyio
43
43
  # via pydantic
44
44
  # via pydantic-core
@@ -143,6 +143,12 @@ class PageInfo:
143
143
  self.url = url
144
144
  self.params = params
145
145
 
146
+ @override
147
+ def __repr__(self) -> str:
148
+ if self.url:
149
+ return f"{self.__class__.__name__}(url={self.url})"
150
+ return f"{self.__class__.__name__}(params={self.params})"
151
+
146
152
 
147
153
  class BasePage(GenericModel, Generic[_T]):
148
154
  """
@@ -689,7 +695,8 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
689
695
  if retry_after is not None and 0 < retry_after <= 60:
690
696
  return retry_after
691
697
 
692
- nb_retries = max_retries - remaining_retries
698
+ # Also cap retry count to 1000 to avoid any potential overflows with `pow`
699
+ nb_retries = min(max_retries - remaining_retries, 1000)
693
700
 
694
701
  # Apply exponential backoff, but not more than the max.
695
702
  sleep_seconds = min(INITIAL_RETRY_DELAY * pow(2.0, nb_retries), MAX_RETRY_DELAY)
@@ -785,6 +792,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
785
792
  custom_query: Mapping[str, object] | None = None,
786
793
  _strict_response_validation: bool,
787
794
  ) -> None:
795
+ kwargs: dict[str, Any] = {}
788
796
  if limits is not None:
789
797
  warnings.warn(
790
798
  "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -797,6 +805,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
797
805
  limits = DEFAULT_CONNECTION_LIMITS
798
806
 
799
807
  if transport is not None:
808
+ kwargs["transport"] = transport
800
809
  warnings.warn(
801
810
  "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
802
811
  category=DeprecationWarning,
@@ -806,6 +815,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
806
815
  raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
807
816
 
808
817
  if proxies is not None:
818
+ kwargs["proxies"] = proxies
809
819
  warnings.warn(
810
820
  "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
811
821
  category=DeprecationWarning,
@@ -849,10 +859,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
849
859
  base_url=base_url,
850
860
  # cast to a valid type because mypy doesn't understand our type narrowing
851
861
  timeout=cast(Timeout, timeout),
852
- proxies=proxies,
853
- transport=transport,
854
862
  limits=limits,
855
863
  follow_redirects=True,
864
+ **kwargs, # type: ignore
856
865
  )
857
866
 
858
867
  def is_closed(self) -> bool:
@@ -1351,6 +1360,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1351
1360
  custom_headers: Mapping[str, str] | None = None,
1352
1361
  custom_query: Mapping[str, object] | None = None,
1353
1362
  ) -> None:
1363
+ kwargs: dict[str, Any] = {}
1354
1364
  if limits is not None:
1355
1365
  warnings.warn(
1356
1366
  "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1363,6 +1373,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1363
1373
  limits = DEFAULT_CONNECTION_LIMITS
1364
1374
 
1365
1375
  if transport is not None:
1376
+ kwargs["transport"] = transport
1366
1377
  warnings.warn(
1367
1378
  "The `transport` argument is deprecated. The `http_client` argument should be passed instead",
1368
1379
  category=DeprecationWarning,
@@ -1372,6 +1383,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1372
1383
  raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
1373
1384
 
1374
1385
  if proxies is not None:
1386
+ kwargs["proxies"] = proxies
1375
1387
  warnings.warn(
1376
1388
  "The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
1377
1389
  category=DeprecationWarning,
@@ -1415,10 +1427,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1415
1427
  base_url=base_url,
1416
1428
  # cast to a valid type because mypy doesn't understand our type narrowing
1417
1429
  timeout=cast(Timeout, timeout),
1418
- proxies=proxies,
1419
- transport=transport,
1420
1430
  limits=limits,
1421
1431
  follow_redirects=True,
1432
+ **kwargs, # type: ignore
1422
1433
  )
1423
1434
 
1424
1435
  def is_closed(self) -> bool:
@@ -1568,7 +1579,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1568
1579
  except Exception as err:
1569
1580
  log.debug("Encountered Exception", exc_info=True)
1570
1581
 
1571
- if retries_taken > 0:
1582
+ if remaining_retries > 0:
1572
1583
  return await self._retry_request(
1573
1584
  input_options,
1574
1585
  cast_to,
@@ -59,7 +59,7 @@ class RunwayML(SyncAPIClient):
59
59
  self,
60
60
  *,
61
61
  api_key: str | None = None,
62
- runway_version: str | None = "2024-09-13",
62
+ runway_version: str | None = "2024-11-06",
63
63
  base_url: str | httpx.URL | None = None,
64
64
  timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
65
65
  max_retries: int = DEFAULT_MAX_RETRIES,
@@ -92,7 +92,7 @@ class RunwayML(SyncAPIClient):
92
92
  self.api_key = api_key
93
93
 
94
94
  if runway_version is None:
95
- runway_version = "2024-09-13"
95
+ runway_version = "2024-11-06"
96
96
  self.runway_version = runway_version
97
97
 
98
98
  if base_url is None:
@@ -238,7 +238,7 @@ class AsyncRunwayML(AsyncAPIClient):
238
238
  self,
239
239
  *,
240
240
  api_key: str | None = None,
241
- runway_version: str | None = "2024-09-13",
241
+ runway_version: str | None = "2024-11-06",
242
242
  base_url: str | httpx.URL | None = None,
243
243
  timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
244
244
  max_retries: int = DEFAULT_MAX_RETRIES,
@@ -271,7 +271,7 @@ class AsyncRunwayML(AsyncAPIClient):
271
271
  self.api_key = api_key
272
272
 
273
273
  if runway_version is None:
274
- runway_version = "2024-09-13"
274
+ runway_version = "2024-11-06"
275
275
  self.runway_version = runway_version
276
276
 
277
277
  if base_url is None:
@@ -2,7 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
4
4
  from datetime import date, datetime
5
- from typing_extensions import Self
5
+ from typing_extensions import Self, Literal
6
6
 
7
7
  import pydantic
8
8
  from pydantic.fields import FieldInfo
@@ -133,17 +133,20 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
133
133
  def model_dump(
134
134
  model: pydantic.BaseModel,
135
135
  *,
136
- exclude: IncEx = None,
136
+ exclude: IncEx | None = None,
137
137
  exclude_unset: bool = False,
138
138
  exclude_defaults: bool = False,
139
139
  warnings: bool = True,
140
+ mode: Literal["json", "python"] = "python",
140
141
  ) -> dict[str, Any]:
141
- if PYDANTIC_V2:
142
+ if PYDANTIC_V2 or hasattr(model, "model_dump"):
142
143
  return model.model_dump(
144
+ mode=mode,
143
145
  exclude=exclude,
144
146
  exclude_unset=exclude_unset,
145
147
  exclude_defaults=exclude_defaults,
146
- warnings=warnings,
148
+ # warnings are not supported in Pydantic v1
149
+ warnings=warnings if PYDANTIC_V2 else True,
147
150
  )
148
151
  return cast(
149
152
  "dict[str, Any]",
@@ -211,9 +214,6 @@ if TYPE_CHECKING:
211
214
  # __set__ is not defined at runtime, but @cached_property is designed to be settable
212
215
  def __set__(self, instance: object, value: _T) -> None: ...
213
216
  else:
214
- try:
215
- from functools import cached_property as cached_property
216
- except ImportError:
217
- from cached_property import cached_property as cached_property
217
+ from functools import cached_property as cached_property
218
218
 
219
219
  typed_cached_property = cached_property
@@ -37,6 +37,7 @@ from ._utils import (
37
37
  PropertyInfo,
38
38
  is_list,
39
39
  is_given,
40
+ json_safe,
40
41
  lru_cache,
41
42
  is_mapping,
42
43
  parse_date,
@@ -176,7 +177,7 @@ class BaseModel(pydantic.BaseModel):
176
177
  # Based on https://github.com/samuelcolvin/pydantic/issues/1168#issuecomment-817742836.
177
178
  @classmethod
178
179
  @override
179
- def construct(
180
+ def construct( # pyright: ignore[reportIncompatibleMethodOverride]
180
181
  cls: Type[ModelT],
181
182
  _fields_set: set[str] | None = None,
182
183
  **values: object,
@@ -248,8 +249,8 @@ class BaseModel(pydantic.BaseModel):
248
249
  self,
249
250
  *,
250
251
  mode: Literal["json", "python"] | str = "python",
251
- include: IncEx = None,
252
- exclude: IncEx = None,
252
+ include: IncEx | None = None,
253
+ exclude: IncEx | None = None,
253
254
  by_alias: bool = False,
254
255
  exclude_unset: bool = False,
255
256
  exclude_defaults: bool = False,
@@ -279,8 +280,8 @@ class BaseModel(pydantic.BaseModel):
279
280
  Returns:
280
281
  A dictionary representation of the model.
281
282
  """
282
- if mode != "python":
283
- raise ValueError("mode is only supported in Pydantic v2")
283
+ if mode not in {"json", "python"}:
284
+ raise ValueError("mode must be either 'json' or 'python'")
284
285
  if round_trip != False:
285
286
  raise ValueError("round_trip is only supported in Pydantic v2")
286
287
  if warnings != True:
@@ -289,7 +290,7 @@ class BaseModel(pydantic.BaseModel):
289
290
  raise ValueError("context is only supported in Pydantic v2")
290
291
  if serialize_as_any != False:
291
292
  raise ValueError("serialize_as_any is only supported in Pydantic v2")
292
- return super().dict( # pyright: ignore[reportDeprecated]
293
+ dumped = super().dict( # pyright: ignore[reportDeprecated]
293
294
  include=include,
294
295
  exclude=exclude,
295
296
  by_alias=by_alias,
@@ -298,13 +299,15 @@ class BaseModel(pydantic.BaseModel):
298
299
  exclude_none=exclude_none,
299
300
  )
300
301
 
302
+ return cast(dict[str, Any], json_safe(dumped)) if mode == "json" else dumped
303
+
301
304
  @override
302
305
  def model_dump_json(
303
306
  self,
304
307
  *,
305
308
  indent: int | None = None,
306
- include: IncEx = None,
307
- exclude: IncEx = None,
309
+ include: IncEx | None = None,
310
+ exclude: IncEx | None = None,
308
311
  by_alias: bool = False,
309
312
  exclude_unset: bool = False,
310
313
  exclude_defaults: bool = False,
@@ -192,6 +192,9 @@ class BaseAPIResponse(Generic[R]):
192
192
  if cast_to == float:
193
193
  return cast(R, float(response.text))
194
194
 
195
+ if cast_to == bool:
196
+ return cast(R, response.text.lower() == "true")
197
+
195
198
  origin = get_origin(cast_to) or cast_to
196
199
 
197
200
  if origin == APIResponse:
@@ -16,7 +16,7 @@ from typing import (
16
16
  Optional,
17
17
  Sequence,
18
18
  )
19
- from typing_extensions import Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
19
+ from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
20
20
 
21
21
  import httpx
22
22
  import pydantic
@@ -193,7 +193,9 @@ StrBytesIntFloat = Union[str, bytes, int, float]
193
193
 
194
194
  # Note: copied from Pydantic
195
195
  # https://github.com/pydantic/pydantic/blob/32ea570bf96e84234d2992e1ddf40ab8a565925a/pydantic/main.py#L49
196
- IncEx: TypeAlias = "set[int] | set[str] | dict[int, Any] | dict[str, Any] | None"
196
+ IncEx: TypeAlias = Union[
197
+ Set[int], Set[str], Mapping[int, Union["IncEx", Literal[True]]], Mapping[str, Union["IncEx", Literal[True]]]
198
+ ]
197
199
 
198
200
  PostParser = Callable[[Any], Any]
199
201
 
@@ -6,6 +6,7 @@ from ._utils import (
6
6
  is_list as is_list,
7
7
  is_given as is_given,
8
8
  is_tuple as is_tuple,
9
+ json_safe as json_safe,
9
10
  lru_cache as lru_cache,
10
11
  is_mapping as is_mapping,
11
12
  is_tuple_t as is_tuple_t,