runwayml 3.6.3__py3-none-any.whl → 3.6.5__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
@@ -529,6 +529,15 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
529
529
  # work around https://github.com/encode/httpx/discussions/2880
530
530
  kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
531
531
 
532
+ is_body_allowed = options.method.lower() != "get"
533
+
534
+ if is_body_allowed:
535
+ kwargs["json"] = json_data if is_given(json_data) else None
536
+ kwargs["files"] = files
537
+ else:
538
+ headers.pop("Content-Type", None)
539
+ kwargs.pop("data", None)
540
+
532
541
  # TODO: report this error to httpx
533
542
  return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
534
543
  headers=headers,
@@ -540,8 +549,6 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
540
549
  # so that passing a `TypedDict` doesn't cause an error.
541
550
  # https://github.com/microsoft/pyright/issues/3526#event-6715453066
542
551
  params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
543
- json=json_data if is_given(json_data) else None,
544
- files=files,
545
552
  **kwargs,
546
553
  )
547
554
 
runwayml/_models.py CHANGED
@@ -2,9 +2,10 @@ from __future__ import annotations
2
2
 
3
3
  import os
4
4
  import inspect
5
- from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, cast
5
+ from typing import TYPE_CHECKING, Any, Type, Union, Generic, TypeVar, Callable, Optional, cast
6
6
  from datetime import date, datetime
7
7
  from typing_extensions import (
8
+ List,
8
9
  Unpack,
9
10
  Literal,
10
11
  ClassVar,
@@ -366,7 +367,7 @@ def _construct_field(value: object, field: FieldInfo, key: str) -> object:
366
367
  if type_ is None:
367
368
  raise RuntimeError(f"Unexpected field type is None for {key}")
368
369
 
369
- return construct_type(value=value, type_=type_)
370
+ return construct_type(value=value, type_=type_, metadata=getattr(field, "metadata", None))
370
371
 
371
372
 
372
373
  def is_basemodel(type_: type) -> bool:
@@ -420,7 +421,7 @@ def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
420
421
  return cast(_T, construct_type(value=value, type_=type_))
421
422
 
422
423
 
423
- def construct_type(*, value: object, type_: object) -> object:
424
+ def construct_type(*, value: object, type_: object, metadata: Optional[List[Any]] = None) -> object:
424
425
  """Loose coercion to the expected type with construction of nested values.
425
426
 
426
427
  If the given value does not match the expected type then it is returned as-is.
@@ -438,8 +439,10 @@ def construct_type(*, value: object, type_: object) -> object:
438
439
  type_ = type_.__value__ # type: ignore[unreachable]
439
440
 
440
441
  # unwrap `Annotated[T, ...]` -> `T`
441
- if is_annotated_type(type_):
442
- meta: tuple[Any, ...] = get_args(type_)[1:]
442
+ if metadata is not None:
443
+ meta: tuple[Any, ...] = tuple(metadata)
444
+ elif is_annotated_type(type_):
445
+ meta = get_args(type_)[1:]
443
446
  type_ = extract_type_arg(type_, 0)
444
447
  else:
445
448
  meta = tuple()
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.3" # x-release-please-version
4
+ __version__ = "3.6.5" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: runwayml
3
- Version: 3.6.3
3
+ Version: 3.6.5
4
4
  Summary: The official Python library for the runwayml API
5
5
  Project-URL: Homepage, https://github.com/runwayml/sdk-python
6
6
  Project-URL: Repository, https://github.com/runwayml/sdk-python
@@ -30,12 +30,13 @@ Requires-Dist: sniffio
30
30
  Requires-Dist: typing-extensions<5,>=4.10
31
31
  Provides-Extra: aiohttp
32
32
  Requires-Dist: aiohttp; extra == 'aiohttp'
33
- Requires-Dist: httpx-aiohttp>=0.1.6; extra == 'aiohttp'
33
+ Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
34
34
  Description-Content-Type: text/markdown
35
35
 
36
36
  # RunwayML Python API library
37
37
 
38
- [![PyPI version](https://github.com/runwayml/sdk-python/tree/main/<https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable)>)](https://pypi.org/project/runwayml/)
38
+ <!-- prettier-ignore -->
39
+ [![PyPI version](https://img.shields.io/pypi/v/runwayml.svg?label=pypi%20(stable))](https://pypi.org/project/runwayml/)
39
40
 
40
41
  The RunwayML Python library provides convenient access to the RunwayML REST API from any Python 3.8+
41
42
  application. The library includes type definitions for all request params and response fields,
@@ -1,17 +1,17 @@
1
1
  runwayml/__init__.py,sha256=tr-n2Y4sH_wBv8t2F_jk7ku_rLT2erU3j61ONZJWUVs,2743
2
- runwayml/_base_client.py,sha256=FH5ueSL8_ijbhXlcd6FG98sy_IMnFsAhVkBkCcv4ZjI,66717
2
+ runwayml/_base_client.py,sha256=jo8QwM4u7dRcesI8UlJ2l70HL-DYALQtgRt-dqqZUdQ,66924
3
3
  runwayml/_client.py,sha256=tEooz-jH6JGowMQwrTZE7CKcyqpILEHKfSFf7OevoIU,18513
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=G1vczEodX0vUySeVKbF-mbzlaObNL1oVAYH4c65agRk,29131
8
+ runwayml/_models.py,sha256=viD5E6aDMhxslcFHDYvkHaKzE8YLcNmsPsMe8STixvs,29294
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=YS51-PHkr87QNuUiRkd7wHSeOAOjTjLI0KDrIkaxAtw,160
14
+ runwayml/_version.py,sha256=V8UIQsr_Ixs68ovfL9z1Umky7_XVGNycdVSDh7FwOOA,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
@@ -40,7 +40,7 @@ runwayml/types/text_to_image_create_params.py,sha256=I8Dr4UG6VnciQ87zN6qp03FKwlQ
40
40
  runwayml/types/text_to_image_create_response.py,sha256=koMzUg82dYFQPp77wln3UR1z8WO2sHCNMWGgoQ9Id8M,262
41
41
  runwayml/types/video_upscale_create_params.py,sha256=Ta3BNQy9aeTUBU5Ui-CMJtF32HeNRqbNpqjAAOKXyks,743
42
42
  runwayml/types/video_upscale_create_response.py,sha256=zf-79HbJa68dUHltBiZjVtnW_U6HUI-htmkTm5URBSU,264
43
- runwayml-3.6.3.dist-info/METADATA,sha256=3o8mrd0Rn8tzTvAyWNDQZaBeXdxq0o6QMaZKHKNhZsg,15260
44
- runwayml-3.6.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
45
- runwayml-3.6.3.dist-info/licenses/LICENSE,sha256=baeFj6izBWIm6A5_7N3-WAsy_VYpDF05Dd4zS1zsfZI,11338
46
- runwayml-3.6.3.dist-info/RECORD,,
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,,