You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+131Lines changed: 131 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -434,6 +434,137 @@ with Replicate() as replicate:
434
434
# HTTP client is now closed
435
435
```
436
436
437
+
## Experimental: Using `replicate.use()`
438
+
439
+
> [!WARNING]
440
+
> The `replicate.use()` interface is experimental and subject to change. We welcome your feedback on this new API design.
441
+
442
+
The `use()` method provides a more concise way to call Replicate models as functions. This experimental interface offers a more pythonic approach to running models:
run = llama.create(prompt="Explain quantum computing")
553
+
554
+
# Check logs while it's running
555
+
print(run.logs())
556
+
557
+
# Get the output when ready
558
+
result = run.output()
559
+
print(result)
560
+
```
561
+
562
+
### Current limitations
563
+
564
+
- The `use()` method must be called at the module level (not inside functions or classes)
565
+
- Type hints are limited compared to the standard client interface
566
+
- This is an experimental API and may change in future releases
567
+
437
568
## Versioning
438
569
439
570
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:
0 commit comments