Skip to content

Commit 5f53bd6

Browse files
committed
docs: correct async support in use() interface - v1 also had it
1 parent 822e831 commit 5f53bd6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

UPGRADING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,13 +542,17 @@ The validation logic is identical; only import paths may differ.
542542

543543
## Experimental use() interface
544544

545-
The experimental `use()` interface is available in both versions with similar functionality. V2 adds async support.
545+
The experimental `use()` interface is available in both versions with similar functionality.
546546

547547
### Before (v1)
548548

549549
```python
550550
flux = replicate.use("black-forest-labs/flux-schnell")
551551
outputs = flux(prompt="astronaut on a horse")
552+
553+
# Async support
554+
async_flux = replicate.use("black-forest-labs/flux-schnell")
555+
outputs = await async_flux(prompt="astronaut on a horse")
552556
```
553557

554558
### After (v2)
@@ -558,7 +562,7 @@ outputs = flux(prompt="astronaut on a horse")
558562
flux = replicate.use("black-forest-labs/flux-schnell")
559563
outputs = flux(prompt="astronaut on a horse")
560564

561-
# NEW: Async support
565+
# Async support (uses use_async parameter)
562566
async_flux = replicate.use("black-forest-labs/flux-schnell", use_async=True)
563567
outputs = await async_flux(prompt="astronaut on a horse")
564568
```

0 commit comments

Comments
 (0)