runwayml 3.2.0__tar.gz → 3.4.0__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 (82) hide show
  1. runwayml-3.4.0/.release-please-manifest.json +3 -0
  2. {runwayml-3.2.0 → runwayml-3.4.0}/CHANGELOG.md +27 -0
  3. {runwayml-3.2.0 → runwayml-3.4.0}/CONTRIBUTING.md +1 -2
  4. {runwayml-3.2.0 → runwayml-3.4.0}/PKG-INFO +2 -3
  5. {runwayml-3.2.0 → runwayml-3.4.0}/README.md +1 -2
  6. {runwayml-3.2.0 → runwayml-3.4.0}/api.md +12 -0
  7. {runwayml-3.2.0 → runwayml-3.4.0}/pyproject.toml +1 -1
  8. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_base_client.py +6 -0
  9. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_client.py +9 -1
  10. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_models.py +2 -0
  11. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_types.py +2 -0
  12. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_version.py +1 -1
  13. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/resources/__init__.py +14 -0
  14. runwayml-3.4.0/src/runwayml/resources/video_upscale.py +195 -0
  15. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/__init__.py +2 -0
  16. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/organization_retrieve_response.py +21 -0
  17. runwayml-3.4.0/src/runwayml/types/video_upscale_create_params.py +22 -0
  18. runwayml-3.4.0/src/runwayml/types/video_upscale_create_response.py +10 -0
  19. runwayml-3.4.0/tests/api_resources/test_video_upscale.py +90 -0
  20. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_client.py +54 -0
  21. runwayml-3.2.0/.release-please-manifest.json +0 -3
  22. {runwayml-3.2.0 → runwayml-3.4.0}/.gitignore +0 -0
  23. {runwayml-3.2.0 → runwayml-3.4.0}/LICENSE +0 -0
  24. {runwayml-3.2.0 → runwayml-3.4.0}/SECURITY.md +0 -0
  25. {runwayml-3.2.0 → runwayml-3.4.0}/bin/check-release-environment +0 -0
  26. {runwayml-3.2.0 → runwayml-3.4.0}/bin/publish-pypi +0 -0
  27. {runwayml-3.2.0 → runwayml-3.4.0}/examples/.keep +0 -0
  28. {runwayml-3.2.0 → runwayml-3.4.0}/mypy.ini +0 -0
  29. {runwayml-3.2.0 → runwayml-3.4.0}/noxfile.py +0 -0
  30. {runwayml-3.2.0 → runwayml-3.4.0}/release-please-config.json +0 -0
  31. {runwayml-3.2.0 → runwayml-3.4.0}/requirements-dev.lock +0 -0
  32. {runwayml-3.2.0 → runwayml-3.4.0}/requirements.lock +0 -0
  33. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/__init__.py +0 -0
  34. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_compat.py +0 -0
  35. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_constants.py +0 -0
  36. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_exceptions.py +0 -0
  37. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_files.py +0 -0
  38. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_qs.py +0 -0
  39. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_resource.py +0 -0
  40. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_response.py +0 -0
  41. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_streaming.py +0 -0
  42. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/__init__.py +0 -0
  43. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_logs.py +0 -0
  44. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_proxy.py +0 -0
  45. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_reflection.py +0 -0
  46. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_resources_proxy.py +0 -0
  47. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_streams.py +0 -0
  48. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_sync.py +0 -0
  49. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_transform.py +0 -0
  50. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_typing.py +0 -0
  51. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/_utils/_utils.py +0 -0
  52. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/lib/.keep +0 -0
  53. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/py.typed +0 -0
  54. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/resources/image_to_video.py +0 -0
  55. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/resources/organization.py +0 -0
  56. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/resources/tasks.py +0 -0
  57. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/resources/text_to_image.py +0 -0
  58. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/image_to_video_create_params.py +0 -0
  59. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/image_to_video_create_response.py +0 -0
  60. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/task_retrieve_response.py +0 -0
  61. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/text_to_image_create_params.py +0 -0
  62. {runwayml-3.2.0 → runwayml-3.4.0}/src/runwayml/types/text_to_image_create_response.py +0 -0
  63. {runwayml-3.2.0 → runwayml-3.4.0}/tests/__init__.py +0 -0
  64. {runwayml-3.2.0 → runwayml-3.4.0}/tests/api_resources/__init__.py +0 -0
  65. {runwayml-3.2.0 → runwayml-3.4.0}/tests/api_resources/test_image_to_video.py +0 -0
  66. {runwayml-3.2.0 → runwayml-3.4.0}/tests/api_resources/test_organization.py +0 -0
  67. {runwayml-3.2.0 → runwayml-3.4.0}/tests/api_resources/test_tasks.py +0 -0
  68. {runwayml-3.2.0 → runwayml-3.4.0}/tests/api_resources/test_text_to_image.py +0 -0
  69. {runwayml-3.2.0 → runwayml-3.4.0}/tests/conftest.py +0 -0
  70. {runwayml-3.2.0 → runwayml-3.4.0}/tests/sample_file.txt +0 -0
  71. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_deepcopy.py +0 -0
  72. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_extract_files.py +0 -0
  73. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_files.py +0 -0
  74. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_models.py +0 -0
  75. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_qs.py +0 -0
  76. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_required_args.py +0 -0
  77. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_response.py +0 -0
  78. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_streaming.py +0 -0
  79. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_transform.py +0 -0
  80. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_utils/test_proxy.py +0 -0
  81. {runwayml-3.2.0 → runwayml-3.4.0}/tests/test_utils/test_typing.py +0 -0
  82. {runwayml-3.2.0 → runwayml-3.4.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.4.0"
3
+ }
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.4.0 (2025-06-04)
4
+
5
+ Full Changelog: [v3.3.0...v3.4.0](https://github.com/runwayml/sdk-python/compare/v3.3.0...v3.4.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Add video upscale endpoint ([aac6a70](https://github.com/runwayml/sdk-python/commit/aac6a707ca2925034fa141ceac8a9515958a77c1))
10
+
11
+ ## 3.3.0 (2025-06-04)
12
+
13
+ Full Changelog: [v3.2.0...v3.3.0](https://github.com/runwayml/sdk-python/compare/v3.2.0...v3.3.0)
14
+
15
+ ### Features
16
+
17
+ * **client:** add follow_redirects request option ([742ca3b](https://github.com/runwayml/sdk-python/commit/742ca3bbd1f38ce28ef26ddee06d4c86cd2a6ff0))
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **docs:** fix confusing example in README ([54904f7](https://github.com/runwayml/sdk-python/commit/54904f7ed5557b5b3972fc25d52ffc873d91be7e))
23
+
24
+
25
+ ### Chores
26
+
27
+ * **docs:** remove reference to rye shell ([e207562](https://github.com/runwayml/sdk-python/commit/e207562118ec1583e90639bbfc6cea00f4bed138))
28
+ * **docs:** remove unnecessary param examples ([d1ca063](https://github.com/runwayml/sdk-python/commit/d1ca06303f764543beda582da567ad182f25cf86))
29
+
3
30
  ## 3.2.0 (2025-05-29)
4
31
 
5
32
  Full Changelog: [v3.1.0...v3.2.0](https://github.com/runwayml/sdk-python/compare/v3.1.0...v3.2.0)
@@ -17,8 +17,7 @@ $ rye sync --all-features
17
17
  You can then run scripts using `rye run python script.py` or by activating the virtual environment:
18
18
 
19
19
  ```sh
20
- $ rye shell
21
- # or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20
+ # Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
22
21
  $ source .venv/bin/activate
23
22
 
24
23
  # now you can omit the `rye run` prefix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.2.0
3
+ Version: 3.4.0
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
@@ -127,9 +127,8 @@ text_to_image = client.text_to_image.create(
127
127
  model="gen4_image",
128
128
  prompt_text="promptText",
129
129
  ratio="1920:1080",
130
- content_moderation={"public_figure_threshold": "auto"},
131
130
  )
132
- print(text_to_image.content_moderation)
131
+ print(text_to_image.id)
133
132
  ```
134
133
 
135
134
  ## Handling errors
@@ -96,9 +96,8 @@ text_to_image = client.text_to_image.create(
96
96
  model="gen4_image",
97
97
  prompt_text="promptText",
98
98
  ratio="1920:1080",
99
- content_moderation={"public_figure_threshold": "auto"},
100
99
  )
101
- print(text_to_image.content_moderation)
100
+ print(text_to_image.id)
102
101
  ```
103
102
 
104
103
  ## Handling errors
@@ -35,6 +35,18 @@ Methods:
35
35
 
36
36
  - <code title="post /v1/text_to_image">client.text_to_image.<a href="./src/runwayml/resources/text_to_image.py">create</a>(\*\*<a href="src/runwayml/types/text_to_image_create_params.py">params</a>) -> <a href="./src/runwayml/types/text_to_image_create_response.py">TextToImageCreateResponse</a></code>
37
37
 
38
+ # VideoUpscale
39
+
40
+ Types:
41
+
42
+ ```python
43
+ from runwayml.types import VideoUpscaleCreateResponse
44
+ ```
45
+
46
+ Methods:
47
+
48
+ - <code title="post /v1/video_upscale">client.video_upscale.<a href="./src/runwayml/resources/video_upscale.py">create</a>(\*\*<a href="src/runwayml/types/video_upscale_create_params.py">params</a>) -> <a href="./src/runwayml/types/video_upscale_create_response.py">VideoUpscaleCreateResponse</a></code>
49
+
38
50
  # Organization
39
51
 
40
52
  Types:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runwayml"
3
- version = "3.2.0"
3
+ version = "3.4.0"
4
4
  description = "The official Python library for the runwayml API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -960,6 +960,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
960
960
  if self.custom_auth is not None:
961
961
  kwargs["auth"] = self.custom_auth
962
962
 
963
+ if options.follow_redirects is not None:
964
+ kwargs["follow_redirects"] = options.follow_redirects
965
+
963
966
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
964
967
 
965
968
  response = None
@@ -1460,6 +1463,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1460
1463
  if self.custom_auth is not None:
1461
1464
  kwargs["auth"] = self.custom_auth
1462
1465
 
1466
+ if options.follow_redirects is not None:
1467
+ kwargs["follow_redirects"] = options.follow_redirects
1468
+
1463
1469
  log.debug("Sending HTTP Request: %s %s", request.method, request.url)
1464
1470
 
1465
1471
  response = None
@@ -21,7 +21,7 @@ from ._types import (
21
21
  )
22
22
  from ._utils import is_given, get_async_library
23
23
  from ._version import __version__
24
- from .resources import tasks, organization, text_to_image, image_to_video
24
+ from .resources import tasks, organization, text_to_image, video_upscale, image_to_video
25
25
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
26
26
  from ._exceptions import RunwayMLError, APIStatusError
27
27
  from ._base_client import (
@@ -46,6 +46,7 @@ class RunwayML(SyncAPIClient):
46
46
  tasks: tasks.TasksResource
47
47
  image_to_video: image_to_video.ImageToVideoResource
48
48
  text_to_image: text_to_image.TextToImageResource
49
+ video_upscale: video_upscale.VideoUpscaleResource
49
50
  organization: organization.OrganizationResource
50
51
  with_raw_response: RunwayMLWithRawResponse
51
52
  with_streaming_response: RunwayMLWithStreamedResponse
@@ -113,6 +114,7 @@ class RunwayML(SyncAPIClient):
113
114
  self.tasks = tasks.TasksResource(self)
114
115
  self.image_to_video = image_to_video.ImageToVideoResource(self)
115
116
  self.text_to_image = text_to_image.TextToImageResource(self)
117
+ self.video_upscale = video_upscale.VideoUpscaleResource(self)
116
118
  self.organization = organization.OrganizationResource(self)
117
119
  self.with_raw_response = RunwayMLWithRawResponse(self)
118
120
  self.with_streaming_response = RunwayMLWithStreamedResponse(self)
@@ -229,6 +231,7 @@ class AsyncRunwayML(AsyncAPIClient):
229
231
  tasks: tasks.AsyncTasksResource
230
232
  image_to_video: image_to_video.AsyncImageToVideoResource
231
233
  text_to_image: text_to_image.AsyncTextToImageResource
234
+ video_upscale: video_upscale.AsyncVideoUpscaleResource
232
235
  organization: organization.AsyncOrganizationResource
233
236
  with_raw_response: AsyncRunwayMLWithRawResponse
234
237
  with_streaming_response: AsyncRunwayMLWithStreamedResponse
@@ -296,6 +299,7 @@ class AsyncRunwayML(AsyncAPIClient):
296
299
  self.tasks = tasks.AsyncTasksResource(self)
297
300
  self.image_to_video = image_to_video.AsyncImageToVideoResource(self)
298
301
  self.text_to_image = text_to_image.AsyncTextToImageResource(self)
302
+ self.video_upscale = video_upscale.AsyncVideoUpscaleResource(self)
299
303
  self.organization = organization.AsyncOrganizationResource(self)
300
304
  self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
301
305
  self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)
@@ -413,6 +417,7 @@ class RunwayMLWithRawResponse:
413
417
  self.tasks = tasks.TasksResourceWithRawResponse(client.tasks)
414
418
  self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
415
419
  self.text_to_image = text_to_image.TextToImageResourceWithRawResponse(client.text_to_image)
420
+ self.video_upscale = video_upscale.VideoUpscaleResourceWithRawResponse(client.video_upscale)
416
421
  self.organization = organization.OrganizationResourceWithRawResponse(client.organization)
417
422
 
418
423
 
@@ -421,6 +426,7 @@ class AsyncRunwayMLWithRawResponse:
421
426
  self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks)
422
427
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
423
428
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithRawResponse(client.text_to_image)
429
+ self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithRawResponse(client.video_upscale)
424
430
  self.organization = organization.AsyncOrganizationResourceWithRawResponse(client.organization)
425
431
 
426
432
 
@@ -429,6 +435,7 @@ class RunwayMLWithStreamedResponse:
429
435
  self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks)
430
436
  self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
431
437
  self.text_to_image = text_to_image.TextToImageResourceWithStreamingResponse(client.text_to_image)
438
+ self.video_upscale = video_upscale.VideoUpscaleResourceWithStreamingResponse(client.video_upscale)
432
439
  self.organization = organization.OrganizationResourceWithStreamingResponse(client.organization)
433
440
 
434
441
 
@@ -437,6 +444,7 @@ class AsyncRunwayMLWithStreamedResponse:
437
444
  self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks)
438
445
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
439
446
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithStreamingResponse(client.text_to_image)
447
+ self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithStreamingResponse(client.video_upscale)
440
448
  self.organization = organization.AsyncOrganizationResourceWithStreamingResponse(client.organization)
441
449
 
442
450
 
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
737
737
  idempotency_key: str
738
738
  json_data: Body
739
739
  extra_json: AnyMapping
740
+ follow_redirects: bool
740
741
 
741
742
 
742
743
  @final
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
750
751
  files: Union[HttpxRequestFiles, None] = None
751
752
  idempotency_key: Union[str, None] = None
752
753
  post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
754
+ follow_redirects: Union[bool, None] = None
753
755
 
754
756
  # It should be noted that we cannot use `json` here as that would override
755
757
  # a BaseModel method in an incompatible fashion.
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
100
100
  params: Query
101
101
  extra_json: AnyMapping
102
102
  idempotency_key: str
103
+ follow_redirects: bool
103
104
 
104
105
 
105
106
  # Sentinel class used until PEP 0661 is accepted
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
215
216
 
216
217
  class HttpxSendArgs(TypedDict, total=False):
217
218
  auth: httpx.Auth
219
+ follow_redirects: bool
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "runwayml"
4
- __version__ = "3.2.0" # x-release-please-version
4
+ __version__ = "3.4.0" # x-release-please-version
@@ -24,6 +24,14 @@ from .text_to_image import (
24
24
  TextToImageResourceWithStreamingResponse,
25
25
  AsyncTextToImageResourceWithStreamingResponse,
26
26
  )
27
+ from .video_upscale import (
28
+ VideoUpscaleResource,
29
+ AsyncVideoUpscaleResource,
30
+ VideoUpscaleResourceWithRawResponse,
31
+ AsyncVideoUpscaleResourceWithRawResponse,
32
+ VideoUpscaleResourceWithStreamingResponse,
33
+ AsyncVideoUpscaleResourceWithStreamingResponse,
34
+ )
27
35
  from .image_to_video import (
28
36
  ImageToVideoResource,
29
37
  AsyncImageToVideoResource,
@@ -52,6 +60,12 @@ __all__ = [
52
60
  "AsyncTextToImageResourceWithRawResponse",
53
61
  "TextToImageResourceWithStreamingResponse",
54
62
  "AsyncTextToImageResourceWithStreamingResponse",
63
+ "VideoUpscaleResource",
64
+ "AsyncVideoUpscaleResource",
65
+ "VideoUpscaleResourceWithRawResponse",
66
+ "AsyncVideoUpscaleResourceWithRawResponse",
67
+ "VideoUpscaleResourceWithStreamingResponse",
68
+ "AsyncVideoUpscaleResourceWithStreamingResponse",
55
69
  "OrganizationResource",
56
70
  "AsyncOrganizationResource",
57
71
  "OrganizationResourceWithRawResponse",
@@ -0,0 +1,195 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal
6
+
7
+ import httpx
8
+
9
+ from ..types import video_upscale_create_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from .._base_client import make_request_options
21
+ from ..types.video_upscale_create_response import VideoUpscaleCreateResponse
22
+
23
+ __all__ = ["VideoUpscaleResource", "AsyncVideoUpscaleResource"]
24
+
25
+
26
+ class VideoUpscaleResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> VideoUpscaleResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
34
+ """
35
+ return VideoUpscaleResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> VideoUpscaleResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
43
+ """
44
+ return VideoUpscaleResourceWithStreamingResponse(self)
45
+
46
+ def create(
47
+ self,
48
+ *,
49
+ model: Literal["upscale_v1"],
50
+ video_uri: str,
51
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
+ # The extra values given here take precedence over values defined on the client or passed to this method.
53
+ extra_headers: Headers | None = None,
54
+ extra_query: Query | None = None,
55
+ extra_body: Body | None = None,
56
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57
+ ) -> VideoUpscaleCreateResponse:
58
+ """This endpoint will start a new task to upscale a video.
59
+
60
+ Videos will be upscaled
61
+ by a factor of 4X, capped at a maximum of 4096px along each side.
62
+
63
+ Args:
64
+ model: The model variant to use.
65
+
66
+ video_uri: A HTTPS URL pointing to a video or a data URI containing a video. The video must
67
+ be less than 4096px on each side. The video duration may not exceed 40 seconds.
68
+ See [our docs](/assets/inputs#videos) on video inputs for more information.
69
+
70
+ extra_headers: Send extra headers
71
+
72
+ extra_query: Add additional query parameters to the request
73
+
74
+ extra_body: Add additional JSON properties to the request
75
+
76
+ timeout: Override the client-level default timeout for this request, in seconds
77
+ """
78
+ return self._post(
79
+ "/v1/video_upscale",
80
+ body=maybe_transform(
81
+ {
82
+ "model": model,
83
+ "video_uri": video_uri,
84
+ },
85
+ video_upscale_create_params.VideoUpscaleCreateParams,
86
+ ),
87
+ options=make_request_options(
88
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89
+ ),
90
+ cast_to=VideoUpscaleCreateResponse,
91
+ )
92
+
93
+
94
+ class AsyncVideoUpscaleResource(AsyncAPIResource):
95
+ @cached_property
96
+ def with_raw_response(self) -> AsyncVideoUpscaleResourceWithRawResponse:
97
+ """
98
+ This property can be used as a prefix for any HTTP method call to return
99
+ the raw response object instead of the parsed content.
100
+
101
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
102
+ """
103
+ return AsyncVideoUpscaleResourceWithRawResponse(self)
104
+
105
+ @cached_property
106
+ def with_streaming_response(self) -> AsyncVideoUpscaleResourceWithStreamingResponse:
107
+ """
108
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
109
+
110
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
111
+ """
112
+ return AsyncVideoUpscaleResourceWithStreamingResponse(self)
113
+
114
+ async def create(
115
+ self,
116
+ *,
117
+ model: Literal["upscale_v1"],
118
+ video_uri: str,
119
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
120
+ # The extra values given here take precedence over values defined on the client or passed to this method.
121
+ extra_headers: Headers | None = None,
122
+ extra_query: Query | None = None,
123
+ extra_body: Body | None = None,
124
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
125
+ ) -> VideoUpscaleCreateResponse:
126
+ """This endpoint will start a new task to upscale a video.
127
+
128
+ Videos will be upscaled
129
+ by a factor of 4X, capped at a maximum of 4096px along each side.
130
+
131
+ Args:
132
+ model: The model variant to use.
133
+
134
+ video_uri: A HTTPS URL pointing to a video or a data URI containing a video. The video must
135
+ be less than 4096px on each side. The video duration may not exceed 40 seconds.
136
+ See [our docs](/assets/inputs#videos) on video inputs for more information.
137
+
138
+ extra_headers: Send extra headers
139
+
140
+ extra_query: Add additional query parameters to the request
141
+
142
+ extra_body: Add additional JSON properties to the request
143
+
144
+ timeout: Override the client-level default timeout for this request, in seconds
145
+ """
146
+ return await self._post(
147
+ "/v1/video_upscale",
148
+ body=await async_maybe_transform(
149
+ {
150
+ "model": model,
151
+ "video_uri": video_uri,
152
+ },
153
+ video_upscale_create_params.VideoUpscaleCreateParams,
154
+ ),
155
+ options=make_request_options(
156
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
157
+ ),
158
+ cast_to=VideoUpscaleCreateResponse,
159
+ )
160
+
161
+
162
+ class VideoUpscaleResourceWithRawResponse:
163
+ def __init__(self, video_upscale: VideoUpscaleResource) -> None:
164
+ self._video_upscale = video_upscale
165
+
166
+ self.create = to_raw_response_wrapper(
167
+ video_upscale.create,
168
+ )
169
+
170
+
171
+ class AsyncVideoUpscaleResourceWithRawResponse:
172
+ def __init__(self, video_upscale: AsyncVideoUpscaleResource) -> None:
173
+ self._video_upscale = video_upscale
174
+
175
+ self.create = async_to_raw_response_wrapper(
176
+ video_upscale.create,
177
+ )
178
+
179
+
180
+ class VideoUpscaleResourceWithStreamingResponse:
181
+ def __init__(self, video_upscale: VideoUpscaleResource) -> None:
182
+ self._video_upscale = video_upscale
183
+
184
+ self.create = to_streamed_response_wrapper(
185
+ video_upscale.create,
186
+ )
187
+
188
+
189
+ class AsyncVideoUpscaleResourceWithStreamingResponse:
190
+ def __init__(self, video_upscale: AsyncVideoUpscaleResource) -> None:
191
+ self._video_upscale = video_upscale
192
+
193
+ self.create = async_to_streamed_response_wrapper(
194
+ video_upscale.create,
195
+ )
@@ -4,7 +4,9 @@ from __future__ import annotations
4
4
 
5
5
  from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse
6
6
  from .text_to_image_create_params import TextToImageCreateParams as TextToImageCreateParams
7
+ from .video_upscale_create_params import VideoUpscaleCreateParams as VideoUpscaleCreateParams
7
8
  from .image_to_video_create_params import ImageToVideoCreateParams as ImageToVideoCreateParams
8
9
  from .text_to_image_create_response import TextToImageCreateResponse as TextToImageCreateResponse
10
+ from .video_upscale_create_response import VideoUpscaleCreateResponse as VideoUpscaleCreateResponse
9
11
  from .image_to_video_create_response import ImageToVideoCreateResponse as ImageToVideoCreateResponse
10
12
  from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse
@@ -13,11 +13,13 @@ __all__ = [
13
13
  "TierModelsGen3aTurbo",
14
14
  "TierModelsGen4Image",
15
15
  "TierModelsGen4Turbo",
16
+ "TierModelsUpscaleV1",
16
17
  "Usage",
17
18
  "UsageModels",
18
19
  "UsageModelsGen3aTurbo",
19
20
  "UsageModelsGen4Image",
20
21
  "UsageModelsGen4Turbo",
22
+ "UsageModelsUpscaleV1",
21
23
  ]
22
24
 
23
25
 
@@ -45,6 +47,14 @@ class TierModelsGen4Turbo(BaseModel):
45
47
  """The maximum number of generations that can be created each day for this model."""
46
48
 
47
49
 
50
+ class TierModelsUpscaleV1(BaseModel):
51
+ max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
52
+ """The maximum number of generations that can be run concurrently for this model."""
53
+
54
+ max_daily_generations: int = FieldInfo(alias="maxDailyGenerations")
55
+ """The maximum number of generations that can be created each day for this model."""
56
+
57
+
48
58
  class TierModels(BaseModel):
49
59
  gen3a_turbo: Optional[TierModelsGen3aTurbo] = None
50
60
  """Limits associated with the gen3a_turbo model."""
@@ -55,6 +65,9 @@ class TierModels(BaseModel):
55
65
  gen4_turbo: Optional[TierModelsGen4Turbo] = None
56
66
  """Limits associated with the gen4_turbo model."""
57
67
 
68
+ upscale_v1: Optional[TierModelsUpscaleV1] = None
69
+ """Limits associated with the upscale_v1 model."""
70
+
58
71
 
59
72
  class Tier(BaseModel):
60
73
  max_monthly_credit_spend: int = FieldInfo(alias="maxMonthlyCreditSpend")
@@ -79,6 +92,11 @@ class UsageModelsGen4Turbo(BaseModel):
79
92
  """The number of generations that have been run for this model in the past day."""
80
93
 
81
94
 
95
+ class UsageModelsUpscaleV1(BaseModel):
96
+ daily_generations: int = FieldInfo(alias="dailyGenerations")
97
+ """The number of generations that have been run for this model in the past day."""
98
+
99
+
82
100
  class UsageModels(BaseModel):
83
101
  gen3a_turbo: Optional[UsageModelsGen3aTurbo] = None
84
102
  """Usage data for the gen3a_turbo model."""
@@ -89,6 +107,9 @@ class UsageModels(BaseModel):
89
107
  gen4_turbo: Optional[UsageModelsGen4Turbo] = None
90
108
  """Usage data for the gen4_turbo model."""
91
109
 
110
+ upscale_v1: Optional[UsageModelsUpscaleV1] = None
111
+ """Usage data for the upscale_v1 model."""
112
+
92
113
 
93
114
  class Usage(BaseModel):
94
115
  models: UsageModels
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, Annotated, TypedDict
6
+
7
+ from .._utils import PropertyInfo
8
+
9
+ __all__ = ["VideoUpscaleCreateParams"]
10
+
11
+
12
+ class VideoUpscaleCreateParams(TypedDict, total=False):
13
+ model: Required[Literal["upscale_v1"]]
14
+ """The model variant to use."""
15
+
16
+ video_uri: Required[Annotated[str, PropertyInfo(alias="videoUri")]]
17
+ """A HTTPS URL pointing to a video or a data URI containing a video.
18
+
19
+ The video must be less than 4096px on each side. The video duration may not
20
+ exceed 40 seconds. See [our docs](/assets/inputs#videos) on video inputs for
21
+ more information.
22
+ """
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["VideoUpscaleCreateResponse"]
6
+
7
+
8
+ class VideoUpscaleCreateResponse(BaseModel):
9
+ id: str
10
+ """The ID of the newly created task."""
@@ -0,0 +1,90 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from typing import Any, cast
7
+
8
+ import pytest
9
+
10
+ from runwayml import RunwayML, AsyncRunwayML
11
+ from tests.utils import assert_matches_type
12
+ from runwayml.types import VideoUpscaleCreateResponse
13
+
14
+ base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
15
+
16
+
17
+ class TestVideoUpscale:
18
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
19
+
20
+ @parametrize
21
+ def test_method_create(self, client: RunwayML) -> None:
22
+ video_upscale = client.video_upscale.create(
23
+ model="upscale_v1",
24
+ video_uri="https://example.com",
25
+ )
26
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
27
+
28
+ @parametrize
29
+ def test_raw_response_create(self, client: RunwayML) -> None:
30
+ response = client.video_upscale.with_raw_response.create(
31
+ model="upscale_v1",
32
+ video_uri="https://example.com",
33
+ )
34
+
35
+ assert response.is_closed is True
36
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
37
+ video_upscale = response.parse()
38
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
39
+
40
+ @parametrize
41
+ def test_streaming_response_create(self, client: RunwayML) -> None:
42
+ with client.video_upscale.with_streaming_response.create(
43
+ model="upscale_v1",
44
+ video_uri="https://example.com",
45
+ ) as response:
46
+ assert not response.is_closed
47
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
48
+
49
+ video_upscale = response.parse()
50
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
51
+
52
+ assert cast(Any, response.is_closed) is True
53
+
54
+
55
+ class TestAsyncVideoUpscale:
56
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
57
+
58
+ @parametrize
59
+ async def test_method_create(self, async_client: AsyncRunwayML) -> None:
60
+ video_upscale = await async_client.video_upscale.create(
61
+ model="upscale_v1",
62
+ video_uri="https://example.com",
63
+ )
64
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
65
+
66
+ @parametrize
67
+ async def test_raw_response_create(self, async_client: AsyncRunwayML) -> None:
68
+ response = await async_client.video_upscale.with_raw_response.create(
69
+ model="upscale_v1",
70
+ video_uri="https://example.com",
71
+ )
72
+
73
+ assert response.is_closed is True
74
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
75
+ video_upscale = await response.parse()
76
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
77
+
78
+ @parametrize
79
+ async def test_streaming_response_create(self, async_client: AsyncRunwayML) -> None:
80
+ async with async_client.video_upscale.with_streaming_response.create(
81
+ model="upscale_v1",
82
+ video_uri="https://example.com",
83
+ ) as response:
84
+ assert not response.is_closed
85
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
86
+
87
+ video_upscale = await response.parse()
88
+ assert_matches_type(VideoUpscaleCreateResponse, video_upscale, path=["response"])
89
+
90
+ assert cast(Any, response.is_closed) is True
@@ -852,6 +852,33 @@ class TestRunwayML:
852
852
 
853
853
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
854
854
 
855
+ @pytest.mark.respx(base_url=base_url)
856
+ def test_follow_redirects(self, respx_mock: MockRouter) -> None:
857
+ # Test that the default follow_redirects=True allows following redirects
858
+ respx_mock.post("/redirect").mock(
859
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
860
+ )
861
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
862
+
863
+ response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
864
+ assert response.status_code == 200
865
+ assert response.json() == {"status": "ok"}
866
+
867
+ @pytest.mark.respx(base_url=base_url)
868
+ def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
869
+ # Test that follow_redirects=False prevents following redirects
870
+ respx_mock.post("/redirect").mock(
871
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
872
+ )
873
+
874
+ with pytest.raises(APIStatusError) as exc_info:
875
+ self.client.post(
876
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
877
+ )
878
+
879
+ assert exc_info.value.response.status_code == 302
880
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
881
+
855
882
 
856
883
  class TestAsyncRunwayML:
857
884
  client = AsyncRunwayML(base_url=base_url, api_key=api_key, _strict_response_validation=True)
@@ -1709,3 +1736,30 @@ class TestAsyncRunwayML:
1709
1736
  raise AssertionError("calling get_platform using asyncify resulted in a hung process")
1710
1737
 
1711
1738
  time.sleep(0.1)
1739
+
1740
+ @pytest.mark.respx(base_url=base_url)
1741
+ async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
1742
+ # Test that the default follow_redirects=True allows following redirects
1743
+ respx_mock.post("/redirect").mock(
1744
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
1745
+ )
1746
+ respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
1747
+
1748
+ response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
1749
+ assert response.status_code == 200
1750
+ assert response.json() == {"status": "ok"}
1751
+
1752
+ @pytest.mark.respx(base_url=base_url)
1753
+ async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
1754
+ # Test that follow_redirects=False prevents following redirects
1755
+ respx_mock.post("/redirect").mock(
1756
+ return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
1757
+ )
1758
+
1759
+ with pytest.raises(APIStatusError) as exc_info:
1760
+ await self.client.post(
1761
+ "/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
1762
+ )
1763
+
1764
+ assert exc_info.value.response.status_code == 302
1765
+ assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
@@ -1,3 +0,0 @@
1
- {
2
- ".": "3.2.0"
3
- }
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