def METHOD_NAME(model_cls: type[BaseModel]):
    current_encoders = getattr(model_cls.Config, "json_encoders", {})
    encoder = partial(
        custom_pydantic_encoder,
        {
            SecretStr: lambda v: v.get_secret_value(),
            **current_encoders,
        },
    )
    return encoder