Model response with an optional 'Command' from 'wrap_model_call' middleware.
Use this to return a 'Command' alongside the model response from a 'wrap_model_call' handler. The command is applied as an additional state update after the model node completes, using the graph's reducers (e.g. 'add_messages' for the 'messages' key).
Because each 'Command' is applied through the reducer, messages in the command are added alongside the model response messages rather than replacing them. For non-reducer state fields, later commands overwrite earlier ones (outermost middleware wins over inner).
ExtendedModelResponse(
self,
model_response: ModelResponse[ResponseT],
command: Command[Any] | None = None
)| Name | Type |
|---|---|
| model_response | ModelResponse[ResponseT] |
| command | Command[Any] | None |