Skip to main content

execute_model_call

Method
This is a method of the MiddlewareManager class in the middleware module.
Execute a model call with all hooks and middleware. Order:
  1. before_model hooks (in order)
  2. wrap_model_call middleware chain
  3. actual model call
  4. after_model hooks (in reverse order)

Signature

def execute_model_call(request: ModelRequest, model_fn: Callable[[ModelRequest], ModelResponse]) -> ModelResponse

Parameters

request
ModelRequest
required
No description available.
model_fn
Callable
required
No description available.

Returns

Returns
ModelResponse
The result of the operation.