/// Create a prediction using a deployment
///
/// - Parameters:
/// - owner:
/// The name of the deployment owner.
/// - name:
/// The name of the deployment.
/// - input:
/// The input depends on what model you are running.
///
/// To see the available inputs,
/// click the "Run with API" tab on the model you are running.
/// For example, stability-ai/stable-diffusion
/// takes prompt as an input.
/// - webhook:
/// A webhook that is called when the prediction has completed.
///
/// It will be a POST request where
/// the request body is the same as
/// the response body of the get prediction endpoint.
/// If there are network problems,
/// we will retry the webhook a few times,
/// so make sure it can be safely called more than once.
/// - stream:
/// Whether to stream the prediction output.
/// By default, this is false.
public func createPrediction<Input: Codable, Output: Codable>(
_ type: Prediction<Input, Output>.Type = AnyPrediction.self,
deployment id: Deployment.ID,
input: Input,
webhook: Webhook? = nil,
stream: Bool = false
)
/// Create a prediction using a deployment /// /// - Parameters: /// - owner: /// The name of the deployment owner. /// - name: /// The name of the deployment. /// - input: /// The input depends on what model you are running. /// /// To see the available inputs, /// click the "Run with API" tab on the model you are running. /// For example, stability-ai/stable-diffusion /// takes
prompt
as an input. /// - webhook: /// A webhook that is called when the prediction has completed. /// /// It will be aPOST
request where /// the request body is the same as /// the response body of the get prediction endpoint. /// If there are network problems, /// we will retry the webhook a few times, /// so make sure it can be safely called more than once. /// - stream: /// Whether to stream the prediction output. /// By default, this isfalse
. public func createPrediction<Input: Codable, Output: Codable>( _ type: Prediction<Input, Output>.Type = AnyPrediction.self, deployment id: Deployment.ID, input: Input, webhook: Webhook? = nil, stream: Bool = false )