runwayml 3.0.3__tar.gz → 3.0.5__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 (74) hide show
  1. runwayml-3.0.5/.release-please-manifest.json +3 -0
  2. {runwayml-3.0.3 → runwayml-3.0.5}/CHANGELOG.md +22 -0
  3. {runwayml-3.0.3 → runwayml-3.0.5}/PKG-INFO +8 -1
  4. {runwayml-3.0.3 → runwayml-3.0.5}/README.md +7 -0
  5. {runwayml-3.0.3 → runwayml-3.0.5}/pyproject.toml +1 -1
  6. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/__init__.py +5 -0
  7. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_proxy.py +4 -1
  8. runwayml-3.0.5/src/runwayml/_utils/_resources_proxy.py +24 -0
  9. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_version.py +1 -1
  10. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/resources/image_to_video.py +42 -12
  11. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/types/image_to_video_create_params.py +25 -2
  12. {runwayml-3.0.3 → runwayml-3.0.5}/tests/api_resources/test_image_to_video.py +8 -2
  13. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_client.py +22 -6
  14. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_utils/test_proxy.py +11 -0
  15. runwayml-3.0.3/.release-please-manifest.json +0 -3
  16. {runwayml-3.0.3 → runwayml-3.0.5}/.gitignore +0 -0
  17. {runwayml-3.0.3 → runwayml-3.0.5}/CONTRIBUTING.md +0 -0
  18. {runwayml-3.0.3 → runwayml-3.0.5}/LICENSE +0 -0
  19. {runwayml-3.0.3 → runwayml-3.0.5}/SECURITY.md +0 -0
  20. {runwayml-3.0.3 → runwayml-3.0.5}/api.md +0 -0
  21. {runwayml-3.0.3 → runwayml-3.0.5}/bin/check-release-environment +0 -0
  22. {runwayml-3.0.3 → runwayml-3.0.5}/bin/publish-pypi +0 -0
  23. {runwayml-3.0.3 → runwayml-3.0.5}/examples/.keep +0 -0
  24. {runwayml-3.0.3 → runwayml-3.0.5}/mypy.ini +0 -0
  25. {runwayml-3.0.3 → runwayml-3.0.5}/noxfile.py +0 -0
  26. {runwayml-3.0.3 → runwayml-3.0.5}/release-please-config.json +0 -0
  27. {runwayml-3.0.3 → runwayml-3.0.5}/requirements-dev.lock +0 -0
  28. {runwayml-3.0.3 → runwayml-3.0.5}/requirements.lock +0 -0
  29. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_base_client.py +0 -0
  30. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_client.py +0 -0
  31. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_compat.py +0 -0
  32. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_constants.py +0 -0
  33. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_exceptions.py +0 -0
  34. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_files.py +0 -0
  35. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_models.py +0 -0
  36. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_qs.py +0 -0
  37. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_resource.py +0 -0
  38. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_response.py +0 -0
  39. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_streaming.py +0 -0
  40. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_types.py +0 -0
  41. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/__init__.py +0 -0
  42. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_logs.py +0 -0
  43. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_reflection.py +0 -0
  44. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_streams.py +0 -0
  45. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_sync.py +0 -0
  46. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_transform.py +0 -0
  47. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_typing.py +0 -0
  48. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/_utils/_utils.py +0 -0
  49. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/lib/.keep +0 -0
  50. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/py.typed +0 -0
  51. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/resources/__init__.py +0 -0
  52. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/resources/organization.py +0 -0
  53. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/resources/tasks.py +0 -0
  54. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/types/__init__.py +0 -0
  55. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/types/image_to_video_create_response.py +0 -0
  56. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/types/organization_retrieve_response.py +0 -0
  57. {runwayml-3.0.3 → runwayml-3.0.5}/src/runwayml/types/task_retrieve_response.py +0 -0
  58. {runwayml-3.0.3 → runwayml-3.0.5}/tests/__init__.py +0 -0
  59. {runwayml-3.0.3 → runwayml-3.0.5}/tests/api_resources/__init__.py +0 -0
  60. {runwayml-3.0.3 → runwayml-3.0.5}/tests/api_resources/test_organization.py +0 -0
  61. {runwayml-3.0.3 → runwayml-3.0.5}/tests/api_resources/test_tasks.py +0 -0
  62. {runwayml-3.0.3 → runwayml-3.0.5}/tests/conftest.py +0 -0
  63. {runwayml-3.0.3 → runwayml-3.0.5}/tests/sample_file.txt +0 -0
  64. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_deepcopy.py +0 -0
  65. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_extract_files.py +0 -0
  66. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_files.py +0 -0
  67. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_models.py +0 -0
  68. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_qs.py +0 -0
  69. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_required_args.py +0 -0
  70. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_response.py +0 -0
  71. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_streaming.py +0 -0
  72. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_transform.py +0 -0
  73. {runwayml-3.0.3 → runwayml-3.0.5}/tests/test_utils/test_typing.py +0 -0
  74. {runwayml-3.0.3 → runwayml-3.0.5}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "3.0.5"
3
+ }
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.5 (2025-05-10)
4
+
5
+ Full Changelog: [v3.0.4...v3.0.5](https://github.com/runwayml/sdk-python/compare/v3.0.4...v3.0.5)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **package:** support direct resource imports ([f317064](https://github.com/runwayml/sdk-python/commit/f3170641fd7e8a58bfc8135314407e887a3a0068))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** avoid errors for isinstance checks on proxies ([a549b98](https://github.com/runwayml/sdk-python/commit/a549b98239afa6984f306db53cd2ac4895a7f4ac))
15
+
16
+ ## 3.0.4 (2025-04-30)
17
+
18
+ Full Changelog: [v3.0.3...v3.0.4](https://github.com/runwayml/sdk-python/compare/v3.0.3...v3.0.4)
19
+
20
+ ### Bug Fixes
21
+
22
+ * **api:** Fix for parameters with missing descriptions ([1ab27c6](https://github.com/runwayml/sdk-python/commit/1ab27c6285263701b69ed1ea05751a78a333e25f))
23
+ * **api:** Make `ratio` a required parameter for i2v ([e1b73a5](https://github.com/runwayml/sdk-python/commit/e1b73a55073ae5d0d224b751726515d946a93607))
24
+
3
25
  ## 3.0.3 (2025-04-24)
4
26
 
5
27
  Full Changelog: [v3.0.2...v3.0.3](https://github.com/runwayml/sdk-python/compare/v3.0.2...v3.0.3)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.0.3
3
+ Version: 3.0.5
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
@@ -65,6 +65,7 @@ client = RunwayML(
65
65
  image_to_video = client.image_to_video.create(
66
66
  model="gen4_turbo",
67
67
  prompt_image="https://example.com/assets/bunny.jpg",
68
+ ratio="1280:720",
68
69
  prompt_text="The bunny is eating a carrot",
69
70
  )
70
71
  print(image_to_video.id)
@@ -93,6 +94,7 @@ async def main() -> None:
93
94
  image_to_video = await client.image_to_video.create(
94
95
  model="gen4_turbo",
95
96
  prompt_image="https://example.com/assets/bunny.jpg",
97
+ ratio="1280:720",
96
98
  prompt_text="The bunny is eating a carrot",
97
99
  )
98
100
  print(image_to_video.id)
@@ -131,6 +133,7 @@ try:
131
133
  client.image_to_video.create(
132
134
  model="gen4_turbo",
133
135
  prompt_image="https://example.com/assets/bunny.jpg",
136
+ ratio="1280:720",
134
137
  prompt_text="The bunny is eating a carrot",
135
138
  )
136
139
  except runwayml.APIConnectionError as e:
@@ -178,6 +181,7 @@ client = RunwayML(
178
181
  client.with_options(max_retries=5).image_to_video.create(
179
182
  model="gen4_turbo",
180
183
  prompt_image="https://example.com/assets/bunny.jpg",
184
+ ratio="1280:720",
181
185
  prompt_text="The bunny is eating a carrot",
182
186
  )
183
187
  ```
@@ -205,6 +209,7 @@ client = RunwayML(
205
209
  client.with_options(timeout=5.0).image_to_video.create(
206
210
  model="gen4_turbo",
207
211
  prompt_image="https://example.com/assets/bunny.jpg",
212
+ ratio="1280:720",
208
213
  prompt_text="The bunny is eating a carrot",
209
214
  )
210
215
  ```
@@ -250,6 +255,7 @@ client = RunwayML()
250
255
  response = client.image_to_video.with_raw_response.create(
251
256
  model="gen4_turbo",
252
257
  prompt_image="https://example.com/assets/bunny.jpg",
258
+ ratio="1280:720",
253
259
  prompt_text="The bunny is eating a carrot",
254
260
  )
255
261
  print(response.headers.get('X-My-Header'))
@@ -272,6 +278,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
272
278
  with client.image_to_video.with_streaming_response.create(
273
279
  model="gen4_turbo",
274
280
  prompt_image="https://example.com/assets/bunny.jpg",
281
+ ratio="1280:720",
275
282
  prompt_text="The bunny is eating a carrot",
276
283
  ) as response:
277
284
  print(response.headers.get("X-My-Header"))
@@ -34,6 +34,7 @@ client = RunwayML(
34
34
  image_to_video = client.image_to_video.create(
35
35
  model="gen4_turbo",
36
36
  prompt_image="https://example.com/assets/bunny.jpg",
37
+ ratio="1280:720",
37
38
  prompt_text="The bunny is eating a carrot",
38
39
  )
39
40
  print(image_to_video.id)
@@ -62,6 +63,7 @@ async def main() -> None:
62
63
  image_to_video = await client.image_to_video.create(
63
64
  model="gen4_turbo",
64
65
  prompt_image="https://example.com/assets/bunny.jpg",
66
+ ratio="1280:720",
65
67
  prompt_text="The bunny is eating a carrot",
66
68
  )
67
69
  print(image_to_video.id)
@@ -100,6 +102,7 @@ try:
100
102
  client.image_to_video.create(
101
103
  model="gen4_turbo",
102
104
  prompt_image="https://example.com/assets/bunny.jpg",
105
+ ratio="1280:720",
103
106
  prompt_text="The bunny is eating a carrot",
104
107
  )
105
108
  except runwayml.APIConnectionError as e:
@@ -147,6 +150,7 @@ client = RunwayML(
147
150
  client.with_options(max_retries=5).image_to_video.create(
148
151
  model="gen4_turbo",
149
152
  prompt_image="https://example.com/assets/bunny.jpg",
153
+ ratio="1280:720",
150
154
  prompt_text="The bunny is eating a carrot",
151
155
  )
152
156
  ```
@@ -174,6 +178,7 @@ client = RunwayML(
174
178
  client.with_options(timeout=5.0).image_to_video.create(
175
179
  model="gen4_turbo",
176
180
  prompt_image="https://example.com/assets/bunny.jpg",
181
+ ratio="1280:720",
177
182
  prompt_text="The bunny is eating a carrot",
178
183
  )
179
184
  ```
@@ -219,6 +224,7 @@ client = RunwayML()
219
224
  response = client.image_to_video.with_raw_response.create(
220
225
  model="gen4_turbo",
221
226
  prompt_image="https://example.com/assets/bunny.jpg",
227
+ ratio="1280:720",
222
228
  prompt_text="The bunny is eating a carrot",
223
229
  )
224
230
  print(response.headers.get('X-My-Header'))
@@ -241,6 +247,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
241
247
  with client.image_to_video.with_streaming_response.create(
242
248
  model="gen4_turbo",
243
249
  prompt_image="https://example.com/assets/bunny.jpg",
250
+ ratio="1280:720",
244
251
  prompt_text="The bunny is eating a carrot",
245
252
  ) as response:
246
253
  print(response.headers.get("X-My-Header"))
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "runwayml"
3
- version = "3.0.3"
3
+ version = "3.0.5"
4
4
  description = "The official Python library for the runwayml API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,5 +1,7 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
+ import typing as _t
4
+
3
5
  from . import types
4
6
  from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
5
7
  from ._utils import file_from_path
@@ -78,6 +80,9 @@ __all__ = [
78
80
  "DefaultAsyncHttpxClient",
79
81
  ]
80
82
 
83
+ if not _t.TYPE_CHECKING:
84
+ from ._utils._resources_proxy import resources as resources
85
+
81
86
  _setup_logging()
82
87
 
83
88
  # Update the __module__ attribute for exported symbols so that
@@ -46,7 +46,10 @@ class LazyProxy(Generic[T], ABC):
46
46
  @property # type: ignore
47
47
  @override
48
48
  def __class__(self) -> type: # pyright: ignore
49
- proxied = self.__get_proxied__()
49
+ try:
50
+ proxied = self.__get_proxied__()
51
+ except Exception:
52
+ return type(self)
50
53
  if issubclass(type(proxied), LazyProxy):
51
54
  return type(proxied)
52
55
  return proxied.__class__
@@ -0,0 +1,24 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Any
4
+ from typing_extensions import override
5
+
6
+ from ._proxy import LazyProxy
7
+
8
+
9
+ class ResourcesProxy(LazyProxy[Any]):
10
+ """A proxy for the `runwayml.resources` module.
11
+
12
+ This is used so that we can lazily import `runwayml.resources` only when
13
+ needed *and* so that users can just import `runwayml` and reference `runwayml.resources`
14
+ """
15
+
16
+ @override
17
+ def __load__(self) -> Any:
18
+ import importlib
19
+
20
+ mod = importlib.import_module("runwayml.resources")
21
+ return mod
22
+
23
+
24
+ resources = ResourcesProxy().__as_proxied__()
@@ -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.0.3" # x-release-please-version
4
+ __version__ = "3.0.5" # x-release-please-version
@@ -49,10 +49,9 @@ class ImageToVideoResource(SyncAPIResource):
49
49
  *,
50
50
  model: Literal["gen4_turbo", "gen3a_turbo"],
51
51
  prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
52
+ ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"],
52
53
  duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
53
54
  prompt_text: str | NotGiven = NOT_GIVEN,
54
- ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
55
- | NotGiven = NOT_GIVEN,
56
55
  seed: int | NotGiven = NOT_GIVEN,
57
56
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
58
57
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -71,11 +70,27 @@ class ImageToVideoResource(SyncAPIResource):
71
70
  frame of the generated video. See [our docs](/assets/inputs#images) on image
72
71
  inputs for more information.
73
72
 
74
- duration: The number of seconds of duration for the output video.
73
+ ratio: The resolution of the output video.
74
+
75
+ `gen4_turbo` supports the following values:
76
+
77
+ - `1280:720`
78
+ - `720:1280`
79
+ - `1104:832`
80
+ - `832:1104`
81
+ - `960:960`
82
+ - `1584:672`
83
+
84
+ `gen3a_turbo` supports the following values:
75
85
 
76
- prompt_text
86
+ - `1280:768`
87
+ - `768:1280`
77
88
 
78
- ratio
89
+ duration: The number of seconds of duration for the output video.
90
+
91
+ prompt_text: A non-empty string up to 1000 UTF-16 code points in length (that is,
92
+ `promptText.length === 1000` in JavaScript). This should describe in detail what
93
+ should appear in the output.
79
94
 
80
95
  seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
81
96
  get different results for the same other request parameters. Using the same seed
@@ -95,9 +110,9 @@ class ImageToVideoResource(SyncAPIResource):
95
110
  {
96
111
  "model": model,
97
112
  "prompt_image": prompt_image,
113
+ "ratio": ratio,
98
114
  "duration": duration,
99
115
  "prompt_text": prompt_text,
100
- "ratio": ratio,
101
116
  "seed": seed,
102
117
  },
103
118
  image_to_video_create_params.ImageToVideoCreateParams,
@@ -134,10 +149,9 @@ class AsyncImageToVideoResource(AsyncAPIResource):
134
149
  *,
135
150
  model: Literal["gen4_turbo", "gen3a_turbo"],
136
151
  prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
152
+ ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"],
137
153
  duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
138
154
  prompt_text: str | NotGiven = NOT_GIVEN,
139
- ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
140
- | NotGiven = NOT_GIVEN,
141
155
  seed: int | NotGiven = NOT_GIVEN,
142
156
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
143
157
  # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -156,11 +170,27 @@ class AsyncImageToVideoResource(AsyncAPIResource):
156
170
  frame of the generated video. See [our docs](/assets/inputs#images) on image
157
171
  inputs for more information.
158
172
 
159
- duration: The number of seconds of duration for the output video.
173
+ ratio: The resolution of the output video.
174
+
175
+ `gen4_turbo` supports the following values:
176
+
177
+ - `1280:720`
178
+ - `720:1280`
179
+ - `1104:832`
180
+ - `832:1104`
181
+ - `960:960`
182
+ - `1584:672`
183
+
184
+ `gen3a_turbo` supports the following values:
160
185
 
161
- prompt_text
186
+ - `1280:768`
187
+ - `768:1280`
162
188
 
163
- ratio
189
+ duration: The number of seconds of duration for the output video.
190
+
191
+ prompt_text: A non-empty string up to 1000 UTF-16 code points in length (that is,
192
+ `promptText.length === 1000` in JavaScript). This should describe in detail what
193
+ should appear in the output.
164
194
 
165
195
  seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
166
196
  get different results for the same other request parameters. Using the same seed
@@ -180,9 +210,9 @@ class AsyncImageToVideoResource(AsyncAPIResource):
180
210
  {
181
211
  "model": model,
182
212
  "prompt_image": prompt_image,
213
+ "ratio": ratio,
183
214
  "duration": duration,
184
215
  "prompt_text": prompt_text,
185
- "ratio": ratio,
186
216
  "seed": seed,
187
217
  },
188
218
  image_to_video_create_params.ImageToVideoCreateParams,
@@ -21,12 +21,35 @@ class ImageToVideoCreateParams(TypedDict, total=False):
21
21
  inputs for more information.
22
22
  """
23
23
 
24
+ ratio: Required[
25
+ Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
26
+ ]
27
+ """The resolution of the output video.
28
+
29
+ `gen4_turbo` supports the following values:
30
+
31
+ - `1280:720`
32
+ - `720:1280`
33
+ - `1104:832`
34
+ - `832:1104`
35
+ - `960:960`
36
+ - `1584:672`
37
+
38
+ `gen3a_turbo` supports the following values:
39
+
40
+ - `1280:768`
41
+ - `768:1280`
42
+ """
43
+
24
44
  duration: Literal[5, 10]
25
45
  """The number of seconds of duration for the output video."""
26
46
 
27
47
  prompt_text: Annotated[str, PropertyInfo(alias="promptText")]
28
-
29
- ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
48
+ """
49
+ A non-empty string up to 1000 UTF-16 code points in length (that is,
50
+ `promptText.length === 1000` in JavaScript). This should describe in detail what
51
+ should appear in the output.
52
+ """
30
53
 
31
54
  seed: int
32
55
  """If unspecified, a random number is chosen.
@@ -22,6 +22,7 @@ class TestImageToVideo:
22
22
  image_to_video = client.image_to_video.create(
23
23
  model="gen4_turbo",
24
24
  prompt_image="https://example.com",
25
+ ratio="1280:720",
25
26
  )
26
27
  assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"])
27
28
 
@@ -30,9 +31,9 @@ class TestImageToVideo:
30
31
  image_to_video = client.image_to_video.create(
31
32
  model="gen4_turbo",
32
33
  prompt_image="https://example.com",
34
+ ratio="1280:720",
33
35
  duration=5,
34
36
  prompt_text="promptText",
35
- ratio="1280:720",
36
37
  seed=0,
37
38
  )
38
39
  assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"])
@@ -42,6 +43,7 @@ class TestImageToVideo:
42
43
  response = client.image_to_video.with_raw_response.create(
43
44
  model="gen4_turbo",
44
45
  prompt_image="https://example.com",
46
+ ratio="1280:720",
45
47
  )
46
48
 
47
49
  assert response.is_closed is True
@@ -54,6 +56,7 @@ class TestImageToVideo:
54
56
  with client.image_to_video.with_streaming_response.create(
55
57
  model="gen4_turbo",
56
58
  prompt_image="https://example.com",
59
+ ratio="1280:720",
57
60
  ) as response:
58
61
  assert not response.is_closed
59
62
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -72,6 +75,7 @@ class TestAsyncImageToVideo:
72
75
  image_to_video = await async_client.image_to_video.create(
73
76
  model="gen4_turbo",
74
77
  prompt_image="https://example.com",
78
+ ratio="1280:720",
75
79
  )
76
80
  assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"])
77
81
 
@@ -80,9 +84,9 @@ class TestAsyncImageToVideo:
80
84
  image_to_video = await async_client.image_to_video.create(
81
85
  model="gen4_turbo",
82
86
  prompt_image="https://example.com",
87
+ ratio="1280:720",
83
88
  duration=5,
84
89
  prompt_text="promptText",
85
- ratio="1280:720",
86
90
  seed=0,
87
91
  )
88
92
  assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"])
@@ -92,6 +96,7 @@ class TestAsyncImageToVideo:
92
96
  response = await async_client.image_to_video.with_raw_response.create(
93
97
  model="gen4_turbo",
94
98
  prompt_image="https://example.com",
99
+ ratio="1280:720",
95
100
  )
96
101
 
97
102
  assert response.is_closed is True
@@ -104,6 +109,7 @@ class TestAsyncImageToVideo:
104
109
  async with async_client.image_to_video.with_streaming_response.create(
105
110
  model="gen4_turbo",
106
111
  prompt_image="https://example.com",
112
+ ratio="1280:720",
107
113
  ) as response:
108
114
  assert not response.is_closed
109
115
  assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -725,6 +725,7 @@ class TestRunwayML:
725
725
  dict(
726
726
  model="gen4_turbo",
727
727
  prompt_image="https://example.com/assets/bunny.jpg",
728
+ ratio="1280:720",
728
729
  prompt_text="The bunny is eating a carrot",
729
730
  ),
730
731
  ImageToVideoCreateParams,
@@ -750,6 +751,7 @@ class TestRunwayML:
750
751
  dict(
751
752
  model="gen4_turbo",
752
753
  prompt_image="https://example.com/assets/bunny.jpg",
754
+ ratio="1280:720",
753
755
  prompt_text="The bunny is eating a carrot",
754
756
  ),
755
757
  ImageToVideoCreateParams,
@@ -788,7 +790,7 @@ class TestRunwayML:
788
790
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
789
791
 
790
792
  response = client.image_to_video.with_raw_response.create(
791
- model="gen4_turbo", prompt_image="https://example.com"
793
+ model="gen4_turbo", prompt_image="https://example.com", ratio="1280:720"
792
794
  )
793
795
 
794
796
  assert response.retries_taken == failures_before_success
@@ -814,7 +816,10 @@ class TestRunwayML:
814
816
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
815
817
 
816
818
  response = client.image_to_video.with_raw_response.create(
817
- model="gen4_turbo", prompt_image="https://example.com", extra_headers={"x-stainless-retry-count": Omit()}
819
+ model="gen4_turbo",
820
+ prompt_image="https://example.com",
821
+ ratio="1280:720",
822
+ extra_headers={"x-stainless-retry-count": Omit()},
818
823
  )
819
824
 
820
825
  assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -839,7 +844,10 @@ class TestRunwayML:
839
844
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
840
845
 
841
846
  response = client.image_to_video.with_raw_response.create(
842
- model="gen4_turbo", prompt_image="https://example.com", extra_headers={"x-stainless-retry-count": "42"}
847
+ model="gen4_turbo",
848
+ prompt_image="https://example.com",
849
+ ratio="1280:720",
850
+ extra_headers={"x-stainless-retry-count": "42"},
843
851
  )
844
852
 
845
853
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -1527,6 +1535,7 @@ class TestAsyncRunwayML:
1527
1535
  dict(
1528
1536
  model="gen4_turbo",
1529
1537
  prompt_image="https://example.com/assets/bunny.jpg",
1538
+ ratio="1280:720",
1530
1539
  prompt_text="The bunny is eating a carrot",
1531
1540
  ),
1532
1541
  ImageToVideoCreateParams,
@@ -1552,6 +1561,7 @@ class TestAsyncRunwayML:
1552
1561
  dict(
1553
1562
  model="gen4_turbo",
1554
1563
  prompt_image="https://example.com/assets/bunny.jpg",
1564
+ ratio="1280:720",
1555
1565
  prompt_text="The bunny is eating a carrot",
1556
1566
  ),
1557
1567
  ImageToVideoCreateParams,
@@ -1591,7 +1601,7 @@ class TestAsyncRunwayML:
1591
1601
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
1592
1602
 
1593
1603
  response = await client.image_to_video.with_raw_response.create(
1594
- model="gen4_turbo", prompt_image="https://example.com"
1604
+ model="gen4_turbo", prompt_image="https://example.com", ratio="1280:720"
1595
1605
  )
1596
1606
 
1597
1607
  assert response.retries_taken == failures_before_success
@@ -1618,7 +1628,10 @@ class TestAsyncRunwayML:
1618
1628
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
1619
1629
 
1620
1630
  response = await client.image_to_video.with_raw_response.create(
1621
- model="gen4_turbo", prompt_image="https://example.com", extra_headers={"x-stainless-retry-count": Omit()}
1631
+ model="gen4_turbo",
1632
+ prompt_image="https://example.com",
1633
+ ratio="1280:720",
1634
+ extra_headers={"x-stainless-retry-count": Omit()},
1622
1635
  )
1623
1636
 
1624
1637
  assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
@@ -1644,7 +1657,10 @@ class TestAsyncRunwayML:
1644
1657
  respx_mock.post("/v1/image_to_video").mock(side_effect=retry_handler)
1645
1658
 
1646
1659
  response = await client.image_to_video.with_raw_response.create(
1647
- model="gen4_turbo", prompt_image="https://example.com", extra_headers={"x-stainless-retry-count": "42"}
1660
+ model="gen4_turbo",
1661
+ prompt_image="https://example.com",
1662
+ ratio="1280:720",
1663
+ extra_headers={"x-stainless-retry-count": "42"},
1648
1664
  )
1649
1665
 
1650
1666
  assert response.http_request.headers.get("x-stainless-retry-count") == "42"
@@ -21,3 +21,14 @@ def test_recursive_proxy() -> None:
21
21
  assert dir(proxy) == []
22
22
  assert type(proxy).__name__ == "RecursiveLazyProxy"
23
23
  assert type(operator.attrgetter("name.foo.bar.baz")(proxy)).__name__ == "RecursiveLazyProxy"
24
+
25
+
26
+ def test_isinstance_does_not_error() -> None:
27
+ class AlwaysErrorProxy(LazyProxy[Any]):
28
+ @override
29
+ def __load__(self) -> Any:
30
+ raise RuntimeError("Mocking missing dependency")
31
+
32
+ proxy = AlwaysErrorProxy()
33
+ assert not isinstance(proxy, dict)
34
+ assert isinstance(proxy, LazyProxy)
@@ -1,3 +0,0 @@
1
- {
2
- ".": "3.0.3"
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
File without changes
File without changes