Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/runwayml-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6

Expand All @@ -38,7 +38,7 @@ jobs:
run: ./scripts/lint

build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
timeout-minutes: 10
name: build
permissions:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
_dev

__pycache__
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.8.0"
".": "4.9.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 32
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-618b98a98e5da6561ad0483de2b77dd74712efbb9104b81c48d66942ce03c387.yml
openapi_spec_hash: d2d504e004bd96cea746569a487446b2
config_hash: e8ee175cde2895c3897be991e3bb3ecb
configured_endpoints: 36
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml%2Frunwayml-80f24c85d40f5f07c19ce2f7bda8e87218a30efaf6611262d490d431b1efcfbb.yml
openapi_spec_hash: 8aa96c2e29a8dece4f244069ebbcea76
config_hash: 8e05a8613b4c0e602d485566da4e5264
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 4.9.0 (2026-03-25)

Full Changelog: [v4.8.0...v4.9.0](https://github.com/runwayml/sdk-python/compare/v4.8.0...v4.9.0)

### Features

* **api:** add workflow invocation polling support ([6eb6fc5](https://github.com/runwayml/sdk-python/commit/6eb6fc507c6aae61ef3bcb5cceaee1b5049c63f3))
* **api:** add workflows and workflow invocations resources ([35d8573](https://github.com/runwayml/sdk-python/commit/35d857393bdac4aa3862dd5f0b91f23ad217fce5))


### Bug Fixes

* sanitize endpoint path params ([84efc12](https://github.com/runwayml/sdk-python/commit/84efc1283d565f857572bb99a0458bd3c4e78e2b))


### Chores

* **ci:** skip lint on metadata-only changes ([1899411](https://github.com/runwayml/sdk-python/commit/1899411b75920727e70ab42e77b3c5cb11a86fab))
* **internal:** update gitignore ([8bdac54](https://github.com/runwayml/sdk-python/commit/8bdac549eec0ce17ca630553f1ca956614d076d0))
* **tests:** bump steady to v0.19.4 ([8841072](https://github.com/runwayml/sdk-python/commit/884107238b269129227807a141ef05dc5b0ca994))
* **tests:** bump steady to v0.19.5 ([5adc696](https://github.com/runwayml/sdk-python/commit/5adc696396fe8031562bc7ff4a57dae92edf5d9c))
* **tests:** bump steady to v0.19.6 ([135a06b](https://github.com/runwayml/sdk-python/commit/135a06b19e761316826b966f9c977268b7058b28))
* **tests:** bump steady to v0.19.7 ([b7eeb81](https://github.com/runwayml/sdk-python/commit/b7eeb8168582d3b3682d6b61fa5aa5adc377c656))


### Refactors

* introduce dedicated error types for workflow invocation polling ([420f91c](https://github.com/runwayml/sdk-python/commit/420f91cda06553beba5d075aa951b2f505f68b9c))
* **tests:** switch from prism to steady ([0a1bb5a](https://github.com/runwayml/sdk-python/commit/0a1bb5ae959de737e80775a09e45c24081729bf2))

## 4.8.0 (2026-03-18)

Full Changelog: [v4.7.1...v4.8.0](https://github.com/runwayml/sdk-python/compare/v4.7.1...v4.8.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ $ pip install ./path-to-wheel-file.whl

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.

```sh
$ ./scripts/mock
Expand Down
26 changes: 26 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,29 @@ Methods:
- <code title="get /v1/voices">client.voices.<a href="./src/runwayml/resources/voices.py">list</a>(\*\*<a href="src/runwayml/types/voice_list_params.py">params</a>) -> <a href="./src/runwayml/types/voice_list_response.py">SyncCursorPage[VoiceListResponse]</a></code>
- <code title="delete /v1/voices/{id}">client.voices.<a href="./src/runwayml/resources/voices.py">delete</a>(id) -> None</code>
- <code title="post /v1/voices/preview">client.voices.<a href="./src/runwayml/resources/voices.py">preview</a>(\*\*<a href="src/runwayml/types/voice_preview_params.py">params</a>) -> <a href="./src/runwayml/types/voice_preview_response.py">VoicePreviewResponse</a></code>

# Workflows

Types:

```python
from runwayml.types import WorkflowRetrieveResponse, WorkflowListResponse, WorkflowRunResponse
```

Methods:

- <code title="get /v1/workflows/{id}">client.workflows.<a href="./src/runwayml/resources/workflows.py">retrieve</a>(id) -> <a href="./src/runwayml/types/workflow_retrieve_response.py">WorkflowRetrieveResponse</a></code>
- <code title="get /v1/workflows">client.workflows.<a href="./src/runwayml/resources/workflows.py">list</a>() -> <a href="./src/runwayml/types/workflow_list_response.py">WorkflowListResponse</a></code>
- <code title="post /v1/workflows/{id}">client.workflows.<a href="./src/runwayml/resources/workflows.py">run</a>(id, \*\*<a href="src/runwayml/types/workflow_run_params.py">params</a>) -> <a href="./src/runwayml/types/workflow_run_response.py">WorkflowRunResponse</a></code>

# WorkflowInvocations

Types:

```python
from runwayml.types import WorkflowInvocationRetrieveResponse
```

Methods:

- <code title="get /v1/workflow_invocations/{id}">client.workflow_invocations.<a href="./src/runwayml/resources/workflow_invocations.py">retrieve</a>(id) -> <a href="./src/runwayml/types/workflow_invocation_retrieve_response.py">WorkflowInvocationRetrieveResponse</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runwayml"
version = "4.8.0"
version = "4.9.0"
description = "The official Python library for the runwayml API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
26 changes: 13 additions & 13 deletions scripts/mock
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ fi

echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
# Run steady mock on the given spec
if [ "$1" == "--daemon" ]; then
# Pre-install the package so the download doesn't eat into the startup timeout
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
npm exec --package=@stdy/cli@0.19.7 -- steady --version

npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log &
npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log &

# Wait for server to come online (max 30s)
# Wait for server to come online via health endpoint (max 30s)
echo -n "Waiting for server"
attempts=0
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do
if ! kill -0 $! 2>/dev/null; then
echo
cat .stdy.log
exit 1
fi
attempts=$((attempts + 1))
if [ "$attempts" -ge 300 ]; then
echo
echo "Timed out waiting for Prism server to start"
cat .prism.log
echo "Timed out waiting for Steady server to start"
cat .stdy.log
exit 1
fi
echo -n "."
sleep 0.1
done

if grep -q "✖ fatal" ".prism.log"; then
cat .prism.log
exit 1
fi

echo
else
npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL"
npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL"
fi
16 changes: 8 additions & 8 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
function steady_is_running() {
curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1
}

kill_server_on_port() {
Expand All @@ -25,7 +25,7 @@ function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
if ! is_overriding_api_base_url && ! steady_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

Expand All @@ -36,19 +36,19 @@ fi
if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
elif ! steady_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo -e "spec to the steady command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}"
echo
fi

Expand Down
9 changes: 8 additions & 1 deletion src/runwayml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
UnprocessableEntityError,
APIResponseValidationError,
)
from .lib.polling import TaskFailedError, TaskTimeoutError
from .lib.polling import (
TaskFailedError,
TaskTimeoutError,
WorkflowInvocationFailedError,
WorkflowInvocationTimeoutError,
)
from ._base_client import DefaultHttpxClient, DefaultAioHttpClient, DefaultAsyncHttpxClient
from ._utils._logs import setup_logging as _setup_logging

Expand Down Expand Up @@ -84,6 +89,8 @@
"DefaultAioHttpClient",
"TaskFailedError",
"TaskTimeoutError",
"WorkflowInvocationFailedError",
"WorkflowInvocationTimeoutError",
]

if not _t.TYPE_CHECKING:
Expand Down
76 changes: 76 additions & 0 deletions src/runwayml/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
avatars,
uploads,
documents,
workflows,
organization,
sound_effect,
text_to_image,
Expand All @@ -48,13 +49,15 @@
voice_isolation,
speech_to_speech,
realtime_sessions,
workflow_invocations,
character_performance,
)
from .resources.tasks import TasksResource, AsyncTasksResource
from .resources.voices import VoicesResource, AsyncVoicesResource
from .resources.avatars import AvatarsResource, AsyncAvatarsResource
from .resources.uploads import UploadsResource, AsyncUploadsResource
from .resources.documents import DocumentsResource, AsyncDocumentsResource
from .resources.workflows import WorkflowsResource, AsyncWorkflowsResource
from .resources.organization import OrganizationResource, AsyncOrganizationResource
from .resources.sound_effect import SoundEffectResource, AsyncSoundEffectResource
from .resources.text_to_image import TextToImageResource, AsyncTextToImageResource
Expand All @@ -66,6 +69,7 @@
from .resources.voice_isolation import VoiceIsolationResource, AsyncVoiceIsolationResource
from .resources.speech_to_speech import SpeechToSpeechResource, AsyncSpeechToSpeechResource
from .resources.realtime_sessions import RealtimeSessionsResource, AsyncRealtimeSessionsResource
from .resources.workflow_invocations import WorkflowInvocationsResource, AsyncWorkflowInvocationsResource
from .resources.character_performance import CharacterPerformanceResource, AsyncCharacterPerformanceResource

__all__ = [
Expand Down Expand Up @@ -254,6 +258,18 @@ def voices(self) -> VoicesResource:

return VoicesResource(self)

@cached_property
def workflows(self) -> WorkflowsResource:
from .resources.workflows import WorkflowsResource

return WorkflowsResource(self)

@cached_property
def workflow_invocations(self) -> WorkflowInvocationsResource:
from .resources.workflow_invocations import WorkflowInvocationsResource

return WorkflowInvocationsResource(self)

@cached_property
def with_raw_response(self) -> RunwayMLWithRawResponse:
return RunwayMLWithRawResponse(self)
Expand Down Expand Up @@ -544,6 +560,18 @@ def voices(self) -> AsyncVoicesResource:

return AsyncVoicesResource(self)

@cached_property
def workflows(self) -> AsyncWorkflowsResource:
from .resources.workflows import AsyncWorkflowsResource

return AsyncWorkflowsResource(self)

@cached_property
def workflow_invocations(self) -> AsyncWorkflowInvocationsResource:
from .resources.workflow_invocations import AsyncWorkflowInvocationsResource

return AsyncWorkflowInvocationsResource(self)

@cached_property
def with_raw_response(self) -> AsyncRunwayMLWithRawResponse:
return AsyncRunwayMLWithRawResponse(self)
Expand Down Expand Up @@ -779,6 +807,18 @@ def voices(self) -> voices.VoicesResourceWithRawResponse:

return VoicesResourceWithRawResponse(self._client.voices)

@cached_property
def workflows(self) -> workflows.WorkflowsResourceWithRawResponse:
from .resources.workflows import WorkflowsResourceWithRawResponse

return WorkflowsResourceWithRawResponse(self._client.workflows)

@cached_property
def workflow_invocations(self) -> workflow_invocations.WorkflowInvocationsResourceWithRawResponse:
from .resources.workflow_invocations import WorkflowInvocationsResourceWithRawResponse

return WorkflowInvocationsResourceWithRawResponse(self._client.workflow_invocations)


class AsyncRunwayMLWithRawResponse:
_client: AsyncRunwayML
Expand Down Expand Up @@ -899,6 +939,18 @@ def voices(self) -> voices.AsyncVoicesResourceWithRawResponse:

return AsyncVoicesResourceWithRawResponse(self._client.voices)

@cached_property
def workflows(self) -> workflows.AsyncWorkflowsResourceWithRawResponse:
from .resources.workflows import AsyncWorkflowsResourceWithRawResponse

return AsyncWorkflowsResourceWithRawResponse(self._client.workflows)

@cached_property
def workflow_invocations(self) -> workflow_invocations.AsyncWorkflowInvocationsResourceWithRawResponse:
from .resources.workflow_invocations import AsyncWorkflowInvocationsResourceWithRawResponse

return AsyncWorkflowInvocationsResourceWithRawResponse(self._client.workflow_invocations)


class RunwayMLWithStreamedResponse:
_client: RunwayML
Expand Down Expand Up @@ -1019,6 +1071,18 @@ def voices(self) -> voices.VoicesResourceWithStreamingResponse:

return VoicesResourceWithStreamingResponse(self._client.voices)

@cached_property
def workflows(self) -> workflows.WorkflowsResourceWithStreamingResponse:
from .resources.workflows import WorkflowsResourceWithStreamingResponse

return WorkflowsResourceWithStreamingResponse(self._client.workflows)

@cached_property
def workflow_invocations(self) -> workflow_invocations.WorkflowInvocationsResourceWithStreamingResponse:
from .resources.workflow_invocations import WorkflowInvocationsResourceWithStreamingResponse

return WorkflowInvocationsResourceWithStreamingResponse(self._client.workflow_invocations)


class AsyncRunwayMLWithStreamedResponse:
_client: AsyncRunwayML
Expand Down Expand Up @@ -1139,6 +1203,18 @@ def voices(self) -> voices.AsyncVoicesResourceWithStreamingResponse:

return AsyncVoicesResourceWithStreamingResponse(self._client.voices)

@cached_property
def workflows(self) -> workflows.AsyncWorkflowsResourceWithStreamingResponse:
from .resources.workflows import AsyncWorkflowsResourceWithStreamingResponse

return AsyncWorkflowsResourceWithStreamingResponse(self._client.workflows)

@cached_property
def workflow_invocations(self) -> workflow_invocations.AsyncWorkflowInvocationsResourceWithStreamingResponse:
from .resources.workflow_invocations import AsyncWorkflowInvocationsResourceWithStreamingResponse

return AsyncWorkflowInvocationsResourceWithStreamingResponse(self._client.workflow_invocations)


Client = RunwayML

Expand Down
1 change: 1 addition & 0 deletions src/runwayml/_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ._path import path_template as path_template
from ._sync import asyncify as asyncify
from ._proxy import LazyProxy as LazyProxy
from ._utils import (
Expand Down
Loading