# Decorators

Decorator functions for creating middleware from simple functions.

## before_run

::: pydantic_ai_middleware.before_run

## after_run

::: pydantic_ai_middleware.after_run

## before_model_request

::: pydantic_ai_middleware.before_model_request

## before_tool_call

::: pydantic_ai_middleware.before_tool_call

## after_tool_call

::: pydantic_ai_middleware.after_tool_call

## on_error

::: pydantic_ai_middleware.on_error
