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
@@ -436,6 +436,137 @@ with Replicate() as replicate:
436
436
# HTTP client is now closed
437
437
```
438
438
439
+
## Experimental: Using `replicate.use()`
440
+
441
+
> [!WARNING]
442
+
> The `replicate.use()` interface is experimental and subject to change. We welcome your feedback on this new API design.
443
+
444
+
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")
555
+
556
+
# Check logs while it's running
557
+
print(run.logs())
558
+
559
+
# Get the output when ready
560
+
result = run.output()
561
+
print(result)
562
+
```
563
+
564
+
### Current limitations
565
+
566
+
- The `use()` method must be called at the module level (not inside functions or classes)
567
+
- Type hints are limited compared to the standard client interface
568
+
- This is an experimental API and may change in future releases
569
+
439
570
## Versioning
440
571
441
572
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