runwayml 3.6.4__tar.gz → 3.7.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 (91) hide show
  1. runwayml-3.7.0/.release-please-manifest.json +3 -0
  2. {runwayml-3.6.4 → runwayml-3.7.0}/CHANGELOG.md +28 -0
  3. {runwayml-3.6.4 → runwayml-3.7.0}/PKG-INFO +5 -5
  4. {runwayml-3.6.4 → runwayml-3.7.0}/README.md +3 -3
  5. {runwayml-3.6.4 → runwayml-3.7.0}/api.md +14 -1
  6. {runwayml-3.6.4 → runwayml-3.7.0}/examples/generate_image.py +1 -1
  7. {runwayml-3.6.4 → runwayml-3.7.0}/pyproject.toml +2 -2
  8. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_base_client.py +9 -2
  9. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_client.py +17 -1
  10. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_version.py +1 -1
  11. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/__init__.py +14 -0
  12. runwayml-3.7.0/src/runwayml/resources/character_performance.py +251 -0
  13. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/organization.py +116 -0
  14. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/__init__.py +6 -0
  15. runwayml-3.7.0/src/runwayml/types/character_performance_create_params.py +103 -0
  16. runwayml-3.7.0/src/runwayml/types/character_performance_create_response.py +10 -0
  17. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/organization_retrieve_response.py +21 -0
  18. runwayml-3.7.0/src/runwayml/types/organization_retrieve_usage_params.py +27 -0
  19. runwayml-3.7.0/src/runwayml/types/organization_retrieve_usage_response.py +37 -0
  20. runwayml-3.7.0/tests/api_resources/test_character_performance.py +180 -0
  21. runwayml-3.7.0/tests/api_resources/test_organization.py +144 -0
  22. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_client.py +2 -2
  23. runwayml-3.6.4/.release-please-manifest.json +0 -3
  24. runwayml-3.6.4/tests/api_resources/test_organization.py +0 -74
  25. {runwayml-3.6.4 → runwayml-3.7.0}/.gitignore +0 -0
  26. {runwayml-3.6.4 → runwayml-3.7.0}/CONTRIBUTING.md +0 -0
  27. {runwayml-3.6.4 → runwayml-3.7.0}/LICENSE +0 -0
  28. {runwayml-3.6.4 → runwayml-3.7.0}/SECURITY.md +0 -0
  29. {runwayml-3.6.4 → runwayml-3.7.0}/bin/check-release-environment +0 -0
  30. {runwayml-3.6.4 → runwayml-3.7.0}/bin/publish-pypi +0 -0
  31. {runwayml-3.6.4 → runwayml-3.7.0}/examples/.keep +0 -0
  32. {runwayml-3.6.4 → runwayml-3.7.0}/mypy.ini +0 -0
  33. {runwayml-3.6.4 → runwayml-3.7.0}/noxfile.py +0 -0
  34. {runwayml-3.6.4 → runwayml-3.7.0}/release-please-config.json +0 -0
  35. {runwayml-3.6.4 → runwayml-3.7.0}/requirements-dev.lock +0 -0
  36. {runwayml-3.6.4 → runwayml-3.7.0}/requirements.lock +0 -0
  37. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/__init__.py +0 -0
  38. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_compat.py +0 -0
  39. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_constants.py +0 -0
  40. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_exceptions.py +0 -0
  41. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_files.py +0 -0
  42. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_models.py +0 -0
  43. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_qs.py +0 -0
  44. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_resource.py +0 -0
  45. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_response.py +0 -0
  46. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_streaming.py +0 -0
  47. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_types.py +0 -0
  48. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/__init__.py +0 -0
  49. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_logs.py +0 -0
  50. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_proxy.py +0 -0
  51. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_reflection.py +0 -0
  52. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_resources_proxy.py +0 -0
  53. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_streams.py +0 -0
  54. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_sync.py +0 -0
  55. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_transform.py +0 -0
  56. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_typing.py +0 -0
  57. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/_utils/_utils.py +0 -0
  58. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/lib/.keep +0 -0
  59. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/lib/polling.py +0 -0
  60. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/py.typed +0 -0
  61. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/image_to_video.py +0 -0
  62. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/tasks.py +0 -0
  63. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/text_to_image.py +0 -0
  64. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/resources/video_upscale.py +0 -0
  65. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/image_to_video_create_params.py +0 -0
  66. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/image_to_video_create_response.py +0 -0
  67. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/task_retrieve_response.py +0 -0
  68. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/text_to_image_create_params.py +0 -0
  69. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/text_to_image_create_response.py +0 -0
  70. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/video_upscale_create_params.py +0 -0
  71. {runwayml-3.6.4 → runwayml-3.7.0}/src/runwayml/types/video_upscale_create_response.py +0 -0
  72. {runwayml-3.6.4 → runwayml-3.7.0}/tests/__init__.py +0 -0
  73. {runwayml-3.6.4 → runwayml-3.7.0}/tests/api_resources/__init__.py +0 -0
  74. {runwayml-3.6.4 → runwayml-3.7.0}/tests/api_resources/test_image_to_video.py +0 -0
  75. {runwayml-3.6.4 → runwayml-3.7.0}/tests/api_resources/test_tasks.py +0 -0
  76. {runwayml-3.6.4 → runwayml-3.7.0}/tests/api_resources/test_text_to_image.py +0 -0
  77. {runwayml-3.6.4 → runwayml-3.7.0}/tests/api_resources/test_video_upscale.py +0 -0
  78. {runwayml-3.6.4 → runwayml-3.7.0}/tests/conftest.py +0 -0
  79. {runwayml-3.6.4 → runwayml-3.7.0}/tests/sample_file.txt +0 -0
  80. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_deepcopy.py +0 -0
  81. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_extract_files.py +0 -0
  82. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_files.py +0 -0
  83. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_models.py +0 -0
  84. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_qs.py +0 -0
  85. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_required_args.py +0 -0
  86. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_response.py +0 -0
  87. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_streaming.py +0 -0
  88. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_transform.py +0 -0
  89. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_utils/test_proxy.py +0 -0
  90. {runwayml-3.6.4 → runwayml-3.7.0}/tests/test_utils/test_typing.py +0 -0
  91. {runwayml-3.6.4 → runwayml-3.7.0}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.7.0"
3
+ }
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.0 (2025-07-19)
4
+
5
+ Full Changelog: [v3.6.5...v3.7.0](https://github.com/runwayml/sdk-python/compare/v3.6.5...v3.7.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** Act Two, credit usage endpoints ([f1114e0](https://github.com/runwayml/sdk-python/commit/f1114e0be865f9e27e697dfcaeb5dc6c0be659ed))
10
+ * **api:** Awaitability on new resources ([7612c78](https://github.com/runwayml/sdk-python/commit/7612c78ee6f64969138685312c4a3d539191beb9))
11
+ * clean up environment call outs ([caa8eff](https://github.com/runwayml/sdk-python/commit/caa8eff7855430950fe4184c3db885e84a607d5f))
12
+
13
+
14
+ ### Chores
15
+
16
+ * **client:** lint ([d745891](https://github.com/runwayml/sdk-python/commit/d74589104c8a15d5ab4e87b1f4de4ec915210a3e))
17
+
18
+ ## 3.6.5 (2025-07-12)
19
+
20
+ Full Changelog: [v3.6.4...v3.6.5](https://github.com/runwayml/sdk-python/compare/v3.6.4...v3.6.5)
21
+
22
+ ### Bug Fixes
23
+
24
+ * **client:** don't send Content-Type header on GET requests ([6567867](https://github.com/runwayml/sdk-python/commit/656786737e8ee74a40c731b6d2659b1c1b34ce20))
25
+
26
+
27
+ ### Chores
28
+
29
+ * **readme:** fix version rendering on pypi ([f38de2a](https://github.com/runwayml/sdk-python/commit/f38de2a823870a12ce893324e4889a5aec5a3392))
30
+
3
31
  ## 3.6.4 (2025-07-10)
4
32
 
5
33
  Full Changelog: [v3.6.3...v3.6.4](https://github.com/runwayml/sdk-python/compare/v3.6.3...v3.6.4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.6.4
3
+ Version: 3.7.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
@@ -30,12 +30,13 @@ Requires-Dist: sniffio
30
30
  Requires-Dist: typing-extensions<5,>=4.10
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
- Requires-Dist: httpx-aiohttp>=0.1.6; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
34
34
  Description-Content-Type: text/markdown
35
35
 
36
36
  # RunwayML Python API library
37
37
 
38
- [![PyPI version](https://github.com/runwayml/sdk-python/tree/main/<https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable)>)](https://pypi.org/project/runwayml/)
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable))](https://pypi.org/project/runwayml/)
39
40
 
40
41
  The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.8+
41
42
  application. The library includes type definitions for all request params and response fields,
@@ -123,7 +124,6 @@ pip install runwayml[aiohttp]
123
124
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
124
125
 
125
126
  ```python
126
- import os
127
127
  import asyncio
128
128
  from runwayml import DefaultAioHttpClient
129
129
  from runwayml import AsyncRunwayML
@@ -131,7 +131,7 @@ from runwayml import AsyncRunwayML
131
131
 
132
132
  async def main() -> None:
133
133
  async with AsyncRunwayML(
134
- api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
134
+ api_key="My API Key",
135
135
  http_client=DefaultAioHttpClient(),
136
136
  ) as client:
137
137
  image_to_video = await client.image_to_video.create(
@@ -1,6 +1,7 @@
1
1
  # RunwayML Python API library
2
2
 
3
- [![PyPI version](<https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable)>)](https://pypi.org/project/runwayml/)
3
+ <!-- prettier-ignore -->
4
+ [![PyPI version](https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable))](https://pypi.org/project/runwayml/)
4
5
 
5
6
  The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.8+
6
7
  application. The library includes type definitions for all request params and response fields,
@@ -88,7 +89,6 @@ pip install runwayml[aiohttp]
88
89
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
89
90
 
90
91
  ```python
91
- import os
92
92
  import asyncio
93
93
  from runwayml import DefaultAioHttpClient
94
94
  from runwayml import AsyncRunwayML
@@ -96,7 +96,7 @@ from runwayml import AsyncRunwayML
96
96
 
97
97
  async def main() -> None:
98
98
  async with AsyncRunwayML(
99
- api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
99
+ api_key="My API Key",
100
100
  http_client=DefaultAioHttpClient(),
101
101
  ) as client:
102
102
  image_to_video = await client.image_to_video.create(
@@ -47,14 +47,27 @@ Methods:
47
47
 
48
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
49
 
50
+ # CharacterPerformance
51
+
52
+ Types:
53
+
54
+ ```python
55
+ from runwayml.types import CharacterPerformanceCreateResponse
56
+ ```
57
+
58
+ Methods:
59
+
60
+ - <code title="post /v1/character_performance">client.character_performance.<a href="./src/runwayml/resources/character_performance.py">create</a>(\*\*<a href="src/runwayml/types/character_performance_create_params.py">params</a>) -> <a href="./src/runwayml/types/character_performance_create_response.py">CharacterPerformanceCreateResponse</a></code>
61
+
50
62
  # Organization
51
63
 
52
64
  Types:
53
65
 
54
66
  ```python
55
- from runwayml.types import OrganizationRetrieveResponse
67
+ from runwayml.types import OrganizationRetrieveResponse, OrganizationRetrieveUsageResponse
56
68
  ```
57
69
 
58
70
  Methods:
59
71
 
60
72
  - <code title="get /v1/organization">client.organization.<a href="./src/runwayml/resources/organization.py">retrieve</a>() -> <a href="./src/runwayml/types/organization_retrieve_response.py">OrganizationRetrieveResponse</a></code>
73
+ - <code title="post /v1/organization/usage">client.organization.<a href="./src/runwayml/resources/organization.py">retrieve_usage</a>(\*\*<a href="src/runwayml/types/organization_retrieve_usage_params.py">params</a>) -> <a href="./src/runwayml/types/organization_retrieve_usage_response.py">OrganizationRetrieveUsageResponse</a></code>
@@ -10,7 +10,7 @@ image_task = client.text_to_image.create(
10
10
  try:
11
11
  output = image_task.wait_for_task_output()
12
12
  except TaskFailedError as e:
13
- print('The image failed to generate.')
13
+ print("The image failed to generate.")
14
14
  print(e.task_details)
15
15
  else:
16
16
  print(output.output[0]) # type: ignore
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runwayml"
3
- version = "3.6.4"
3
+ version = "3.7.0"
4
4
  description = "The official Python library for the runwayml API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -39,7 +39,7 @@ Homepage = "https://github.com/runwayml/sdk-python"
39
39
  Repository = "https://github.com/runwayml/sdk-python"
40
40
 
41
41
  [project.optional-dependencies]
42
- aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
42
+ aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
43
43
 
44
44
  [tool.rye]
45
45
  managed = true
@@ -529,6 +529,15 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
529
529
  # work around https://github.com/encode/httpx/discussions/2880
530
530
  kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
531
531
 
532
+ is_body_allowed = options.method.lower() != "get"
533
+
534
+ if is_body_allowed:
535
+ kwargs["json"] = json_data if is_given(json_data) else None
536
+ kwargs["files"] = files
537
+ else:
538
+ headers.pop("Content-Type", None)
539
+ kwargs.pop("data", None)
540
+
532
541
  # TODO: report this error to httpx
533
542
  return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
534
543
  headers=headers,
@@ -540,8 +549,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
540
549
  # so that passing a `TypedDict` doesn't cause an error.
541
550
  # https://github.com/microsoft/pyright/issues/3526#event-6715453066
542
551
  params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
543
- json=json_data if is_given(json_data) else None,
544
- files=files,
545
552
  **kwargs,
546
553
  )
547
554
 
@@ -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, video_upscale, image_to_video
24
+ from .resources import tasks, organization, text_to_image, video_upscale, image_to_video, character_performance
25
25
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
26
26
  from ._exceptions import RunwayMLError, APIStatusError
27
27
  from ._base_client import (
@@ -47,6 +47,7 @@ class RunwayML(SyncAPIClient):
47
47
  image_to_video: image_to_video.ImageToVideoResource
48
48
  text_to_image: text_to_image.TextToImageResource
49
49
  video_upscale: video_upscale.VideoUpscaleResource
50
+ character_performance: character_performance.CharacterPerformanceResource
50
51
  organization: organization.OrganizationResource
51
52
  with_raw_response: RunwayMLWithRawResponse
52
53
  with_streaming_response: RunwayMLWithStreamedResponse
@@ -115,6 +116,7 @@ class RunwayML(SyncAPIClient):
115
116
  self.image_to_video = image_to_video.ImageToVideoResource(self)
116
117
  self.text_to_image = text_to_image.TextToImageResource(self)
117
118
  self.video_upscale = video_upscale.VideoUpscaleResource(self)
119
+ self.character_performance = character_performance.CharacterPerformanceResource(self)
118
120
  self.organization = organization.OrganizationResource(self)
119
121
  self.with_raw_response = RunwayMLWithRawResponse(self)
120
122
  self.with_streaming_response = RunwayMLWithStreamedResponse(self)
@@ -232,6 +234,7 @@ class AsyncRunwayML(AsyncAPIClient):
232
234
  image_to_video: image_to_video.AsyncImageToVideoResource
233
235
  text_to_image: text_to_image.AsyncTextToImageResource
234
236
  video_upscale: video_upscale.AsyncVideoUpscaleResource
237
+ character_performance: character_performance.AsyncCharacterPerformanceResource
235
238
  organization: organization.AsyncOrganizationResource
236
239
  with_raw_response: AsyncRunwayMLWithRawResponse
237
240
  with_streaming_response: AsyncRunwayMLWithStreamedResponse
@@ -300,6 +303,7 @@ class AsyncRunwayML(AsyncAPIClient):
300
303
  self.image_to_video = image_to_video.AsyncImageToVideoResource(self)
301
304
  self.text_to_image = text_to_image.AsyncTextToImageResource(self)
302
305
  self.video_upscale = video_upscale.AsyncVideoUpscaleResource(self)
306
+ self.character_performance = character_performance.AsyncCharacterPerformanceResource(self)
303
307
  self.organization = organization.AsyncOrganizationResource(self)
304
308
  self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
305
309
  self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)
@@ -418,6 +422,9 @@ class RunwayMLWithRawResponse:
418
422
  self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
419
423
  self.text_to_image = text_to_image.TextToImageResourceWithRawResponse(client.text_to_image)
420
424
  self.video_upscale = video_upscale.VideoUpscaleResourceWithRawResponse(client.video_upscale)
425
+ self.character_performance = character_performance.CharacterPerformanceResourceWithRawResponse(
426
+ client.character_performance
427
+ )
421
428
  self.organization = organization.OrganizationResourceWithRawResponse(client.organization)
422
429
 
423
430
 
@@ -427,6 +434,9 @@ class AsyncRunwayMLWithRawResponse:
427
434
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
428
435
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithRawResponse(client.text_to_image)
429
436
  self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithRawResponse(client.video_upscale)
437
+ self.character_performance = character_performance.AsyncCharacterPerformanceResourceWithRawResponse(
438
+ client.character_performance
439
+ )
430
440
  self.organization = organization.AsyncOrganizationResourceWithRawResponse(client.organization)
431
441
 
432
442
 
@@ -436,6 +446,9 @@ class RunwayMLWithStreamedResponse:
436
446
  self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
437
447
  self.text_to_image = text_to_image.TextToImageResourceWithStreamingResponse(client.text_to_image)
438
448
  self.video_upscale = video_upscale.VideoUpscaleResourceWithStreamingResponse(client.video_upscale)
449
+ self.character_performance = character_performance.CharacterPerformanceResourceWithStreamingResponse(
450
+ client.character_performance
451
+ )
439
452
  self.organization = organization.OrganizationResourceWithStreamingResponse(client.organization)
440
453
 
441
454
 
@@ -445,6 +458,9 @@ class AsyncRunwayMLWithStreamedResponse:
445
458
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
446
459
  self.text_to_image = text_to_image.AsyncTextToImageResourceWithStreamingResponse(client.text_to_image)
447
460
  self.video_upscale = video_upscale.AsyncVideoUpscaleResourceWithStreamingResponse(client.video_upscale)
461
+ self.character_performance = character_performance.AsyncCharacterPerformanceResourceWithStreamingResponse(
462
+ client.character_performance
463
+ )
448
464
  self.organization = organization.AsyncOrganizationResourceWithStreamingResponse(client.organization)
449
465
 
450
466
 
@@ -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.6.4" # x-release-please-version
4
+ __version__ = "3.7.0" # x-release-please-version
@@ -40,6 +40,14 @@ from .image_to_video import (
40
40
  ImageToVideoResourceWithStreamingResponse,
41
41
  AsyncImageToVideoResourceWithStreamingResponse,
42
42
  )
43
+ from .character_performance import (
44
+ CharacterPerformanceResource,
45
+ AsyncCharacterPerformanceResource,
46
+ CharacterPerformanceResourceWithRawResponse,
47
+ AsyncCharacterPerformanceResourceWithRawResponse,
48
+ CharacterPerformanceResourceWithStreamingResponse,
49
+ AsyncCharacterPerformanceResourceWithStreamingResponse,
50
+ )
43
51
 
44
52
  __all__ = [
45
53
  "TasksResource",
@@ -66,6 +74,12 @@ __all__ = [
66
74
  "AsyncVideoUpscaleResourceWithRawResponse",
67
75
  "VideoUpscaleResourceWithStreamingResponse",
68
76
  "AsyncVideoUpscaleResourceWithStreamingResponse",
77
+ "CharacterPerformanceResource",
78
+ "AsyncCharacterPerformanceResource",
79
+ "CharacterPerformanceResourceWithRawResponse",
80
+ "AsyncCharacterPerformanceResourceWithRawResponse",
81
+ "CharacterPerformanceResourceWithStreamingResponse",
82
+ "AsyncCharacterPerformanceResourceWithStreamingResponse",
69
83
  "OrganizationResource",
70
84
  "AsyncOrganizationResource",
71
85
  "OrganizationResourceWithRawResponse",
@@ -0,0 +1,251 @@
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 character_performance_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 ..lib.polling import (
21
+ NewTaskCreatedResponse,
22
+ AsyncNewTaskCreatedResponse,
23
+ create_waitable_resource,
24
+ create_async_waitable_resource,
25
+ )
26
+ from .._base_client import make_request_options
27
+ from ..types.character_performance_create_response import CharacterPerformanceCreateResponse
28
+
29
+ __all__ = ["CharacterPerformanceResource", "AsyncCharacterPerformanceResource"]
30
+
31
+
32
+ class CharacterPerformanceResource(SyncAPIResource):
33
+ @cached_property
34
+ def with_raw_response(self) -> CharacterPerformanceResourceWithRawResponse:
35
+ """
36
+ This property can be used as a prefix for any HTTP method call to return
37
+ the raw response object instead of the parsed content.
38
+
39
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
40
+ """
41
+ return CharacterPerformanceResourceWithRawResponse(self)
42
+
43
+ @cached_property
44
+ def with_streaming_response(self) -> CharacterPerformanceResourceWithStreamingResponse:
45
+ """
46
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
47
+
48
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
49
+ """
50
+ return CharacterPerformanceResourceWithStreamingResponse(self)
51
+
52
+ def create(
53
+ self,
54
+ *,
55
+ character: character_performance_create_params.Character,
56
+ model: Literal["act_two"],
57
+ ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
58
+ reference: character_performance_create_params.Reference,
59
+ body_control: bool | NotGiven = NOT_GIVEN,
60
+ content_moderation: character_performance_create_params.ContentModeration | NotGiven = NOT_GIVEN,
61
+ expression_intensity: int | NotGiven = NOT_GIVEN,
62
+ seed: int | NotGiven = NOT_GIVEN,
63
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
64
+ # The extra values given here take precedence over values defined on the client or passed to this method.
65
+ extra_headers: Headers | None = None,
66
+ extra_query: Query | None = None,
67
+ extra_body: Body | None = None,
68
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
69
+ ) -> NewTaskCreatedResponse:
70
+ """
71
+ This endpoint will start a new task to control a character's facial expressions
72
+ and body movements using a reference video.
73
+
74
+ Args:
75
+ character: The character to control. You can either provide a video or an image. A visually
76
+ recognizable face must be visible and stay within the frame.
77
+
78
+ model: The model variant to use.
79
+
80
+ ratio: The resolution of the output video.
81
+
82
+ body_control: A boolean indicating whether to enable body control. When enabled, non-facial
83
+ movements and gestures will be applied to the character in addition to facial
84
+ expressions.
85
+
86
+ content_moderation: Settings that affect the behavior of the content moderation system.
87
+
88
+ expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
89
+ of the character's expression.
90
+
91
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
92
+ get different results for the same other request parameters. Using the same seed
93
+ integer for an identical request will produce similar results.
94
+
95
+ extra_headers: Send extra headers
96
+
97
+ extra_query: Add additional query parameters to the request
98
+
99
+ extra_body: Add additional JSON properties to the request
100
+
101
+ timeout: Override the client-level default timeout for this request, in seconds
102
+ """
103
+ return self._post(
104
+ "/v1/character_performance",
105
+ body=maybe_transform(
106
+ {
107
+ "character": character,
108
+ "model": model,
109
+ "ratio": ratio,
110
+ "reference": reference,
111
+ "body_control": body_control,
112
+ "content_moderation": content_moderation,
113
+ "expression_intensity": expression_intensity,
114
+ "seed": seed,
115
+ },
116
+ character_performance_create_params.CharacterPerformanceCreateParams,
117
+ ),
118
+ options=make_request_options(
119
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
120
+ ),
121
+ cast_to=create_waitable_resource(CharacterPerformanceCreateResponse, self._client),
122
+ )
123
+
124
+
125
+ class AsyncCharacterPerformanceResource(AsyncAPIResource):
126
+ @cached_property
127
+ def with_raw_response(self) -> AsyncCharacterPerformanceResourceWithRawResponse:
128
+ """
129
+ This property can be used as a prefix for any HTTP method call to return
130
+ the raw response object instead of the parsed content.
131
+
132
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
133
+ """
134
+ return AsyncCharacterPerformanceResourceWithRawResponse(self)
135
+
136
+ @cached_property
137
+ def with_streaming_response(self) -> AsyncCharacterPerformanceResourceWithStreamingResponse:
138
+ """
139
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
140
+
141
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
142
+ """
143
+ return AsyncCharacterPerformanceResourceWithStreamingResponse(self)
144
+
145
+ async def create(
146
+ self,
147
+ *,
148
+ character: character_performance_create_params.Character,
149
+ model: Literal["act_two"],
150
+ ratio: Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"],
151
+ reference: character_performance_create_params.Reference,
152
+ body_control: bool | NotGiven = NOT_GIVEN,
153
+ content_moderation: character_performance_create_params.ContentModeration | NotGiven = NOT_GIVEN,
154
+ expression_intensity: int | NotGiven = NOT_GIVEN,
155
+ seed: int | NotGiven = NOT_GIVEN,
156
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
157
+ # The extra values given here take precedence over values defined on the client or passed to this method.
158
+ extra_headers: Headers | None = None,
159
+ extra_query: Query | None = None,
160
+ extra_body: Body | None = None,
161
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
162
+ ) -> AsyncNewTaskCreatedResponse:
163
+ """
164
+ This endpoint will start a new task to control a character's facial expressions
165
+ and body movements using a reference video.
166
+
167
+ Args:
168
+ character: The character to control. You can either provide a video or an image. A visually
169
+ recognizable face must be visible and stay within the frame.
170
+
171
+ model: The model variant to use.
172
+
173
+ ratio: The resolution of the output video.
174
+
175
+ body_control: A boolean indicating whether to enable body control. When enabled, non-facial
176
+ movements and gestures will be applied to the character in addition to facial
177
+ expressions.
178
+
179
+ content_moderation: Settings that affect the behavior of the content moderation system.
180
+
181
+ expression_intensity: An integer between 1 and 5 (inclusive). A larger value increases the intensity
182
+ of the character's expression.
183
+
184
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
185
+ get different results for the same other request parameters. Using the same seed
186
+ integer for an identical request will produce similar results.
187
+
188
+ extra_headers: Send extra headers
189
+
190
+ extra_query: Add additional query parameters to the request
191
+
192
+ extra_body: Add additional JSON properties to the request
193
+
194
+ timeout: Override the client-level default timeout for this request, in seconds
195
+ """
196
+ return await self._post(
197
+ "/v1/character_performance",
198
+ body=await async_maybe_transform(
199
+ {
200
+ "character": character,
201
+ "model": model,
202
+ "ratio": ratio,
203
+ "reference": reference,
204
+ "body_control": body_control,
205
+ "content_moderation": content_moderation,
206
+ "expression_intensity": expression_intensity,
207
+ "seed": seed,
208
+ },
209
+ character_performance_create_params.CharacterPerformanceCreateParams,
210
+ ),
211
+ options=make_request_options(
212
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
213
+ ),
214
+ cast_to=create_async_waitable_resource(CharacterPerformanceCreateResponse, self._client),
215
+ )
216
+
217
+
218
+ class CharacterPerformanceResourceWithRawResponse:
219
+ def __init__(self, character_performance: CharacterPerformanceResource) -> None:
220
+ self._character_performance = character_performance
221
+
222
+ self.create = to_raw_response_wrapper(
223
+ character_performance.create,
224
+ )
225
+
226
+
227
+ class AsyncCharacterPerformanceResourceWithRawResponse:
228
+ def __init__(self, character_performance: AsyncCharacterPerformanceResource) -> None:
229
+ self._character_performance = character_performance
230
+
231
+ self.create = async_to_raw_response_wrapper(
232
+ character_performance.create,
233
+ )
234
+
235
+
236
+ class CharacterPerformanceResourceWithStreamingResponse:
237
+ def __init__(self, character_performance: CharacterPerformanceResource) -> None:
238
+ self._character_performance = character_performance
239
+
240
+ self.create = to_streamed_response_wrapper(
241
+ character_performance.create,
242
+ )
243
+
244
+
245
+ class AsyncCharacterPerformanceResourceWithStreamingResponse:
246
+ def __init__(self, character_performance: AsyncCharacterPerformanceResource) -> None:
247
+ self._character_performance = character_performance
248
+
249
+ self.create = async_to_streamed_response_wrapper(
250
+ character_performance.create,
251
+ )