runwayml 3.2.0__tar.gz → 3.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runwayml-3.3.0/.release-please-manifest.json +3 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/CHANGELOG.md +19 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/CONTRIBUTING.md +1 -2
- {runwayml-3.2.0 → runwayml-3.3.0}/PKG-INFO +2 -3
- {runwayml-3.2.0 → runwayml-3.3.0}/README.md +1 -2
- {runwayml-3.2.0 → runwayml-3.3.0}/pyproject.toml +1 -1
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_base_client.py +6 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_models.py +2 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_types.py +2 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_version.py +1 -1
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_client.py +54 -0
- runwayml-3.2.0/.release-please-manifest.json +0 -3
- {runwayml-3.2.0 → runwayml-3.3.0}/.gitignore +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/LICENSE +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/SECURITY.md +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/api.md +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/bin/check-release-environment +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/bin/publish-pypi +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/examples/.keep +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/mypy.ini +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/noxfile.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/release-please-config.json +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/requirements-dev.lock +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/requirements.lock +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_client.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_compat.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_constants.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_exceptions.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_files.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_qs.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_resource.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_streaming.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_logs.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_proxy.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_reflection.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_resources_proxy.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_streams.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_sync.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_transform.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_typing.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/_utils/_utils.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/lib/.keep +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/py.typed +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/resources/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/resources/image_to_video.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/resources/organization.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/resources/tasks.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/resources/text_to_image.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/image_to_video_create_params.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/image_to_video_create_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/organization_retrieve_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/task_retrieve_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/text_to_image_create_params.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/src/runwayml/types/text_to_image_create_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/api_resources/__init__.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/api_resources/test_image_to_video.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/api_resources/test_organization.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/api_resources/test_tasks.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/api_resources/test_text_to_image.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/conftest.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/sample_file.txt +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_deepcopy.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_extract_files.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_files.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_models.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_qs.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_required_args.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_response.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_streaming.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_transform.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_utils/test_proxy.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/test_utils/test_typing.py +0 -0
- {runwayml-3.2.0 → runwayml-3.3.0}/tests/utils.py +0 -0
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.3.0 (2025-06-04)
|
4
|
+
|
5
|
+
Full Changelog: [v3.2.0...v3.3.0](https://github.com/runwayml/sdk-python/compare/v3.2.0...v3.3.0)
|
6
|
+
|
7
|
+
### Features
|
8
|
+
|
9
|
+
* **client:** add follow_redirects request option ([742ca3b](https://github.com/runwayml/sdk-python/commit/742ca3bbd1f38ce28ef26ddee06d4c86cd2a6ff0))
|
10
|
+
|
11
|
+
|
12
|
+
### Bug Fixes
|
13
|
+
|
14
|
+
* **docs:** fix confusing example in README ([54904f7](https://github.com/runwayml/sdk-python/commit/54904f7ed5557b5b3972fc25d52ffc873d91be7e))
|
15
|
+
|
16
|
+
|
17
|
+
### Chores
|
18
|
+
|
19
|
+
* **docs:** remove reference to rye shell ([e207562](https://github.com/runwayml/sdk-python/commit/e207562118ec1583e90639bbfc6cea00f4bed138))
|
20
|
+
* **docs:** remove unnecessary param examples ([d1ca063](https://github.com/runwayml/sdk-python/commit/d1ca06303f764543beda582da567ad182f25cf86))
|
21
|
+
|
3
22
|
## 3.2.0 (2025-05-29)
|
4
23
|
|
5
24
|
Full Changelog: [v3.1.0...v3.2.0](https://github.com/runwayml/sdk-python/compare/v3.1.0...v3.2.0)
|
@@ -17,8 +17,7 @@ $ rye sync --all-features
|
|
17
17
|
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
|
18
18
|
|
19
19
|
```sh
|
20
|
-
|
21
|
-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
|
20
|
+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
|
22
21
|
$ source .venv/bin/activate
|
23
22
|
|
24
23
|
# now you can omit the `rye run` prefix
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: runwayml
|
3
|
-
Version: 3.
|
3
|
+
Version: 3.3.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
|
@@ -127,9 +127,8 @@ text_to_image = client.text_to_image.create(
|
|
127
127
|
model="gen4_image",
|
128
128
|
prompt_text="promptText",
|
129
129
|
ratio="1920:1080",
|
130
|
-
content_moderation={"public_figure_threshold": "auto"},
|
131
130
|
)
|
132
|
-
print(text_to_image.
|
131
|
+
print(text_to_image.id)
|
133
132
|
```
|
134
133
|
|
135
134
|
## Handling errors
|
@@ -96,9 +96,8 @@ text_to_image = client.text_to_image.create(
|
|
96
96
|
model="gen4_image",
|
97
97
|
prompt_text="promptText",
|
98
98
|
ratio="1920:1080",
|
99
|
-
content_moderation={"public_figure_threshold": "auto"},
|
100
99
|
)
|
101
|
-
print(text_to_image.
|
100
|
+
print(text_to_image.id)
|
102
101
|
```
|
103
102
|
|
104
103
|
## Handling errors
|
@@ -960,6 +960,9 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
960
960
|
if self.custom_auth is not None:
|
961
961
|
kwargs["auth"] = self.custom_auth
|
962
962
|
|
963
|
+
if options.follow_redirects is not None:
|
964
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
965
|
+
|
963
966
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
964
967
|
|
965
968
|
response = None
|
@@ -1460,6 +1463,9 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
1460
1463
|
if self.custom_auth is not None:
|
1461
1464
|
kwargs["auth"] = self.custom_auth
|
1462
1465
|
|
1466
|
+
if options.follow_redirects is not None:
|
1467
|
+
kwargs["follow_redirects"] = options.follow_redirects
|
1468
|
+
|
1463
1469
|
log.debug("Sending HTTP Request: %s %s", request.method, request.url)
|
1464
1470
|
|
1465
1471
|
response = None
|
@@ -737,6 +737,7 @@ class FinalRequestOptionsInput(TypedDict, total=False):
|
|
737
737
|
idempotency_key: str
|
738
738
|
json_data: Body
|
739
739
|
extra_json: AnyMapping
|
740
|
+
follow_redirects: bool
|
740
741
|
|
741
742
|
|
742
743
|
@final
|
@@ -750,6 +751,7 @@ class FinalRequestOptions(pydantic.BaseModel):
|
|
750
751
|
files: Union[HttpxRequestFiles, None] = None
|
751
752
|
idempotency_key: Union[str, None] = None
|
752
753
|
post_parser: Union[Callable[[Any], Any], NotGiven] = NotGiven()
|
754
|
+
follow_redirects: Union[bool, None] = None
|
753
755
|
|
754
756
|
# It should be noted that we cannot use `json` here as that would override
|
755
757
|
# a BaseModel method in an incompatible fashion.
|
@@ -100,6 +100,7 @@ class RequestOptions(TypedDict, total=False):
|
|
100
100
|
params: Query
|
101
101
|
extra_json: AnyMapping
|
102
102
|
idempotency_key: str
|
103
|
+
follow_redirects: bool
|
103
104
|
|
104
105
|
|
105
106
|
# Sentinel class used until PEP 0661 is accepted
|
@@ -215,3 +216,4 @@ class _GenericAlias(Protocol):
|
|
215
216
|
|
216
217
|
class HttpxSendArgs(TypedDict, total=False):
|
217
218
|
auth: httpx.Auth
|
219
|
+
follow_redirects: bool
|
@@ -852,6 +852,33 @@ class TestRunwayML:
|
|
852
852
|
|
853
853
|
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
|
854
854
|
|
855
|
+
@pytest.mark.respx(base_url=base_url)
|
856
|
+
def test_follow_redirects(self, respx_mock: MockRouter) -> None:
|
857
|
+
# Test that the default follow_redirects=True allows following redirects
|
858
|
+
respx_mock.post("/redirect").mock(
|
859
|
+
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
|
860
|
+
)
|
861
|
+
respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
|
862
|
+
|
863
|
+
response = self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
|
864
|
+
assert response.status_code == 200
|
865
|
+
assert response.json() == {"status": "ok"}
|
866
|
+
|
867
|
+
@pytest.mark.respx(base_url=base_url)
|
868
|
+
def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
|
869
|
+
# Test that follow_redirects=False prevents following redirects
|
870
|
+
respx_mock.post("/redirect").mock(
|
871
|
+
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
|
872
|
+
)
|
873
|
+
|
874
|
+
with pytest.raises(APIStatusError) as exc_info:
|
875
|
+
self.client.post(
|
876
|
+
"/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
|
877
|
+
)
|
878
|
+
|
879
|
+
assert exc_info.value.response.status_code == 302
|
880
|
+
assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
|
881
|
+
|
855
882
|
|
856
883
|
class TestAsyncRunwayML:
|
857
884
|
client = AsyncRunwayML(base_url=base_url, api_key=api_key, _strict_response_validation=True)
|
@@ -1709,3 +1736,30 @@ class TestAsyncRunwayML:
|
|
1709
1736
|
raise AssertionError("calling get_platform using asyncify resulted in a hung process")
|
1710
1737
|
|
1711
1738
|
time.sleep(0.1)
|
1739
|
+
|
1740
|
+
@pytest.mark.respx(base_url=base_url)
|
1741
|
+
async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
|
1742
|
+
# Test that the default follow_redirects=True allows following redirects
|
1743
|
+
respx_mock.post("/redirect").mock(
|
1744
|
+
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
|
1745
|
+
)
|
1746
|
+
respx_mock.get("/redirected").mock(return_value=httpx.Response(200, json={"status": "ok"}))
|
1747
|
+
|
1748
|
+
response = await self.client.post("/redirect", body={"key": "value"}, cast_to=httpx.Response)
|
1749
|
+
assert response.status_code == 200
|
1750
|
+
assert response.json() == {"status": "ok"}
|
1751
|
+
|
1752
|
+
@pytest.mark.respx(base_url=base_url)
|
1753
|
+
async def test_follow_redirects_disabled(self, respx_mock: MockRouter) -> None:
|
1754
|
+
# Test that follow_redirects=False prevents following redirects
|
1755
|
+
respx_mock.post("/redirect").mock(
|
1756
|
+
return_value=httpx.Response(302, headers={"Location": f"{base_url}/redirected"})
|
1757
|
+
)
|
1758
|
+
|
1759
|
+
with pytest.raises(APIStatusError) as exc_info:
|
1760
|
+
await self.client.post(
|
1761
|
+
"/redirect", body={"key": "value"}, options={"follow_redirects": False}, cast_to=httpx.Response
|
1762
|
+
)
|
1763
|
+
|
1764
|
+
assert exc_info.value.response.status_code == 302
|
1765
|
+
assert exc_info.value.response.headers["Location"] == f"{base_url}/redirected"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|