Request Processing
- Application creates an
Inferenceobject - Application calls
create()with parameters Inferencecreates anInferenceRequest.Inferencecreates aPendingInferenceobject with the instances of request, driver and event dispatcher.Inferencereturns aPendingInferenceobject to the application.
Response Processing
- Application accesses the
PendingInferenceobject content, e.g. viaresponse()method. PendingInferencechecks if HTTP request has been already executed.- If already sent, it returns the cached response.
PendingInferencedispatches theInferenceStartedevent.PendingInferencedispatches theInferenceAttemptStartedevent.- Driver dispatches the
InferenceRequestedevent and sends the HTTP request. - Driver parses provider response into
InferenceResponse. - Driver dispatches the
InferenceResponseCreatedevent. PendingInferencedispatchesInferenceAttemptSucceeded,InferenceUsageReported, andInferenceCompleted.- Result
InferenceResponseobject is returned to the application.