Packages

The official Elixir client for Replicate. It lets you run models from your Elixir code, and everything else you can do with Replicate's HTTP API.

Current section

Files

Jump to
replicate lib predictions behaviour.ex
Raw

lib/predictions/behaviour.ex

defmodule Replicate.Predictions.Behaviour do
@moduledoc """
Documentation for the Predictions Behaviour
"""
alias Replicate.Predictions.Prediction
@callback get(id :: String.t()) ::
{:ok, Prediction.t()} | {:error, String.t()}
@callback get!(id :: String.t()) :: Prediction.t()
@callback cancel(id :: String.t()) ::
{:ok, Prediction.t()} | {:error, String.t()}
@callback create(
model_version :: String.t(),
input :: %{string: any},
webhook :: list(String.t()),
webhook_completed :: list(String.t()),
webook_event_filter :: list(String.t())
) :: {:ok, Prediction.t()} | {:error, String.t()}
end