View Source Replicate.Deployments (Replicate v1.3.0)
Documentation for Predictions
.
Link to this section Summary
Functions
Create a new prediction with the deployment. The input parameter should be a map of the model inputs.
Gets a deployment by name, in the format owner/model-name
.
Link to this section Functions
Link to this function
create_prediction(deployment, input, webhook \\ nil, webhook_completed \\ nil, webhook_event_filter \\ nil, stream \\ nil)
View SourceCreate a new prediction with the deployment. The input parameter should be a map of the model inputs.
examples
Examples
iex> {:ok, deployment} = Replicate.Deployments.get("test/model")
iex> {:ok, prediction} = Replicate.Deployments.create_prediction(deployment, %{prompt: "a 19th century portrait of a wombat gentleman"})
iex> prediction.status
"starting"
Gets a deployment by name, in the format owner/model-name
.
examples
Examples
iex> {:ok, deployment} = Replicate.Deployments.get("test/model")
iex> deployment.username
"test"
iex> Replicate.Predictions.get("not_a_real_id")
{:error, "Not found"}