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
Add support for models.get and models.list endpoints (#161)
See https://replicate.com/docs/reference/http#models.get
See https://replicate.com/docs/reference/http#models.list
Currently, the `Model` class has only `username` and `name`, and the
`ModelCollection.get` method constructs a new instance with the provided
username and name arguments.
This PR makes the following changes to bring it more in line with the
[replicate-javascript](https://github.com/replicate/replicate-javascript)
and the other official clients:
- Adds `url`, `description`, `visibility`, and other fields to `Model`
- Adds `owner` field and reimplements existing `username` field to
deprecated property that aliases this field
- Updates `ModelCollection.get` to fetch information about the named
model from Replicate's API
- Adds `ModelCollection.list` to fetch public models from Replicate's
API
- Refactors `run` to avoid making an additional fetch for the model
- Updates `predictions.create` to support creating a prediction by
version ID string
---------
Signed-off-by: Mattt Zmuda <[email protected]>
0 commit comments