runwayml 3.6.5__py3-none-any.whl → 3.7.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/_client.py CHANGED
@@ -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
 
runwayml/_models.py CHANGED
@@ -439,7 +439,7 @@ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]
439
439
  type_ = type_.__value__ # type: ignore[unreachable]
440
440
 
441
441
  # unwrap `Annotated[T, ...]` -> `T`
442
- if metadata is not None:
442
+ if metadata is not None and len(metadata) > 0:
443
443
  meta: tuple[Any, ...] = tuple(metadata)
444
444
  elif is_annotated_type(type_):
445
445
  meta = get_args(type_)[1:]
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__ = "3.6.5" # x-release-please-version
4
+ __version__ = "3.7.1" # 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
+ )
@@ -2,9 +2,14 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
+ from typing import Union
6
+ from datetime import date
7
+
5
8
  import httpx
6
9
 
10
+ from ..types import organization_retrieve_usage_params
7
11
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from .._utils import maybe_transform, async_maybe_transform
8
13
  from .._compat import cached_property
9
14
  from .._resource import SyncAPIResource, AsyncAPIResource
10
15
  from .._response import (
@@ -15,6 +20,7 @@ from .._response import (
15
20
  )
16
21
  from .._base_client import make_request_options
17
22
  from ..types.organization_retrieve_response import OrganizationRetrieveResponse
23
+ from ..types.organization_retrieve_usage_response import OrganizationRetrieveUsageResponse
18
24
 
19
25
  __all__ = ["OrganizationResource", "AsyncOrganizationResource"]
20
26
 
@@ -61,6 +67,55 @@ class OrganizationResource(SyncAPIResource):
61
67
  cast_to=OrganizationRetrieveResponse,
62
68
  )
63
69
 
70
+ def retrieve_usage(
71
+ self,
72
+ *,
73
+ before_date: Union[str, date] | NotGiven = NOT_GIVEN,
74
+ start_date: Union[str, date] | NotGiven = NOT_GIVEN,
75
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
76
+ # The extra values given here take precedence over values defined on the client or passed to this method.
77
+ extra_headers: Headers | None = None,
78
+ extra_query: Query | None = None,
79
+ extra_body: Body | None = None,
80
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
81
+ ) -> OrganizationRetrieveUsageResponse:
82
+ """
83
+ Fetch credit usage data broken down by model and day for the organization
84
+ associated with the API key used to make the request. Up to 90 days of data can
85
+ be queried at a time.
86
+
87
+ Args:
88
+ before_date: The end date of the usage data in ISO-8601 format (YYYY-MM-DD), not inclusive.
89
+ If unspecified, it will default to thirty days after the start date. Must be
90
+ less than or equal to 90 days after the start date. All dates are in UTC.
91
+
92
+ start_date: The start date of the usage data in ISO-8601 format (YYYY-MM-DD). If
93
+ unspecified, it will default to 30 days before the current date. All dates are
94
+ in UTC.
95
+
96
+ extra_headers: Send extra headers
97
+
98
+ extra_query: Add additional query parameters to the request
99
+
100
+ extra_body: Add additional JSON properties to the request
101
+
102
+ timeout: Override the client-level default timeout for this request, in seconds
103
+ """
104
+ return self._post(
105
+ "/v1/organization/usage",
106
+ body=maybe_transform(
107
+ {
108
+ "before_date": before_date,
109
+ "start_date": start_date,
110
+ },
111
+ organization_retrieve_usage_params.OrganizationRetrieveUsageParams,
112
+ ),
113
+ options=make_request_options(
114
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
115
+ ),
116
+ cast_to=OrganizationRetrieveUsageResponse,
117
+ )
118
+
64
119
 
65
120
  class AsyncOrganizationResource(AsyncAPIResource):
66
121
  @cached_property
@@ -104,6 +159,55 @@ class AsyncOrganizationResource(AsyncAPIResource):
104
159
  cast_to=OrganizationRetrieveResponse,
105
160
  )
106
161
 
162
+ async def retrieve_usage(
163
+ self,
164
+ *,
165
+ before_date: Union[str, date] | NotGiven = NOT_GIVEN,
166
+ start_date: Union[str, date] | NotGiven = NOT_GIVEN,
167
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
168
+ # The extra values given here take precedence over values defined on the client or passed to this method.
169
+ extra_headers: Headers | None = None,
170
+ extra_query: Query | None = None,
171
+ extra_body: Body | None = None,
172
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
173
+ ) -> OrganizationRetrieveUsageResponse:
174
+ """
175
+ Fetch credit usage data broken down by model and day for the organization
176
+ associated with the API key used to make the request. Up to 90 days of data can
177
+ be queried at a time.
178
+
179
+ Args:
180
+ before_date: The end date of the usage data in ISO-8601 format (YYYY-MM-DD), not inclusive.
181
+ If unspecified, it will default to thirty days after the start date. Must be
182
+ less than or equal to 90 days after the start date. All dates are in UTC.
183
+
184
+ start_date: The start date of the usage data in ISO-8601 format (YYYY-MM-DD). If
185
+ unspecified, it will default to 30 days before the current date. All dates are
186
+ in UTC.
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/organization/usage",
198
+ body=await async_maybe_transform(
199
+ {
200
+ "before_date": before_date,
201
+ "start_date": start_date,
202
+ },
203
+ organization_retrieve_usage_params.OrganizationRetrieveUsageParams,
204
+ ),
205
+ options=make_request_options(
206
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
207
+ ),
208
+ cast_to=OrganizationRetrieveUsageResponse,
209
+ )
210
+
107
211
 
108
212
  class OrganizationResourceWithRawResponse:
109
213
  def __init__(self, organization: OrganizationResource) -> None:
@@ -112,6 +216,9 @@ class OrganizationResourceWithRawResponse:
112
216
  self.retrieve = to_raw_response_wrapper(
113
217
  organization.retrieve,
114
218
  )
219
+ self.retrieve_usage = to_raw_response_wrapper(
220
+ organization.retrieve_usage,
221
+ )
115
222
 
116
223
 
117
224
  class AsyncOrganizationResourceWithRawResponse:
@@ -121,6 +228,9 @@ class AsyncOrganizationResourceWithRawResponse:
121
228
  self.retrieve = async_to_raw_response_wrapper(
122
229
  organization.retrieve,
123
230
  )
231
+ self.retrieve_usage = async_to_raw_response_wrapper(
232
+ organization.retrieve_usage,
233
+ )
124
234
 
125
235
 
126
236
  class OrganizationResourceWithStreamingResponse:
@@ -130,6 +240,9 @@ class OrganizationResourceWithStreamingResponse:
130
240
  self.retrieve = to_streamed_response_wrapper(
131
241
  organization.retrieve,
132
242
  )
243
+ self.retrieve_usage = to_streamed_response_wrapper(
244
+ organization.retrieve_usage,
245
+ )
133
246
 
134
247
 
135
248
  class AsyncOrganizationResourceWithStreamingResponse:
@@ -139,3 +252,6 @@ class AsyncOrganizationResourceWithStreamingResponse:
139
252
  self.retrieve = async_to_streamed_response_wrapper(
140
253
  organization.retrieve,
141
254
  )
255
+ self.retrieve_usage = async_to_streamed_response_wrapper(
256
+ organization.retrieve_usage,
257
+ )
@@ -10,3 +10,9 @@ from .text_to_image_create_response import TextToImageCreateResponse as TextToIm
10
10
  from .video_upscale_create_response import VideoUpscaleCreateResponse as VideoUpscaleCreateResponse
11
11
  from .image_to_video_create_response import ImageToVideoCreateResponse as ImageToVideoCreateResponse
12
12
  from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse
13
+ from .organization_retrieve_usage_params import OrganizationRetrieveUsageParams as OrganizationRetrieveUsageParams
14
+ from .character_performance_create_params import CharacterPerformanceCreateParams as CharacterPerformanceCreateParams
15
+ from .organization_retrieve_usage_response import OrganizationRetrieveUsageResponse as OrganizationRetrieveUsageResponse
16
+ from .character_performance_create_response import (
17
+ CharacterPerformanceCreateResponse as CharacterPerformanceCreateResponse,
18
+ )
@@ -0,0 +1,103 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = [
11
+ "CharacterPerformanceCreateParams",
12
+ "Character",
13
+ "CharacterVideo",
14
+ "CharacterImage",
15
+ "Reference",
16
+ "ContentModeration",
17
+ ]
18
+
19
+
20
+ class CharacterPerformanceCreateParams(TypedDict, total=False):
21
+ character: Required[Character]
22
+ """The character to control.
23
+
24
+ You can either provide a video or an image. A visually recognizable face must be
25
+ visible and stay within the frame.
26
+ """
27
+
28
+ model: Required[Literal["act_two"]]
29
+ """The model variant to use."""
30
+
31
+ ratio: Required[Literal["1280:720", "720:1280", "960:960", "1104:832", "832:1104", "1584:672"]]
32
+ """The resolution of the output video."""
33
+
34
+ reference: Required[Reference]
35
+
36
+ body_control: Annotated[bool, PropertyInfo(alias="bodyControl")]
37
+ """A boolean indicating whether to enable body control.
38
+
39
+ When enabled, non-facial movements and gestures will be applied to the character
40
+ in addition to facial expressions.
41
+ """
42
+
43
+ content_moderation: Annotated[ContentModeration, PropertyInfo(alias="contentModeration")]
44
+ """Settings that affect the behavior of the content moderation system."""
45
+
46
+ expression_intensity: Annotated[int, PropertyInfo(alias="expressionIntensity")]
47
+ """An integer between 1 and 5 (inclusive).
48
+
49
+ A larger value increases the intensity of the character's expression.
50
+ """
51
+
52
+ seed: int
53
+ """If unspecified, a random number is chosen.
54
+
55
+ Varying the seed integer is a way to get different results for the same other
56
+ request parameters. Using the same seed integer for an identical request will
57
+ produce similar results.
58
+ """
59
+
60
+
61
+ class CharacterVideo(TypedDict, total=False):
62
+ type: Required[Literal["video"]]
63
+
64
+ uri: Required[str]
65
+ """
66
+ A HTTPS URL pointing to a video or a data URI containing a video of your
67
+ character. See [our docs](/assets/inputs#videos) on video inputs for more
68
+ information.
69
+ """
70
+
71
+
72
+ class CharacterImage(TypedDict, total=False):
73
+ type: Required[Literal["image"]]
74
+
75
+ uri: Required[str]
76
+ """
77
+ A HTTPS URL pointing to an image or a data URI containing an image of your
78
+ character. See [our docs](/assets/inputs#images) on image inputs for more
79
+ information.
80
+ """
81
+
82
+
83
+ Character: TypeAlias = Union[CharacterVideo, CharacterImage]
84
+
85
+
86
+ class Reference(TypedDict, total=False):
87
+ type: Required[Literal["video"]]
88
+
89
+ uri: Required[str]
90
+ """
91
+ A HTTPS URL pointing to a video or a data URI containing a video of a person
92
+ performing in the manner that you would like your character to perform. The
93
+ video must be between 3 and 30 seconds in duration. See
94
+ [our docs](/assets/inputs#videos) on video inputs for more information.
95
+ """
96
+
97
+
98
+ class ContentModeration(TypedDict, total=False):
99
+ public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")]
100
+ """
101
+ When set to `low`, the content moderation system will be less strict about
102
+ preventing generations that include recognizable public figures.
103
+ """
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .._models import BaseModel
4
+
5
+ __all__ = ["CharacterPerformanceCreateResponse"]
6
+
7
+
8
+ class CharacterPerformanceCreateResponse(BaseModel):
9
+ id: str
10
+ """The ID of the newly created task."""
@@ -10,12 +10,14 @@ __all__ = [
10
10
  "OrganizationRetrieveResponse",
11
11
  "Tier",
12
12
  "TierModels",
13
+ "TierModelsActTwo",
13
14
  "TierModelsGen3aTurbo",
14
15
  "TierModelsGen4Image",
15
16
  "TierModelsGen4Turbo",
16
17
  "TierModelsUpscaleV1",
17
18
  "Usage",
18
19
  "UsageModels",
20
+ "UsageModelsActTwo",
19
21
  "UsageModelsGen3aTurbo",
20
22
  "UsageModelsGen4Image",
21
23
  "UsageModelsGen4Turbo",
@@ -23,6 +25,14 @@ __all__ = [
23
25
  ]
24
26
 
25
27
 
28
+ class TierModelsActTwo(BaseModel):
29
+ max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
30
+ """The maximum number of generations that can be run concurrently for this model."""
31
+
32
+ max_daily_generations: int = FieldInfo(alias="maxDailyGenerations")
33
+ """The maximum number of generations that can be created each day for this model."""
34
+
35
+
26
36
  class TierModelsGen3aTurbo(BaseModel):
27
37
  max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
28
38
  """The maximum number of generations that can be run concurrently for this model."""
@@ -56,6 +66,9 @@ class TierModelsUpscaleV1(BaseModel):
56
66
 
57
67
 
58
68
  class TierModels(BaseModel):
69
+ act_two: Optional[TierModelsActTwo] = None
70
+ """Limits associated with the act_two model."""
71
+
59
72
  gen3a_turbo: Optional[TierModelsGen3aTurbo] = None
60
73
  """Limits associated with the gen3a_turbo model."""
61
74
 
@@ -77,6 +90,11 @@ class Tier(BaseModel):
77
90
  """An object containing model-specific limits. Each key represents a model."""
78
91
 
79
92
 
93
+ class UsageModelsActTwo(BaseModel):
94
+ daily_generations: int = FieldInfo(alias="dailyGenerations")
95
+ """The number of generations that have been run for this model in the past day."""
96
+
97
+
80
98
  class UsageModelsGen3aTurbo(BaseModel):
81
99
  daily_generations: int = FieldInfo(alias="dailyGenerations")
82
100
  """The number of generations that have been run for this model in the past day."""
@@ -98,6 +116,9 @@ class UsageModelsUpscaleV1(BaseModel):
98
116
 
99
117
 
100
118
  class UsageModels(BaseModel):
119
+ act_two: Optional[UsageModelsActTwo] = None
120
+ """Usage data for the act_two model."""
121
+
101
122
  gen3a_turbo: Optional[UsageModelsGen3aTurbo] = None
102
123
  """Usage data for the gen3a_turbo model."""
103
124
 
@@ -0,0 +1,27 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from datetime import date
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+ from .._utils import PropertyInfo
10
+
11
+ __all__ = ["OrganizationRetrieveUsageParams"]
12
+
13
+
14
+ class OrganizationRetrieveUsageParams(TypedDict, total=False):
15
+ before_date: Annotated[Union[str, date], PropertyInfo(alias="beforeDate", format="iso8601")]
16
+ """The end date of the usage data in ISO-8601 format (YYYY-MM-DD), not inclusive.
17
+
18
+ If unspecified, it will default to thirty days after the start date. Must be
19
+ less than or equal to 90 days after the start date. All dates are in UTC.
20
+ """
21
+
22
+ start_date: Annotated[Union[str, date], PropertyInfo(alias="startDate", format="iso8601")]
23
+ """The start date of the usage data in ISO-8601 format (YYYY-MM-DD).
24
+
25
+ If unspecified, it will default to 30 days before the current date. All dates
26
+ are in UTC.
27
+ """
@@ -0,0 +1,37 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import datetime
4
+ from typing import List
5
+ from typing_extensions import Literal
6
+
7
+ from pydantic import Field as FieldInfo
8
+
9
+ from .._models import BaseModel
10
+
11
+ __all__ = ["OrganizationRetrieveUsageResponse", "Result", "ResultUsedCredit"]
12
+
13
+
14
+ class ResultUsedCredit(BaseModel):
15
+ amount: int
16
+ """The number of credits used for the model."""
17
+
18
+ model: Literal["upscale_v1", "act_two", "gen4_image", "gen3a_turbo", "gen4_turbo"]
19
+ """The model whose usage resulted in the credit usage."""
20
+
21
+
22
+ class Result(BaseModel):
23
+ date: datetime.date
24
+ """The date of the usage data in ISO-8601 format (YYYY-MM-DD).
25
+
26
+ All dates are in UTC.
27
+ """
28
+
29
+ used_credits: List[ResultUsedCredit] = FieldInfo(alias="usedCredits")
30
+ """The credits used per model for the given date."""
31
+
32
+
33
+ class OrganizationRetrieveUsageResponse(BaseModel):
34
+ models: List[Literal["upscale_v1", "act_two", "gen4_image", "gen3a_turbo", "gen4_turbo"]]
35
+ """The list of models with usage during the queried time range."""
36
+
37
+ results: List[Result]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.6.5
3
+ Version: 3.7.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
@@ -124,7 +124,6 @@ pip install runwayml[aiohttp]
124
124
  Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
125
125
 
126
126
  ```python
127
- import os
128
127
  import asyncio
129
128
  from runwayml import DefaultAioHttpClient
130
129
  from runwayml import AsyncRunwayML
@@ -132,7 +131,7 @@ from runwayml import AsyncRunwayML
132
131
 
133
132
  async def main() -> None:
134
133
  async with AsyncRunwayML(
135
- api_key=os.environ.get("RUNWAYML_API_SECRET"), # This is the default and can be omitted
134
+ api_key="My API Key",
136
135
  http_client=DefaultAioHttpClient(),
137
136
  ) as client:
138
137
  image_to_video = await client.image_to_video.create(
@@ -1,17 +1,17 @@
1
1
  runwayml/__init__.py,sha256=tr-n2Y4sH_wBv8t2F_jk7ku_rLT2erU3j61ONZJWUVs,2743
2
2
  runwayml/_base_client.py,sha256=jo8QwM4u7dRcesI8UlJ2l70HL-DYALQtgRt-dqqZUdQ,66924
3
- runwayml/_client.py,sha256=tEooz-jH6JGowMQwrTZE7CKcyqpILEHKfSFf7OevoIU,18513
3
+ runwayml/_client.py,sha256=Zn4rh2kWC5LhgqSx5QgsQfPyeqRscyZ-RWtI1PDMZYg,19532
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
7
7
  runwayml/_files.py,sha256=mf4dOgL4b0ryyZlbqLhggD3GVgDf6XxdGFAgce01ugE,3549
8
- runwayml/_models.py,sha256=viD5E6aDMhxslcFHDYvkHaKzE8YLcNmsPsMe8STixvs,29294
8
+ runwayml/_models.py,sha256=aRCuUozbf1yNMK9XbMmxcgxDJYogijGTtQEr3g_wbyA,29316
9
9
  runwayml/_qs.py,sha256=AOkSz4rHtK4YI3ZU_kzea-zpwBUgEY8WniGmTPyEimc,4846
10
10
  runwayml/_resource.py,sha256=BF-j3xY5eRTKmuTxg8eDhLtLP4MLB1phDh_B6BKipKA,1112
11
11
  runwayml/_response.py,sha256=WxjSEXX-j01ZhlSxYyMCVSEKxo20pgy40RA7iyski8M,28800
12
12
  runwayml/_streaming.py,sha256=NSVuAgknVQWU1cgZEjQn01IdZKKynb5rOeYp5Lo-OEQ,10108
13
13
  runwayml/_types.py,sha256=YL6SdhLq5SHlT644GjzDwOJ_Slyr8QDRCoacOp4trhI,6199
14
- runwayml/_version.py,sha256=V8UIQsr_Ixs68ovfL9z1Umky7_XVGNycdVSDh7FwOOA,160
14
+ runwayml/_version.py,sha256=y01RFSKVPUBH9eBPpGho8q5r4TzVv0ZdhjRNrNAPHjE,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
@@ -25,22 +25,27 @@ runwayml/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,46
25
25
  runwayml/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
26
  runwayml/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
27
  runwayml/lib/polling.py,sha256=4fF0gP-h4iR0jvxWifsqtR1iH9vRoKEgGykkaZNT9Ek,4743
28
- runwayml/resources/__init__.py,sha256=5XJIeBB9D2GqQU-9Ub5AuzRVgLYp1QdLr8Fjh6DCDxM,2643
28
+ runwayml/resources/__init__.py,sha256=I2-16xL8gL5dSItMXI1YX9F1rWIqongQ4c-fE_B2EhQ,3276
29
+ runwayml/resources/character_performance.py,sha256=8KBZQuht5CKDeqk89UCIWw7EMqt6iB-It0iIFejOJ-M,10905
29
30
  runwayml/resources/image_to_video.py,sha256=O6YbnD7QEE_YK5UeRDq8RzWwiuS5nTQSAkCl9RvZe74,10880
30
- runwayml/resources/organization.py,sha256=XBg5nhkycPU3rllRvf9aaeHuZNtzGDKHlLPrPqDCAsw,5419
31
+ runwayml/resources/organization.py,sha256=iPwFFz8nltHXea0uFJd-700657xgJdnEJiWAwXVNDqY,10581
31
32
  runwayml/resources/tasks.py,sha256=mjdBqB1G4u9v3xB_9yn6aIdvsDmawxSNcTENkMpKSms,10146
32
33
  runwayml/resources/text_to_image.py,sha256=OJ9oD1Fc5NBGqci6Ox_-M9lFvsYG31fSwSzsr0pwPak,10200
33
34
  runwayml/resources/video_upscale.py,sha256=8Mz_g5Swxmgp14jfcfexurUYpPi73q_iU-9D1jOddt0,7691
34
- runwayml/types/__init__.py,sha256=zXevA88F25dbdsjgpvdlKlvELiv9aamz1hS3xcLbe40,889
35
+ runwayml/types/__init__.py,sha256=I0XH9jsRrNXfBNLsFRzfjfyh8I8frTslCfeN7-xyxJg,1376
36
+ runwayml/types/character_performance_create_params.py,sha256=TYmR-YCK8_4fomSoqtC8dT1iIR7z2gMQvtu9u-FatQ4,3266
37
+ runwayml/types/character_performance_create_response.py,sha256=QIJUfqWraZTJmX67zu3VQevBoFxDPmUh74C-_EelHy8,280
35
38
  runwayml/types/image_to_video_create_params.py,sha256=6M_xJRx0ws8nQ0a3k3jEICDm-WXJUG9j-j1UIxAAg-s,2869
36
39
  runwayml/types/image_to_video_create_response.py,sha256=WvZHbZxxJz8KerRNogzb1RYBrxa1x0iCPDi9-LCpHyE,345
37
- runwayml/types/organization_retrieve_response.py,sha256=_7vny0YNmNmREe8jp58ldJbXDdzNAGzDT8V0kK9pbsA,4385
40
+ runwayml/types/organization_retrieve_response.py,sha256=h0FbMJ2mpq9sHy3QkN4JfcSqW11ef39XD82z_zLRwB8,5187
41
+ runwayml/types/organization_retrieve_usage_params.py,sha256=vF5GUqaDqY1x6W2RzJ923jspuZyoNgCUaoLI3mW25zg,999
42
+ runwayml/types/organization_retrieve_usage_response.py,sha256=QNtePn2bXt1WCL--BueXC5rb_uZ0aMDeTp0LFUr_7kg,1104
38
43
  runwayml/types/task_retrieve_response.py,sha256=v8y2bLxsW6srzScW-B3Akv72q_PI_NQmduGrGRQMHds,2139
39
44
  runwayml/types/text_to_image_create_params.py,sha256=I8Dr4UG6VnciQ87zN6qp03FKwlQNnrwyn6cacHLqw20,2794
40
45
  runwayml/types/text_to_image_create_response.py,sha256=koMzUg82dYFQPp77wln3UR1z8WO2sHCNMWGgoQ9Id8M,262
41
46
  runwayml/types/video_upscale_create_params.py,sha256=Ta3BNQy9aeTUBU5Ui-CMJtF32HeNRqbNpqjAAOKXyks,743
42
47
  runwayml/types/video_upscale_create_response.py,sha256=zf-79HbJa68dUHltBiZjVtnW_U6HUI-htmkTm5URBSU,264
43
- runwayml-3.6.5.dist-info/METADATA,sha256=gbivENUbX1U2YRyQKnDQ2MnwItrNW4lQwCPcv5Sfmkw,15234
44
- runwayml-3.6.5.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
45
- runwayml-3.6.5.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
46
- runwayml-3.6.5.dist-info/RECORD,,
48
+ runwayml-3.7.1.dist-info/METADATA,sha256=wVT6o3TJcrNojjUxUdqOFxvr_gztm_sZ74okFkAoTaM,15157
49
+ runwayml-3.7.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
50
+ runwayml-3.7.1.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
51
+ runwayml-3.7.1.dist-info/RECORD,,