Skip to content

Commit c42f9cf

Browse files
committed
Expose replicate.use()
1 parent a7b12dd commit c42f9cf

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/replicate/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ def _reset_client() -> None: # type: ignore[reportUnusedFunction]
243243

244244
from ._module_client import (
245245
run as run,
246+
use as use,
246247
files as files,
247248
models as models,
248249
account as account,

src/replicate/_module_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,21 @@ def __load__(self) -> PredictionsResource:
7777
if TYPE_CHECKING:
7878
from ._client import Replicate
7979

80-
# get the type checker to infer the run symbol to the same type
80+
# get the type checker to infer the run and use symbols to the same type
8181
# as the method on the client so we don't have to define it twice
8282
__client: Replicate = cast(Replicate, {})
8383
run = __client.run
84+
use = __client.use
8485
else:
8586

8687
def _run(*args, **kwargs):
8788
return _load_client().run(*args, **kwargs)
8889

90+
def _use(*args, **kwargs):
91+
return _load_client().use(*args, **kwargs)
92+
8993
run = _run
94+
use = _use
9095

9196
files: FilesResource = FilesResourceProxy().__as_proxied__()
9297
models: ModelsResource = ModelsResourceProxy().__as_proxied__()

0 commit comments

Comments
 (0)