runwayml 2.3.8__py3-none-any.whl → 3.0.1__py3-none-any.whl

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.
runwayml/_base_client.py CHANGED
@@ -409,7 +409,8 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
409
409
 
410
410
  idempotency_header = self._idempotency_header
411
411
  if idempotency_header and options.method.lower() != "get" and idempotency_header not in headers:
412
- headers[idempotency_header] = options.idempotency_key or self._idempotency_key()
412
+ options.idempotency_key = options.idempotency_key or self._idempotency_key()
413
+ headers[idempotency_header] = options.idempotency_key
413
414
 
414
415
  # Don't set these headers if they were already set or removed by the caller. We check
415
416
  # `custom_headers`, which can contain `Omit()`, instead of `headers` to account for the removal case.
@@ -943,6 +944,10 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
943
944
  request = self._build_request(options, retries_taken=retries_taken)
944
945
  self._prepare_request(request)
945
946
 
947
+ if options.idempotency_key:
948
+ # ensure the idempotency key is reused between requests
949
+ input_options.idempotency_key = options.idempotency_key
950
+
946
951
  kwargs: HttpxSendArgs = {}
947
952
  if self.custom_auth is not None:
948
953
  kwargs["auth"] = self.custom_auth
@@ -1475,6 +1480,10 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1475
1480
  request = self._build_request(options, retries_taken=retries_taken)
1476
1481
  await self._prepare_request(request)
1477
1482
 
1483
+ if options.idempotency_key:
1484
+ # ensure the idempotency key is reused between requests
1485
+ input_options.idempotency_key = options.idempotency_key
1486
+
1478
1487
  kwargs: HttpxSendArgs = {}
1479
1488
  if self.custom_auth is not None:
1480
1489
  kwargs["auth"] = self.custom_auth
runwayml/_client.py CHANGED
@@ -24,7 +24,7 @@ from ._utils import (
24
24
  get_async_library,
25
25
  )
26
26
  from ._version import __version__
27
- from .resources import tasks, image_to_video
27
+ from .resources import tasks, organization, image_to_video
28
28
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
29
29
  from ._exceptions import RunwayMLError, APIStatusError
30
30
  from ._base_client import (
@@ -48,6 +48,7 @@ __all__ = [
48
48
  class RunwayML(SyncAPIClient):
49
49
  tasks: tasks.TasksResource
50
50
  image_to_video: image_to_video.ImageToVideoResource
51
+ organization: organization.OrganizationResource
51
52
  with_raw_response: RunwayMLWithRawResponse
52
53
  with_streaming_response: RunwayMLWithStreamedResponse
53
54
 
@@ -113,6 +114,7 @@ class RunwayML(SyncAPIClient):
113
114
 
114
115
  self.tasks = tasks.TasksResource(self)
115
116
  self.image_to_video = image_to_video.ImageToVideoResource(self)
117
+ self.organization = organization.OrganizationResource(self)
116
118
  self.with_raw_response = RunwayMLWithRawResponse(self)
117
119
  self.with_streaming_response = RunwayMLWithStreamedResponse(self)
118
120
 
@@ -227,6 +229,7 @@ class RunwayML(SyncAPIClient):
227
229
  class AsyncRunwayML(AsyncAPIClient):
228
230
  tasks: tasks.AsyncTasksResource
229
231
  image_to_video: image_to_video.AsyncImageToVideoResource
232
+ organization: organization.AsyncOrganizationResource
230
233
  with_raw_response: AsyncRunwayMLWithRawResponse
231
234
  with_streaming_response: AsyncRunwayMLWithStreamedResponse
232
235
 
@@ -292,6 +295,7 @@ class AsyncRunwayML(AsyncAPIClient):
292
295
 
293
296
  self.tasks = tasks.AsyncTasksResource(self)
294
297
  self.image_to_video = image_to_video.AsyncImageToVideoResource(self)
298
+ self.organization = organization.AsyncOrganizationResource(self)
295
299
  self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
296
300
  self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)
297
301
 
@@ -407,24 +411,28 @@ class RunwayMLWithRawResponse:
407
411
  def __init__(self, client: RunwayML) -> None:
408
412
  self.tasks = tasks.TasksResourceWithRawResponse(client.tasks)
409
413
  self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
414
+ self.organization = organization.OrganizationResourceWithRawResponse(client.organization)
410
415
 
411
416
 
412
417
  class AsyncRunwayMLWithRawResponse:
413
418
  def __init__(self, client: AsyncRunwayML) -> None:
414
419
  self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks)
415
420
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
421
+ self.organization = organization.AsyncOrganizationResourceWithRawResponse(client.organization)
416
422
 
417
423
 
418
424
  class RunwayMLWithStreamedResponse:
419
425
  def __init__(self, client: RunwayML) -> None:
420
426
  self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks)
421
427
  self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
428
+ self.organization = organization.OrganizationResourceWithStreamingResponse(client.organization)
422
429
 
423
430
 
424
431
  class AsyncRunwayMLWithStreamedResponse:
425
432
  def __init__(self, client: AsyncRunwayML) -> None:
426
433
  self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks)
427
434
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
435
+ self.organization = organization.AsyncOrganizationResourceWithStreamingResponse(client.organization)
428
436
 
429
437
 
430
438
  Client = RunwayML
@@ -5,13 +5,15 @@ import base64
5
5
  import pathlib
6
6
  from typing import Any, Mapping, TypeVar, cast
7
7
  from datetime import date, datetime
8
- from typing_extensions import Literal, get_args, override, get_type_hints
8
+ from typing_extensions import Literal, get_args, override, get_type_hints as _get_type_hints
9
9
 
10
10
  import anyio
11
11
  import pydantic
12
12
 
13
13
  from ._utils import (
14
14
  is_list,
15
+ is_given,
16
+ lru_cache,
15
17
  is_mapping,
16
18
  is_iterable,
17
19
  )
@@ -108,6 +110,7 @@ def transform(
108
110
  return cast(_T, transformed)
109
111
 
110
112
 
113
+ @lru_cache(maxsize=8096)
111
114
  def _get_annotated_type(type_: type) -> type | None:
112
115
  """If the given type is an `Annotated` type then it is returned, if not `None` is returned.
113
116
 
@@ -142,6 +145,10 @@ def _maybe_transform_key(key: str, type_: type) -> str:
142
145
  return key
143
146
 
144
147
 
148
+ def _no_transform_needed(annotation: type) -> bool:
149
+ return annotation == float or annotation == int
150
+
151
+
145
152
  def _transform_recursive(
146
153
  data: object,
147
154
  *,
@@ -184,6 +191,15 @@ def _transform_recursive(
184
191
  return cast(object, data)
185
192
 
186
193
  inner_type = extract_type_arg(stripped_type, 0)
194
+ if _no_transform_needed(inner_type):
195
+ # for some types there is no need to transform anything, so we can get a small
196
+ # perf boost from skipping that work.
197
+ #
198
+ # but we still need to convert to a list to ensure the data is json-serializable
199
+ if is_list(data):
200
+ return data
201
+ return list(data)
202
+
187
203
  return [_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
188
204
 
189
205
  if is_union_type(stripped_type):
@@ -245,6 +261,11 @@ def _transform_typeddict(
245
261
  result: dict[str, object] = {}
246
262
  annotations = get_type_hints(expected_type, include_extras=True)
247
263
  for key, value in data.items():
264
+ if not is_given(value):
265
+ # we don't need to include `NotGiven` values here as they'll
266
+ # be stripped out before the request is sent anyway
267
+ continue
268
+
248
269
  type_ = annotations.get(key)
249
270
  if type_ is None:
250
271
  # we do not have a type annotation for this field, leave it as is
@@ -332,6 +353,15 @@ async def _async_transform_recursive(
332
353
  return cast(object, data)
333
354
 
334
355
  inner_type = extract_type_arg(stripped_type, 0)
356
+ if _no_transform_needed(inner_type):
357
+ # for some types there is no need to transform anything, so we can get a small
358
+ # perf boost from skipping that work.
359
+ #
360
+ # but we still need to convert to a list to ensure the data is json-serializable
361
+ if is_list(data):
362
+ return data
363
+ return list(data)
364
+
335
365
  return [await _async_transform_recursive(d, annotation=annotation, inner_type=inner_type) for d in data]
336
366
 
337
367
  if is_union_type(stripped_type):
@@ -393,6 +423,11 @@ async def _async_transform_typeddict(
393
423
  result: dict[str, object] = {}
394
424
  annotations = get_type_hints(expected_type, include_extras=True)
395
425
  for key, value in data.items():
426
+ if not is_given(value):
427
+ # we don't need to include `NotGiven` values here as they'll
428
+ # be stripped out before the request is sent anyway
429
+ continue
430
+
396
431
  type_ = annotations.get(key)
397
432
  if type_ is None:
398
433
  # we do not have a type annotation for this field, leave it as is
@@ -400,3 +435,13 @@ async def _async_transform_typeddict(
400
435
  else:
401
436
  result[_maybe_transform_key(key, type_)] = await _async_transform_recursive(value, annotation=type_)
402
437
  return result
438
+
439
+
440
+ @lru_cache(maxsize=8096)
441
+ def get_type_hints(
442
+ obj: Any,
443
+ globalns: dict[str, Any] | None = None,
444
+ localns: Mapping[str, Any] | None = None,
445
+ include_extras: bool = False,
446
+ ) -> dict[str, Any]:
447
+ return _get_type_hints(obj, globalns=globalns, localns=localns, include_extras=include_extras)
@@ -13,6 +13,7 @@ from typing_extensions import (
13
13
  get_origin,
14
14
  )
15
15
 
16
+ from ._utils import lru_cache
16
17
  from .._types import InheritsGeneric
17
18
  from .._compat import is_union as _is_union
18
19
 
@@ -66,6 +67,7 @@ def is_type_alias_type(tp: Any, /) -> TypeIs[typing_extensions.TypeAliasType]:
66
67
 
67
68
 
68
69
  # Extracts T from Annotated[T, ...] or from Required[Annotated[T, ...]]
70
+ @lru_cache(maxsize=8096)
69
71
  def strip_annotated_type(typ: type) -> type:
70
72
  if is_required_type(typ) or is_annotated_type(typ):
71
73
  return strip_annotated_type(cast(type, get_args(typ)[0]))
runwayml/_version.py CHANGED
@@ -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__ = "2.3.8" # x-release-please-version
4
+ __version__ = "3.0.1" # x-release-please-version
@@ -8,6 +8,14 @@ from .tasks import (
8
8
  TasksResourceWithStreamingResponse,
9
9
  AsyncTasksResourceWithStreamingResponse,
10
10
  )
11
+ from .organization import (
12
+ OrganizationResource,
13
+ AsyncOrganizationResource,
14
+ OrganizationResourceWithRawResponse,
15
+ AsyncOrganizationResourceWithRawResponse,
16
+ OrganizationResourceWithStreamingResponse,
17
+ AsyncOrganizationResourceWithStreamingResponse,
18
+ )
11
19
  from .image_to_video import (
12
20
  ImageToVideoResource,
13
21
  AsyncImageToVideoResource,
@@ -30,4 +38,10 @@ __all__ = [
30
38
  "AsyncImageToVideoResourceWithRawResponse",
31
39
  "ImageToVideoResourceWithStreamingResponse",
32
40
  "AsyncImageToVideoResourceWithStreamingResponse",
41
+ "OrganizationResource",
42
+ "AsyncOrganizationResource",
43
+ "OrganizationResourceWithRawResponse",
44
+ "AsyncOrganizationResourceWithRawResponse",
45
+ "OrganizationResourceWithStreamingResponse",
46
+ "AsyncOrganizationResourceWithStreamingResponse",
33
47
  ]
@@ -50,13 +50,13 @@ class ImageToVideoResource(SyncAPIResource):
50
50
  def create(
51
51
  self,
52
52
  *,
53
- model: Literal["gen3a_turbo"],
53
+ model: Literal["gen4_turbo", "gen3a_turbo"],
54
54
  prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
55
55
  duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
56
56
  prompt_text: str | NotGiven = NOT_GIVEN,
57
- ratio: Literal["1280:768", "768:1280"] | NotGiven = NOT_GIVEN,
57
+ ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
58
+ | NotGiven = NOT_GIVEN,
58
59
  seed: int | NotGiven = NOT_GIVEN,
59
- watermark: bool | NotGiven = NOT_GIVEN,
60
60
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
61
61
  # The extra values given here take precedence over values defined on the client or passed to this method.
62
62
  extra_headers: Headers | None = None,
@@ -84,9 +84,6 @@ class ImageToVideoResource(SyncAPIResource):
84
84
  get different results for the same other request parameters. Using the same seed
85
85
  integer for an identical request will produce similar results.
86
86
 
87
- watermark: A boolean indicating whether or not the output video will contain a Runway
88
- watermark.
89
-
90
87
  extra_headers: Send extra headers
91
88
 
92
89
  extra_query: Add additional query parameters to the request
@@ -105,7 +102,6 @@ class ImageToVideoResource(SyncAPIResource):
105
102
  "prompt_text": prompt_text,
106
103
  "ratio": ratio,
107
104
  "seed": seed,
108
- "watermark": watermark,
109
105
  },
110
106
  image_to_video_create_params.ImageToVideoCreateParams,
111
107
  ),
@@ -139,13 +135,13 @@ class AsyncImageToVideoResource(AsyncAPIResource):
139
135
  async def create(
140
136
  self,
141
137
  *,
142
- model: Literal["gen3a_turbo"],
138
+ model: Literal["gen4_turbo", "gen3a_turbo"],
143
139
  prompt_image: Union[str, Iterable[image_to_video_create_params.PromptImagePromptImage]],
144
140
  duration: Literal[5, 10] | NotGiven = NOT_GIVEN,
145
141
  prompt_text: str | NotGiven = NOT_GIVEN,
146
- ratio: Literal["1280:768", "768:1280"] | NotGiven = NOT_GIVEN,
142
+ ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
143
+ | NotGiven = NOT_GIVEN,
147
144
  seed: int | NotGiven = NOT_GIVEN,
148
- watermark: bool | NotGiven = NOT_GIVEN,
149
145
  # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
150
146
  # The extra values given here take precedence over values defined on the client or passed to this method.
151
147
  extra_headers: Headers | None = None,
@@ -173,9 +169,6 @@ class AsyncImageToVideoResource(AsyncAPIResource):
173
169
  get different results for the same other request parameters. Using the same seed
174
170
  integer for an identical request will produce similar results.
175
171
 
176
- watermark: A boolean indicating whether or not the output video will contain a Runway
177
- watermark.
178
-
179
172
  extra_headers: Send extra headers
180
173
 
181
174
  extra_query: Add additional query parameters to the request
@@ -194,7 +187,6 @@ class AsyncImageToVideoResource(AsyncAPIResource):
194
187
  "prompt_text": prompt_text,
195
188
  "ratio": ratio,
196
189
  "seed": seed,
197
- "watermark": watermark,
198
190
  },
199
191
  image_to_video_create_params.ImageToVideoCreateParams,
200
192
  ),
@@ -0,0 +1,141 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+ from ..types.organization_retrieve_response import OrganizationRetrieveResponse
18
+
19
+ __all__ = ["OrganizationResource", "AsyncOrganizationResource"]
20
+
21
+
22
+ class OrganizationResource(SyncAPIResource):
23
+ @cached_property
24
+ def with_raw_response(self) -> OrganizationResourceWithRawResponse:
25
+ """
26
+ This property can be used as a prefix for any HTTP method call to return
27
+ the raw response object instead of the parsed content.
28
+
29
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
30
+ """
31
+ return OrganizationResourceWithRawResponse(self)
32
+
33
+ @cached_property
34
+ def with_streaming_response(self) -> OrganizationResourceWithStreamingResponse:
35
+ """
36
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
+
38
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
39
+ """
40
+ return OrganizationResourceWithStreamingResponse(self)
41
+
42
+ def retrieve(
43
+ self,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ ) -> OrganizationRetrieveResponse:
52
+ """
53
+ Get usage tier and credit balance information about the organization associated
54
+ with the API key used to make the request.
55
+ """
56
+ return self._get(
57
+ "/v1/organization",
58
+ options=make_request_options(
59
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
60
+ ),
61
+ cast_to=OrganizationRetrieveResponse,
62
+ )
63
+
64
+
65
+ class AsyncOrganizationResource(AsyncAPIResource):
66
+ @cached_property
67
+ def with_raw_response(self) -> AsyncOrganizationResourceWithRawResponse:
68
+ """
69
+ This property can be used as a prefix for any HTTP method call to return
70
+ the raw response object instead of the parsed content.
71
+
72
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
73
+ """
74
+ return AsyncOrganizationResourceWithRawResponse(self)
75
+
76
+ @cached_property
77
+ def with_streaming_response(self) -> AsyncOrganizationResourceWithStreamingResponse:
78
+ """
79
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
80
+
81
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
82
+ """
83
+ return AsyncOrganizationResourceWithStreamingResponse(self)
84
+
85
+ async def retrieve(
86
+ self,
87
+ *,
88
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
89
+ # The extra values given here take precedence over values defined on the client or passed to this method.
90
+ extra_headers: Headers | None = None,
91
+ extra_query: Query | None = None,
92
+ extra_body: Body | None = None,
93
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
94
+ ) -> OrganizationRetrieveResponse:
95
+ """
96
+ Get usage tier and credit balance information about the organization associated
97
+ with the API key used to make the request.
98
+ """
99
+ return await self._get(
100
+ "/v1/organization",
101
+ options=make_request_options(
102
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
103
+ ),
104
+ cast_to=OrganizationRetrieveResponse,
105
+ )
106
+
107
+
108
+ class OrganizationResourceWithRawResponse:
109
+ def __init__(self, organization: OrganizationResource) -> None:
110
+ self._organization = organization
111
+
112
+ self.retrieve = to_raw_response_wrapper(
113
+ organization.retrieve,
114
+ )
115
+
116
+
117
+ class AsyncOrganizationResourceWithRawResponse:
118
+ def __init__(self, organization: AsyncOrganizationResource) -> None:
119
+ self._organization = organization
120
+
121
+ self.retrieve = async_to_raw_response_wrapper(
122
+ organization.retrieve,
123
+ )
124
+
125
+
126
+ class OrganizationResourceWithStreamingResponse:
127
+ def __init__(self, organization: OrganizationResource) -> None:
128
+ self._organization = organization
129
+
130
+ self.retrieve = to_streamed_response_wrapper(
131
+ organization.retrieve,
132
+ )
133
+
134
+
135
+ class AsyncOrganizationResourceWithStreamingResponse:
136
+ def __init__(self, organization: AsyncOrganizationResource) -> None:
137
+ self._organization = organization
138
+
139
+ self.retrieve = async_to_streamed_response_wrapper(
140
+ organization.retrieve,
141
+ )
@@ -5,3 +5,4 @@ from __future__ import annotations
5
5
  from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse
6
6
  from .image_to_video_create_params import ImageToVideoCreateParams as ImageToVideoCreateParams
7
7
  from .image_to_video_create_response import ImageToVideoCreateResponse as ImageToVideoCreateResponse
8
+ from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse
@@ -11,7 +11,7 @@ __all__ = ["ImageToVideoCreateParams", "PromptImagePromptImage"]
11
11
 
12
12
 
13
13
  class ImageToVideoCreateParams(TypedDict, total=False):
14
- model: Required[Literal["gen3a_turbo"]]
14
+ model: Required[Literal["gen4_turbo", "gen3a_turbo"]]
15
15
  """The model variant to use."""
16
16
 
17
17
  prompt_image: Required[Annotated[Union[str, Iterable[PromptImagePromptImage]], PropertyInfo(alias="promptImage")]]
@@ -26,7 +26,7 @@ class ImageToVideoCreateParams(TypedDict, total=False):
26
26
 
27
27
  prompt_text: Annotated[str, PropertyInfo(alias="promptText")]
28
28
 
29
- ratio: Literal["1280:768", "768:1280"]
29
+ ratio: Literal["1280:720", "720:1280", "1104:832", "832:1104", "960:960", "1584:672", "1280:768", "768:1280"]
30
30
 
31
31
  seed: int
32
32
  """If unspecified, a random number is chosen.
@@ -36,12 +36,6 @@ class ImageToVideoCreateParams(TypedDict, total=False):
36
36
  produce similar results.
37
37
  """
38
38
 
39
- watermark: bool
40
- """
41
- A boolean indicating whether or not the output video will contain a Runway
42
- watermark.
43
- """
44
-
45
39
 
46
40
  class PromptImagePromptImage(TypedDict, total=False):
47
41
  position: Required[Literal["first", "last"]]
@@ -49,6 +43,8 @@ class PromptImagePromptImage(TypedDict, total=False):
49
43
 
50
44
  "first" will use the image as the first frame of the video, "last" will use the
51
45
  image as the last frame of the video.
46
+
47
+ "last" is currently supported for `gen3a_turbo` only.
52
48
  """
53
49
 
54
50
  uri: Required[str]
@@ -0,0 +1,85 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+
5
+ from pydantic import Field as FieldInfo
6
+
7
+ from .._models import BaseModel
8
+
9
+ __all__ = [
10
+ "OrganizationRetrieveResponse",
11
+ "Tier",
12
+ "TierModels",
13
+ "TierModelsGen3aTurbo",
14
+ "TierModelsGen4Turbo",
15
+ "Usage",
16
+ "UsageModels",
17
+ "UsageModelsGen3aTurbo",
18
+ "UsageModelsGen4Turbo",
19
+ ]
20
+
21
+
22
+ class TierModelsGen3aTurbo(BaseModel):
23
+ max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
24
+ """The maximum number of generations that can be run concurrently for this model."""
25
+
26
+ max_daily_generations: int = FieldInfo(alias="maxDailyGenerations")
27
+ """The maximum number of generations that can be created each day for this model."""
28
+
29
+
30
+ class TierModelsGen4Turbo(BaseModel):
31
+ max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
32
+ """The maximum number of generations that can be run concurrently for this model."""
33
+
34
+ max_daily_generations: int = FieldInfo(alias="maxDailyGenerations")
35
+ """The maximum number of generations that can be created each day for this model."""
36
+
37
+
38
+ class TierModels(BaseModel):
39
+ gen3a_turbo: Optional[TierModelsGen3aTurbo] = None
40
+ """Limits associated with the gen3a_turbo model."""
41
+
42
+ gen4_turbo: Optional[TierModelsGen4Turbo] = None
43
+ """Limits associated with the gen4_turbo model."""
44
+
45
+
46
+ class Tier(BaseModel):
47
+ max_monthly_credit_spend: int = FieldInfo(alias="maxMonthlyCreditSpend")
48
+ """The maximum number of credits that can be purchased in a month."""
49
+
50
+ models: TierModels
51
+ """An object containing model-specific limits. Each key represents a model."""
52
+
53
+
54
+ class UsageModelsGen3aTurbo(BaseModel):
55
+ daily_generations: int = FieldInfo(alias="dailyGenerations")
56
+ """The number of generations that have been run for this model in the past day."""
57
+
58
+
59
+ class UsageModelsGen4Turbo(BaseModel):
60
+ daily_generations: int = FieldInfo(alias="dailyGenerations")
61
+ """The number of generations that have been run for this model in the past day."""
62
+
63
+
64
+ class UsageModels(BaseModel):
65
+ gen3a_turbo: Optional[UsageModelsGen3aTurbo] = None
66
+ """Usage data for the gen3a_turbo model."""
67
+
68
+ gen4_turbo: Optional[UsageModelsGen4Turbo] = None
69
+ """Usage data for the gen4_turbo model."""
70
+
71
+
72
+ class Usage(BaseModel):
73
+ models: UsageModels
74
+ """Usage data for each model."""
75
+
76
+
77
+ class OrganizationRetrieveResponse(BaseModel):
78
+ credit_balance: int = FieldInfo(alias="creditBalance")
79
+ """The number of credits remaining in the organization account."""
80
+
81
+ tier: Tier
82
+ """Limits associated with the organization's tier."""
83
+
84
+ usage: Usage
85
+ """Usage data for the organization."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 2.3.8
3
+ Version: 3.0.1
4
4
  Summary: The official Python library for the runwayml API
5
5
  Project-URL: Homepage, https://github.com/runwayml/sdk-python
6
6
  Project-URL: Repository, https://github.com/runwayml/sdk-python
@@ -63,7 +63,7 @@ client = RunwayML(
63
63
  )
64
64
 
65
65
  image_to_video = client.image_to_video.create(
66
- model="gen3a_turbo",
66
+ model="gen4_turbo",
67
67
  prompt_image="https://example.com/assets/bunny.jpg",
68
68
  prompt_text="The bunny is eating a carrot",
69
69
  )
@@ -91,7 +91,7 @@ client = AsyncRunwayML(
91
91
 
92
92
  async def main() -> None:
93
93
  image_to_video = await client.image_to_video.create(
94
- model="gen3a_turbo",
94
+ model="gen4_turbo",
95
95
  prompt_image="https://example.com/assets/bunny.jpg",
96
96
  prompt_text="The bunny is eating a carrot",
97
97
  )
@@ -129,7 +129,7 @@ client = RunwayML()
129
129
 
130
130
  try:
131
131
  client.image_to_video.create(
132
- model="gen3a_turbo",
132
+ model="gen4_turbo",
133
133
  prompt_image="https://example.com/assets/bunny.jpg",
134
134
  prompt_text="The bunny is eating a carrot",
135
135
  )
@@ -176,7 +176,7 @@ client = RunwayML(
176
176
 
177
177
  # Or, configure per-request:
178
178
  client.with_options(max_retries=5).image_to_video.create(
179
- model="gen3a_turbo",
179
+ model="gen4_turbo",
180
180
  prompt_image="https://example.com/assets/bunny.jpg",
181
181
  prompt_text="The bunny is eating a carrot",
182
182
  )
@@ -203,7 +203,7 @@ client = RunwayML(
203
203
 
204
204
  # Override per-request:
205
205
  client.with_options(timeout=5.0).image_to_video.create(
206
- model="gen3a_turbo",
206
+ model="gen4_turbo",
207
207
  prompt_image="https://example.com/assets/bunny.jpg",
208
208
  prompt_text="The bunny is eating a carrot",
209
209
  )
@@ -248,7 +248,7 @@ from runwayml import RunwayML
248
248
 
249
249
  client = RunwayML()
250
250
  response = client.image_to_video.with_raw_response.create(
251
- model="gen3a_turbo",
251
+ model="gen4_turbo",
252
252
  prompt_image="https://example.com/assets/bunny.jpg",
253
253
  prompt_text="The bunny is eating a carrot",
254
254
  )
@@ -270,7 +270,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi
270
270
 
271
271
  ```python
272
272
  with client.image_to_video.with_streaming_response.create(
273
- model="gen3a_turbo",
273
+ model="gen4_turbo",
274
274
  prompt_image="https://example.com/assets/bunny.jpg",
275
275
  prompt_text="The bunny is eating a carrot",
276
276
  ) as response:
@@ -1,6 +1,6 @@
1
1
  runwayml/__init__.py,sha256=iXnJfH73wbj9IxfCHpwfWBxgOa9C4FRrrbBZM5f3biw,2476
2
- runwayml/_base_client.py,sha256=qT2Gv0eeU7rPXdd6I4Kf64KGe8oUm5qsthI-khYDBCA,64959
3
- runwayml/_client.py,sha256=aWjUYIDY3AgOnzaN9KPCIRjGwCzdMn2WTQfSr8_UEk4,16458
2
+ runwayml/_base_client.py,sha256=BY_2p5vumkAeyhc7M3PjWeX9IlxfaDu1HIOSPDmT4X0,65367
3
+ runwayml/_client.py,sha256=oUOh2gdY1YtVefv51GTssitaCuDQIncvVlxTvzDJyec,17136
4
4
  runwayml/_compat.py,sha256=VWemUKbj6DDkQ-O4baSpHVLJafotzeXmCQGJugfVTIw,6580
5
5
  runwayml/_constants.py,sha256=S14PFzyN9-I31wiV7SmIlL5Ga0MLHxdvegInGdXH7tM,462
6
6
  runwayml/_exceptions.py,sha256=p2Q8kywHCVQzArLQL4Ht-HetTBhAvevU6yDvEq7PpIE,3224
@@ -11,7 +11,7 @@ runwayml/_resource.py,sha256=BF-j3xY5eRTKmuTxg8eDhLtLP4MLB1phDh_B6BKipKA,1112
11
11
  runwayml/_response.py,sha256=3Tf7pmDYDMv5BJuF0ljEBtMMk5Q9T7jcWn7I6P-hbdM,28801
12
12
  runwayml/_streaming.py,sha256=NSVuAgknVQWU1cgZEjQn01IdZKKynb5rOeYp5Lo-OEQ,10108
13
13
  runwayml/_types.py,sha256=oHct1QQY_lI8bepCgfWDZm2N5VNi0e6o1iLeiTh4Y_0,6145
14
- runwayml/_version.py,sha256=Pip9VJv7VwYi0_MbBEozFP8Abb1frwm7NBd74DOhdyY,160
14
+ runwayml/_version.py,sha256=CPiXNPVxUqxftw-dZ-WnMk2SLbX6jS2ERS5um080dS8,160
15
15
  runwayml/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  runwayml/_utils/__init__.py,sha256=PNZ_QJuzZEgyYXqkO1HVhGkj5IU9bglVUcw7H-Knjzw,2062
17
17
  runwayml/_utils/_logs.py,sha256=ZfS5W59hdqEBVV86lNrk28PhvUxtHOzs9JqiLhSu0pI,780
@@ -19,18 +19,20 @@ runwayml/_utils/_proxy.py,sha256=z3zsateHtb0EARTWKk8QZNHfPkqJbqwd1lM993LBwGE,190
19
19
  runwayml/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
20
20
  runwayml/_utils/_streams.py,sha256=SMC90diFFecpEg_zgDRVbdR3hSEIgVVij4taD-noMLM,289
21
21
  runwayml/_utils/_sync.py,sha256=TpGLrrhRNWTJtODNE6Fup3_k7zrWm1j2RlirzBwre-0,2862
22
- runwayml/_utils/_transform.py,sha256=asrbdx4Pf5NupzaB8QdEjypW_DgHjjkpswHT0Jum4S0,13987
23
- runwayml/_utils/_typing.py,sha256=nTJz0jcrQbEgxwy4TtAkNxuU0QHHlmc6mQtA6vIR8tg,4501
22
+ runwayml/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88,15617
23
+ runwayml/_utils/_typing.py,sha256=nOFiIH5faG-h5Ha-Ky2aZxw5kmR6iX8KzNtsn3JEWoA,4556
24
24
  runwayml/_utils/_utils.py,sha256=8UmbPOy_AAr2uUjjFui-VZSrVBHRj6bfNEKRp5YZP2A,12004
25
25
  runwayml/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
26
- runwayml/resources/__init__.py,sha256=O-ZVFaODsGXK0pKVlV4HKoeJyq3p9sK_9COJTv7P1WM,1069
27
- runwayml/resources/image_to_video.py,sha256=nFtSEAMAyIlLrWNX9o_HneXfaoHQq2cunv8I0ntglQA,9383
26
+ runwayml/resources/__init__.py,sha256=SqcC1MLwxPaz2c7gRRBlOn9-2pDPMKTXD2gFbG5FJ2E,1597
27
+ runwayml/resources/image_to_video.py,sha256=A0nOe7KwLcJ_UiqHLk6Gm_h2iWbr7V37a3B7m1mBOxc,9141
28
+ runwayml/resources/organization.py,sha256=XBg5nhkycPU3rllRvf9aaeHuZNtzGDKHlLPrPqDCAsw,5419
28
29
  runwayml/resources/tasks.py,sha256=-VT3qetYcaqn4FskekxhN_fCTozMl1GqxGpGwxV8M60,9673
29
- runwayml/types/__init__.py,sha256=R3cLEXzpcEpEOuxaFBo3R72ewH1LtjpkZ0aYOIt1CAo,400
30
- runwayml/types/image_to_video_create_params.py,sha256=98DsjOHnmHEi8mVjZOQEDL3P1hJUT8uktp0mDA5WJ5Y,1869
30
+ runwayml/types/__init__.py,sha256=xfq4RirwNpSBy5xXra7CB8wa0029vKUH0DB6Zg02hFs,505
31
+ runwayml/types/image_to_video_create_params.py,sha256=VNWGDEdqkhp-Br-19t8YYfaYMaXxHEmADwXZ1CUC4So,1882
31
32
  runwayml/types/image_to_video_create_response.py,sha256=l5GszzUSItV-ZYHCB8hH_GSVibUZEkzfRLrAhXkd8O4,346
33
+ runwayml/types/organization_retrieve_response.py,sha256=DV46yEIRjmL05uISc2-PpM5BGWu8gniA9TQ056abWLA,2721
32
34
  runwayml/types/task_retrieve_response.py,sha256=v8y2bLxsW6srzScW-B3Akv72q_PI_NQmduGrGRQMHds,2139
33
- runwayml-2.3.8.dist-info/METADATA,sha256=LhPCc8gzToh3algpvlkZFjp1FOnLhi2Q5RLXYzQ0w-s,13523
34
- runwayml-2.3.8.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
35
- runwayml-2.3.8.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
36
- runwayml-2.3.8.dist-info/RECORD,,
35
+ runwayml-3.0.1.dist-info/METADATA,sha256=1fj9_9szjNroqdi0Dsw0HuaswObIWDdLx8Avngy3trI,13516
36
+ runwayml-3.0.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
37
+ runwayml-3.0.1.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
38
+ runwayml-3.0.1.dist-info/RECORD,,