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
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,6 @@ client.with_options(http_client=DefaultHttpxClient(...))

By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.

```py
from runwayml import RunwayML

with RunwayML() as client:
# make requests here
...

# HTTP client is now closed
```

## Versioning

This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
Expand Down
36 changes: 18 additions & 18 deletions src/runwayml/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import httpx

from . import _exceptions
from . import resources, _exceptions
from ._qs import Querystring
from ._types import (
NOT_GIVEN,
Expand All @@ -24,7 +24,6 @@
get_async_library,
)
from ._version import __version__
from .resources import tasks, image_to_video
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
from ._exceptions import RunwayMLError, APIStatusError
from ._base_client import (
Expand All @@ -38,6 +37,7 @@
"Transport",
"ProxiesTypes",
"RequestOptions",
"resources",
"RunwayML",
"AsyncRunwayML",
"Client",
Expand All @@ -46,8 +46,8 @@


class RunwayML(SyncAPIClient):
tasks: tasks.TasksResource
image_to_video: image_to_video.ImageToVideoResource
tasks: resources.TasksResource
image_to_video: resources.ImageToVideoResource
with_raw_response: RunwayMLWithRawResponse
with_streaming_response: RunwayMLWithStreamedResponse

Expand Down Expand Up @@ -111,8 +111,8 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.tasks = tasks.TasksResource(self)
self.image_to_video = image_to_video.ImageToVideoResource(self)
self.tasks = resources.TasksResource(self)
self.image_to_video = resources.ImageToVideoResource(self)
self.with_raw_response = RunwayMLWithRawResponse(self)
self.with_streaming_response = RunwayMLWithStreamedResponse(self)

Expand Down Expand Up @@ -225,8 +225,8 @@ def _make_status_error(


class AsyncRunwayML(AsyncAPIClient):
tasks: tasks.AsyncTasksResource
image_to_video: image_to_video.AsyncImageToVideoResource
tasks: resources.AsyncTasksResource
image_to_video: resources.AsyncImageToVideoResource
with_raw_response: AsyncRunwayMLWithRawResponse
with_streaming_response: AsyncRunwayMLWithStreamedResponse

Expand Down Expand Up @@ -290,8 +290,8 @@ def __init__(
_strict_response_validation=_strict_response_validation,
)

self.tasks = tasks.AsyncTasksResource(self)
self.image_to_video = image_to_video.AsyncImageToVideoResource(self)
self.tasks = resources.AsyncTasksResource(self)
self.image_to_video = resources.AsyncImageToVideoResource(self)
self.with_raw_response = AsyncRunwayMLWithRawResponse(self)
self.with_streaming_response = AsyncRunwayMLWithStreamedResponse(self)

Expand Down Expand Up @@ -405,26 +405,26 @@ def _make_status_error(

class RunwayMLWithRawResponse:
def __init__(self, client: RunwayML) -> None:
self.tasks = tasks.TasksResourceWithRawResponse(client.tasks)
self.image_to_video = image_to_video.ImageToVideoResourceWithRawResponse(client.image_to_video)
self.tasks = resources.TasksResourceWithRawResponse(client.tasks)
self.image_to_video = resources.ImageToVideoResourceWithRawResponse(client.image_to_video)


class AsyncRunwayMLWithRawResponse:
def __init__(self, client: AsyncRunwayML) -> None:
self.tasks = tasks.AsyncTasksResourceWithRawResponse(client.tasks)
self.image_to_video = image_to_video.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)
self.tasks = resources.AsyncTasksResourceWithRawResponse(client.tasks)
self.image_to_video = resources.AsyncImageToVideoResourceWithRawResponse(client.image_to_video)


class RunwayMLWithStreamedResponse:
def __init__(self, client: RunwayML) -> None:
self.tasks = tasks.TasksResourceWithStreamingResponse(client.tasks)
self.image_to_video = image_to_video.ImageToVideoResourceWithStreamingResponse(client.image_to_video)
self.tasks = resources.TasksResourceWithStreamingResponse(client.tasks)
self.image_to_video = resources.ImageToVideoResourceWithStreamingResponse(client.image_to_video)


class AsyncRunwayMLWithStreamedResponse:
def __init__(self, client: AsyncRunwayML) -> None:
self.tasks = tasks.AsyncTasksResourceWithStreamingResponse(client.tasks)
self.image_to_video = image_to_video.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)
self.tasks = resources.AsyncTasksResourceWithStreamingResponse(client.tasks)
self.image_to_video = resources.AsyncImageToVideoResourceWithStreamingResponse(client.image_to_video)


Client = RunwayML
Expand Down