runwayml 3.0.6__py3-none-any.whl → 3.1.0__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, image_to_video
24
+ from .resources import tasks, organization, text_to_image, image_to_video
25
25
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
26
26
  from ._exceptions import RunwayMLError, APIStatusError
27
27
  from ._base_client import (
@@ -45,6 +45,7 @@ __all__ = [
45
45
  class RunwayML(SyncAPIClient):
46
46
  tasks: tasks.TasksResource
47
47
  image_to_video: image_to_video.ImageToVideoResource
48
+ text_to_image: text_to_image.TextToImageResource
48
49
  organization: organization.OrganizationResource
49
50
  with_raw_response: RunwayMLWithRawResponse
50
51
  with_streaming_response: RunwayMLWithStreamedResponse
@@ -111,6 +112,7 @@ class RunwayML(SyncAPIClient):
111
112
 
112
113
  self.tasks = tasks.TasksResource(self)
113
114
  self.image_to_video = image_to_video.ImageToVideoResource(self)
115
+ self.text_to_image = text_to_image.TextToImageResource(self)
114
116
  self.organization = organization.OrganizationResource(self)
115
117
  self.with_raw_response = RunwayMLWithRawResponse(self)
116
118
  self.with_streaming_response = RunwayMLWithStreamedResponse(self)
@@ -226,6 +228,7 @@ class RunwayML(SyncAPIClient):
226
228
  class AsyncRunwayML(AsyncAPIClient):
227
229
  tasks: tasks.AsyncTasksResource
228
230
  image_to_video: image_to_video.AsyncImageToVideoResource
231
+ text_to_image: text_to_image.AsyncTextToImageResource
229
232
  organization: organization.AsyncOrganizationResource
230
233
  with_raw_response: AsyncRunwayMLWithRawResponse
231
234
  with_streaming_response: AsyncRunwayMLWithStreamedResponse
@@ -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.text_to_image = text_to_image.AsyncTextToImageResource(self)
295
299
  self.organization = organization.AsyncOrganizationResource(self)
296
300
  self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
297
301
  self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)
@@ -408,6 +412,7 @@ class RunwayMLWithRawResponse:
408
412
  def __init__(self, client: RunwayML) -> None:
409
413
  self.tasks = tasks.TasksResourceWithRawResponse(client.tasks)
410
414
  self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
415
+ self.text_to_image = text_to_image.TextToImageResourceWithRawResponse(client.text_to_image)
411
416
  self.organization = organization.OrganizationResourceWithRawResponse(client.organization)
412
417
 
413
418
 
@@ -415,6 +420,7 @@ class AsyncRunwayMLWithRawResponse:
415
420
  def __init__(self, client: AsyncRunwayML) -> None:
416
421
  self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks)
417
422
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
423
+ self.text_to_image = text_to_image.AsyncTextToImageResourceWithRawResponse(client.text_to_image)
418
424
  self.organization = organization.AsyncOrganizationResourceWithRawResponse(client.organization)
419
425
 
420
426
 
@@ -422,6 +428,7 @@ class RunwayMLWithStreamedResponse:
422
428
  def __init__(self, client: RunwayML) -> None:
423
429
  self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks)
424
430
  self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
431
+ self.text_to_image = text_to_image.TextToImageResourceWithStreamingResponse(client.text_to_image)
425
432
  self.organization = organization.OrganizationResourceWithStreamingResponse(client.organization)
426
433
 
427
434
 
@@ -429,6 +436,7 @@ class AsyncRunwayMLWithStreamedResponse:
429
436
  def __init__(self, client: AsyncRunwayML) -> None:
430
437
  self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks)
431
438
  self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
439
+ self.text_to_image = text_to_image.AsyncTextToImageResourceWithStreamingResponse(client.text_to_image)
432
440
  self.organization = organization.AsyncOrganizationResourceWithStreamingResponse(client.organization)
433
441
 
434
442
 
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.0.6" # x-release-please-version
4
+ __version__ = "3.1.0" # x-release-please-version
@@ -16,6 +16,14 @@ from .organization import (
16
16
  OrganizationResourceWithStreamingResponse,
17
17
  AsyncOrganizationResourceWithStreamingResponse,
18
18
  )
19
+ from .text_to_image import (
20
+ TextToImageResource,
21
+ AsyncTextToImageResource,
22
+ TextToImageResourceWithRawResponse,
23
+ AsyncTextToImageResourceWithRawResponse,
24
+ TextToImageResourceWithStreamingResponse,
25
+ AsyncTextToImageResourceWithStreamingResponse,
26
+ )
19
27
  from .image_to_video import (
20
28
  ImageToVideoResource,
21
29
  AsyncImageToVideoResource,
@@ -38,6 +46,12 @@ __all__ = [
38
46
  "AsyncImageToVideoResourceWithRawResponse",
39
47
  "ImageToVideoResourceWithStreamingResponse",
40
48
  "AsyncImageToVideoResourceWithStreamingResponse",
49
+ "TextToImageResource",
50
+ "AsyncTextToImageResource",
51
+ "TextToImageResourceWithRawResponse",
52
+ "AsyncTextToImageResourceWithRawResponse",
53
+ "TextToImageResourceWithStreamingResponse",
54
+ "AsyncTextToImageResourceWithStreamingResponse",
41
55
  "OrganizationResource",
42
56
  "AsyncOrganizationResource",
43
57
  "OrganizationResourceWithRawResponse",
@@ -88,9 +88,8 @@ class ImageToVideoResource(SyncAPIResource):
88
88
 
89
89
  duration: The number of seconds of duration for the output video.
90
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.
91
+ prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
92
+ should describe in detail what should appear in the output.
94
93
 
95
94
  seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
96
95
  get different results for the same other request parameters. Using the same seed
@@ -188,9 +187,8 @@ class AsyncImageToVideoResource(AsyncAPIResource):
188
187
 
189
188
  duration: The number of seconds of duration for the output video.
190
189
 
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.
190
+ prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
191
+ should describe in detail what should appear in the output.
194
192
 
195
193
  seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
196
194
  get different results for the same other request parameters. Using the same seed
@@ -0,0 +1,250 @@
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 Iterable
6
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from ..types import text_to_image_create_params
11
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
12
+ from .._utils import maybe_transform, async_maybe_transform
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+ from ..types.text_to_image_create_response import TextToImageCreateResponse
23
+
24
+ __all__ = ["TextToImageResource", "AsyncTextToImageResource"]
25
+
26
+
27
+ class TextToImageResource(SyncAPIResource):
28
+ @cached_property
29
+ def with_raw_response(self) -> TextToImageResourceWithRawResponse:
30
+ """
31
+ This property can be used as a prefix for any HTTP method call to return
32
+ the raw response object instead of the parsed content.
33
+
34
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
35
+ """
36
+ return TextToImageResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> TextToImageResourceWithStreamingResponse:
40
+ """
41
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
+
43
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
44
+ """
45
+ return TextToImageResourceWithStreamingResponse(self)
46
+
47
+ def create(
48
+ self,
49
+ *,
50
+ model: Literal["gen4_image"],
51
+ prompt_text: str,
52
+ ratio: Literal[
53
+ "1920:1080",
54
+ "1080:1920",
55
+ "1024:1024",
56
+ "1360:768",
57
+ "1080:1080",
58
+ "1168:880",
59
+ "1440:1080",
60
+ "1080:1440",
61
+ "1808:768",
62
+ "2112:912",
63
+ ],
64
+ content_moderation: text_to_image_create_params.ContentModeration | NotGiven = NOT_GIVEN,
65
+ reference_images: Iterable[text_to_image_create_params.ReferenceImage] | NotGiven = NOT_GIVEN,
66
+ seed: int | NotGiven = NOT_GIVEN,
67
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
+ # The extra values given here take precedence over values defined on the client or passed to this method.
69
+ extra_headers: Headers | None = None,
70
+ extra_query: Query | None = None,
71
+ extra_body: Body | None = None,
72
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
73
+ ) -> TextToImageCreateResponse:
74
+ """
75
+ This endpoint will start a new task to generate images from text.
76
+
77
+ Args:
78
+ model: The model variant to use.
79
+
80
+ prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
81
+ should describe in detail what should appear in the output.
82
+
83
+ ratio: The resolution of the output image(s).
84
+
85
+ content_moderation: Settings that affect the behavior of the content moderation system.
86
+
87
+ reference_images: An array of images to be used as references for the generated image output. Up
88
+ to three reference images can be provided.
89
+
90
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
91
+ get different results for the same other request parameters. Using the same seed
92
+ integer for an identical request will produce similar results.
93
+
94
+ extra_headers: Send extra headers
95
+
96
+ extra_query: Add additional query parameters to the request
97
+
98
+ extra_body: Add additional JSON properties to the request
99
+
100
+ timeout: Override the client-level default timeout for this request, in seconds
101
+ """
102
+ return self._post(
103
+ "/v1/text_to_image",
104
+ body=maybe_transform(
105
+ {
106
+ "model": model,
107
+ "prompt_text": prompt_text,
108
+ "ratio": ratio,
109
+ "content_moderation": content_moderation,
110
+ "reference_images": reference_images,
111
+ "seed": seed,
112
+ },
113
+ text_to_image_create_params.TextToImageCreateParams,
114
+ ),
115
+ options=make_request_options(
116
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
+ ),
118
+ cast_to=TextToImageCreateResponse,
119
+ )
120
+
121
+
122
+ class AsyncTextToImageResource(AsyncAPIResource):
123
+ @cached_property
124
+ def with_raw_response(self) -> AsyncTextToImageResourceWithRawResponse:
125
+ """
126
+ This property can be used as a prefix for any HTTP method call to return
127
+ the raw response object instead of the parsed content.
128
+
129
+ For more information, see https://www.github.com/runwayml/sdk-python#accessing-raw-response-data-eg-headers
130
+ """
131
+ return AsyncTextToImageResourceWithRawResponse(self)
132
+
133
+ @cached_property
134
+ def with_streaming_response(self) -> AsyncTextToImageResourceWithStreamingResponse:
135
+ """
136
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
137
+
138
+ For more information, see https://www.github.com/runwayml/sdk-python#with_streaming_response
139
+ """
140
+ return AsyncTextToImageResourceWithStreamingResponse(self)
141
+
142
+ async def create(
143
+ self,
144
+ *,
145
+ model: Literal["gen4_image"],
146
+ prompt_text: str,
147
+ ratio: Literal[
148
+ "1920:1080",
149
+ "1080:1920",
150
+ "1024:1024",
151
+ "1360:768",
152
+ "1080:1080",
153
+ "1168:880",
154
+ "1440:1080",
155
+ "1080:1440",
156
+ "1808:768",
157
+ "2112:912",
158
+ ],
159
+ content_moderation: text_to_image_create_params.ContentModeration | NotGiven = NOT_GIVEN,
160
+ reference_images: Iterable[text_to_image_create_params.ReferenceImage] | NotGiven = NOT_GIVEN,
161
+ seed: int | NotGiven = NOT_GIVEN,
162
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163
+ # The extra values given here take precedence over values defined on the client or passed to this method.
164
+ extra_headers: Headers | None = None,
165
+ extra_query: Query | None = None,
166
+ extra_body: Body | None = None,
167
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
168
+ ) -> TextToImageCreateResponse:
169
+ """
170
+ This endpoint will start a new task to generate images from text.
171
+
172
+ Args:
173
+ model: The model variant to use.
174
+
175
+ prompt_text: A non-empty string up to 1000 characters (measured in UTF-16 code units). This
176
+ should describe in detail what should appear in the output.
177
+
178
+ ratio: The resolution of the output image(s).
179
+
180
+ content_moderation: Settings that affect the behavior of the content moderation system.
181
+
182
+ reference_images: An array of images to be used as references for the generated image output. Up
183
+ to three reference images can be provided.
184
+
185
+ seed: If unspecified, a random number is chosen. Varying the seed integer is a way to
186
+ get different results for the same other request parameters. Using the same seed
187
+ integer for an identical request will produce similar results.
188
+
189
+ extra_headers: Send extra headers
190
+
191
+ extra_query: Add additional query parameters to the request
192
+
193
+ extra_body: Add additional JSON properties to the request
194
+
195
+ timeout: Override the client-level default timeout for this request, in seconds
196
+ """
197
+ return await self._post(
198
+ "/v1/text_to_image",
199
+ body=await async_maybe_transform(
200
+ {
201
+ "model": model,
202
+ "prompt_text": prompt_text,
203
+ "ratio": ratio,
204
+ "content_moderation": content_moderation,
205
+ "reference_images": reference_images,
206
+ "seed": seed,
207
+ },
208
+ text_to_image_create_params.TextToImageCreateParams,
209
+ ),
210
+ options=make_request_options(
211
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
212
+ ),
213
+ cast_to=TextToImageCreateResponse,
214
+ )
215
+
216
+
217
+ class TextToImageResourceWithRawResponse:
218
+ def __init__(self, text_to_image: TextToImageResource) -> None:
219
+ self._text_to_image = text_to_image
220
+
221
+ self.create = to_raw_response_wrapper(
222
+ text_to_image.create,
223
+ )
224
+
225
+
226
+ class AsyncTextToImageResourceWithRawResponse:
227
+ def __init__(self, text_to_image: AsyncTextToImageResource) -> None:
228
+ self._text_to_image = text_to_image
229
+
230
+ self.create = async_to_raw_response_wrapper(
231
+ text_to_image.create,
232
+ )
233
+
234
+
235
+ class TextToImageResourceWithStreamingResponse:
236
+ def __init__(self, text_to_image: TextToImageResource) -> None:
237
+ self._text_to_image = text_to_image
238
+
239
+ self.create = to_streamed_response_wrapper(
240
+ text_to_image.create,
241
+ )
242
+
243
+
244
+ class AsyncTextToImageResourceWithStreamingResponse:
245
+ def __init__(self, text_to_image: AsyncTextToImageResource) -> None:
246
+ self._text_to_image = text_to_image
247
+
248
+ self.create = async_to_streamed_response_wrapper(
249
+ text_to_image.create,
250
+ )
@@ -3,6 +3,8 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  from .task_retrieve_response import TaskRetrieveResponse as TaskRetrieveResponse
6
+ from .text_to_image_create_params import TextToImageCreateParams as TextToImageCreateParams
6
7
  from .image_to_video_create_params import ImageToVideoCreateParams as ImageToVideoCreateParams
8
+ from .text_to_image_create_response import TextToImageCreateResponse as TextToImageCreateResponse
7
9
  from .image_to_video_create_response import ImageToVideoCreateResponse as ImageToVideoCreateResponse
8
10
  from .organization_retrieve_response import OrganizationRetrieveResponse as OrganizationRetrieveResponse
@@ -45,10 +45,9 @@ class ImageToVideoCreateParams(TypedDict, total=False):
45
45
  """The number of seconds of duration for the output video."""
46
46
 
47
47
  prompt_text: Annotated[str, PropertyInfo(alias="promptText")]
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.
48
+ """A non-empty string up to 1000 characters (measured in UTF-16 code units).
49
+
50
+ This should describe in detail what should appear in the output.
52
51
  """
53
52
 
54
53
  seed: int
@@ -11,10 +11,12 @@ __all__ = [
11
11
  "Tier",
12
12
  "TierModels",
13
13
  "TierModelsGen3aTurbo",
14
+ "TierModelsGen4Image",
14
15
  "TierModelsGen4Turbo",
15
16
  "Usage",
16
17
  "UsageModels",
17
18
  "UsageModelsGen3aTurbo",
19
+ "UsageModelsGen4Image",
18
20
  "UsageModelsGen4Turbo",
19
21
  ]
20
22
 
@@ -27,6 +29,14 @@ class TierModelsGen3aTurbo(BaseModel):
27
29
  """The maximum number of generations that can be created each day for this model."""
28
30
 
29
31
 
32
+ class TierModelsGen4Image(BaseModel):
33
+ max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
34
+ """The maximum number of generations that can be run concurrently for this model."""
35
+
36
+ max_daily_generations: int = FieldInfo(alias="maxDailyGenerations")
37
+ """The maximum number of generations that can be created each day for this model."""
38
+
39
+
30
40
  class TierModelsGen4Turbo(BaseModel):
31
41
  max_concurrent_generations: int = FieldInfo(alias="maxConcurrentGenerations")
32
42
  """The maximum number of generations that can be run concurrently for this model."""
@@ -39,6 +49,9 @@ class TierModels(BaseModel):
39
49
  gen3a_turbo: Optional[TierModelsGen3aTurbo] = None
40
50
  """Limits associated with the gen3a_turbo model."""
41
51
 
52
+ gen4_image: Optional[TierModelsGen4Image] = None
53
+ """Limits associated with the gen4_image model."""
54
+
42
55
  gen4_turbo: Optional[TierModelsGen4Turbo] = None
43
56
  """Limits associated with the gen4_turbo model."""
44
57
 
@@ -56,6 +69,11 @@ class UsageModelsGen3aTurbo(BaseModel):
56
69
  """The number of generations that have been run for this model in the past day."""
57
70
 
58
71
 
72
+ class UsageModelsGen4Image(BaseModel):
73
+ daily_generations: int = FieldInfo(alias="dailyGenerations")
74
+ """The number of generations that have been run for this model in the past day."""
75
+
76
+
59
77
  class UsageModelsGen4Turbo(BaseModel):
60
78
  daily_generations: int = FieldInfo(alias="dailyGenerations")
61
79
  """The number of generations that have been run for this model in the past day."""
@@ -65,6 +83,9 @@ class UsageModels(BaseModel):
65
83
  gen3a_turbo: Optional[UsageModelsGen3aTurbo] = None
66
84
  """Usage data for the gen3a_turbo model."""
67
85
 
86
+ gen4_image: Optional[UsageModelsGen4Image] = None
87
+ """Usage data for the gen4_image model."""
88
+
68
89
  gen4_turbo: Optional[UsageModelsGen4Turbo] = None
69
90
  """Usage data for the gen4_turbo model."""
70
91
 
@@ -0,0 +1,79 @@
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 Iterable
6
+ from typing_extensions import Literal, Required, Annotated, TypedDict
7
+
8
+ from .._utils import PropertyInfo
9
+
10
+ __all__ = ["TextToImageCreateParams", "ContentModeration", "ReferenceImage"]
11
+
12
+
13
+ class TextToImageCreateParams(TypedDict, total=False):
14
+ model: Required[Literal["gen4_image"]]
15
+ """The model variant to use."""
16
+
17
+ prompt_text: Required[Annotated[str, PropertyInfo(alias="promptText")]]
18
+ """A non-empty string up to 1000 characters (measured in UTF-16 code units).
19
+
20
+ This should describe in detail what should appear in the output.
21
+ """
22
+
23
+ ratio: Required[
24
+ Literal[
25
+ "1920:1080",
26
+ "1080:1920",
27
+ "1024:1024",
28
+ "1360:768",
29
+ "1080:1080",
30
+ "1168:880",
31
+ "1440:1080",
32
+ "1080:1440",
33
+ "1808:768",
34
+ "2112:912",
35
+ ]
36
+ ]
37
+ """The resolution of the output image(s)."""
38
+
39
+ content_moderation: Annotated[ContentModeration, PropertyInfo(alias="contentModeration")]
40
+ """Settings that affect the behavior of the content moderation system."""
41
+
42
+ reference_images: Annotated[Iterable[ReferenceImage], PropertyInfo(alias="referenceImages")]
43
+ """An array of images to be used as references for the generated image output.
44
+
45
+ Up to three reference images can be provided.
46
+ """
47
+
48
+ seed: int
49
+ """If unspecified, a random number is chosen.
50
+
51
+ Varying the seed integer is a way to get different results for the same other
52
+ request parameters. Using the same seed integer for an identical request will
53
+ produce similar results.
54
+ """
55
+
56
+
57
+ class ContentModeration(TypedDict, total=False):
58
+ public_figure_threshold: Annotated[Literal["auto", "low"], PropertyInfo(alias="publicFigureThreshold")]
59
+ """
60
+ When set to `low`, the content moderation system will be less strict about
61
+ preventing generations that include recognizable public figures.
62
+ """
63
+
64
+
65
+ class ReferenceImage(TypedDict, total=False):
66
+ uri: Required[str]
67
+ """
68
+ A HTTPS URL or data URI containing an encoded image to be used as reference for
69
+ the generated output image. See [our docs](/assets/inputs#images) on image
70
+ inputs for more information.
71
+ """
72
+
73
+ tag: str
74
+ """A name used to refer to the image reference, from 3 to 16 characters in length.
75
+
76
+ Tags must be alphanumeric (plus underscores) and start with a letter. You can
77
+ refer to the reference image's tag in the prompt text with at-mention syntax:
78
+ `@tag`. Tags are case-sensitive.
79
+ """
@@ -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__ = ["TextToImageCreateResponse"]
6
+
7
+
8
+ class TextToImageCreateResponse(BaseModel):
9
+ id: str
10
+ """The ID of the newly created task."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.0.6
3
+ Version: 3.1.0
4
4
  Summary: The official Python library for the runwayml API
5
5
  Project-URL: Homepage, https://github.com/runwayml/sdk-python
6
6
  Project-URL: Repository, https://github.com/runwayml/sdk-python
@@ -114,6 +114,24 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ
114
114
 
115
115
  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
116
116
 
117
+ ## Nested params
118
+
119
+ Nested parameters are dictionaries, typed using `TypedDict`, for example:
120
+
121
+ ```python
122
+ from runwayml import RunwayML
123
+
124
+ client = RunwayML()
125
+
126
+ text_to_image = client.text_to_image.create(
127
+ model="gen4_image",
128
+ prompt_text="promptText",
129
+ ratio="1920:1080",
130
+ content_moderation={"public_figure_threshold": "auto"},
131
+ )
132
+ print(text_to_image.content_moderation)
133
+ ```
134
+
117
135
  ## Handling errors
118
136
 
119
137
  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runwayml.APIConnectionError` is raised.
@@ -1,6 +1,6 @@
1
1
  runwayml/__init__.py,sha256=w7Il_Fc71HY9Ebs62Q5VLcsCQGraefXwcOmtzeg4r5I,2587
2
2
  runwayml/_base_client.py,sha256=IHjCRq-jze0tVzSAP_zkZLHYG9lsvg4j_xwy2hv0ryQ,64846
3
- runwayml/_client.py,sha256=RmchptAkzAmgp1RC40KQ0ZKqpdxfV9f8bHin3Bbmcmg,17123
3
+ runwayml/_client.py,sha256=e2fMzTRERF3s2UDqSfaK7wXl_E9FJy8KjBxUsFvLRBs,17814
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=WxjSEXX-j01ZhlSxYyMCVSEKxo20pgy40RA7iyski8M,28800
12
12
  runwayml/_streaming.py,sha256=NSVuAgknVQWU1cgZEjQn01IdZKKynb5rOeYp5Lo-OEQ,10108
13
13
  runwayml/_types.py,sha256=oHct1QQY_lI8bepCgfWDZm2N5VNi0e6o1iLeiTh4Y_0,6145
14
- runwayml/_version.py,sha256=7B96W6eF_HsT9vHUGI7VGYnqXsOvTqrdQJcmhWgufZY,160
14
+ runwayml/_version.py,sha256=7sFBfBeEL4OVY4QhNRLuhtMNCFZ2bJ6q7o0hwtVstvs,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
@@ -24,16 +24,19 @@ runwayml/_utils/_transform.py,sha256=n7kskEWz6o__aoNvhFoGVyDoalNe6mJwp-g7BWkdj88
24
24
  runwayml/_utils/_typing.py,sha256=D0DbbNu8GnYQTSICnTSHDGsYXj8TcAKyhejb0XcnjtY,4602
25
25
  runwayml/_utils/_utils.py,sha256=ts4CiiuNpFiGB6YMdkQRh2SZvYvsl7mAF-JWHCcLDf4,12312
26
26
  runwayml/lib/.keep,sha256=wuNrz-5SXo3jJaJOJgz4vFHM41YH_g20F5cRQo0vLes,224
27
- runwayml/resources/__init__.py,sha256=SqcC1MLwxPaz2c7gRRBlOn9-2pDPMKTXD2gFbG5FJ2E,1597
28
- runwayml/resources/image_to_video.py,sha256=n3xb3sm4qJK_yQlWK8dTF2BetoC6gA5p2V7jcuWy6Ik,10228
27
+ runwayml/resources/__init__.py,sha256=ucZzkzpJ_Wn8QymaDzZyb1MO9YJPGCp39yYRd7tOAok,2114
28
+ runwayml/resources/image_to_video.py,sha256=dS2yTuOx10xSUAhAZ0FmuAEDXqo-WLyWe41aVovR5yo,10120
29
29
  runwayml/resources/organization.py,sha256=XBg5nhkycPU3rllRvf9aaeHuZNtzGDKHlLPrPqDCAsw,5419
30
30
  runwayml/resources/tasks.py,sha256=-VT3qetYcaqn4FskekxhN_fCTozMl1GqxGpGwxV8M60,9673
31
- runwayml/types/__init__.py,sha256=xfq4RirwNpSBy5xXra7CB8wa0029vKUH0DB6Zg02hFs,505
32
- runwayml/types/image_to_video_create_params.py,sha256=EtTTZJ4rWEcEknqRxFYDWtP3Zxox-_36NBj3fRGdP7o,2400
31
+ runwayml/resources/text_to_image.py,sha256=HmCuVnAEoDF2XZZP7h13rkZx8h2lulQ8d44hgLo9L6Q,9676
32
+ runwayml/types/__init__.py,sha256=AHeIAsK4Yw29OpmnNVTsQZkwHszr5ZJq6fYus_RbTis,695
33
+ runwayml/types/image_to_video_create_params.py,sha256=TgoNwKkz_PK_sFBeATqMFkXpBhdx8DSZTLA6hLbMhFM,2352
33
34
  runwayml/types/image_to_video_create_response.py,sha256=WvZHbZxxJz8KerRNogzb1RYBrxa1x0iCPDi9-LCpHyE,345
34
- runwayml/types/organization_retrieve_response.py,sha256=DV46yEIRjmL05uISc2-PpM5BGWu8gniA9TQ056abWLA,2721
35
+ runwayml/types/organization_retrieve_response.py,sha256=SQxoIUxCnDDBv83A3K7TmNjcAdz_SpHB4MGA9WOJ00w,3553
35
36
  runwayml/types/task_retrieve_response.py,sha256=v8y2bLxsW6srzScW-B3Akv72q_PI_NQmduGrGRQMHds,2139
36
- runwayml-3.0.6.dist-info/METADATA,sha256=A_vDGZGi9BQ74xd9soRXQvJlI6ZPD-WqJrsLhL7xvb8,13678
37
- runwayml-3.0.6.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
38
- runwayml-3.0.6.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
39
- runwayml-3.0.6.dist-info/RECORD,,
37
+ runwayml/types/text_to_image_create_params.py,sha256=cZ4AJ2w-8BE-qJgTdFL1TKFC0RpV5oHfSlJ9tBx2qsE,2653
38
+ runwayml/types/text_to_image_create_response.py,sha256=koMzUg82dYFQPp77wln3UR1z8WO2sHCNMWGgoQ9Id8M,262
39
+ runwayml-3.1.0.dist-info/METADATA,sha256=DbkiQjes2V0Qh8BLQrPPodOcil9reN7Ljb3mbL2IuoI,14062
40
+ runwayml-3.1.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
41
+ runwayml-3.1.0.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
42
+ runwayml-3.1.0.dist-info/RECORD,,