subscribe

abstract suspend fun <Output : Any> subscribe(endpointId: String, input: Any, resultType: KClass<Output>, options: SubscribeOptions = SubscribeOptions(), onQueueUpdate: OnStatusUpdate? = null): RequestOutput<Output>

Submits a request to the given endpointId. This method uses the queue API to submit the request and poll for the result.

This is useful for long running requests, and it's the preffered way to interact with the model APIs.

Parameters

endpointId

The ID of the endpoint to send the request to.

input

The input data to send to the endpoint.

resultType

The expected result type of the request.

options

The options to use for the request.

onQueueUpdate

A callback to receive status updates from the queue subscription.