The Yahwist especially enjoys putting the long speeches into God's own mouth. Yahweh dialogues with Adam in the Garden of Eden about the first sin; he carries on a monologue with himself over whether he should bring on a flood in Genesis 6; he discusses with Abraham the sin and destruction of Sodom in Genesis 18; he plays with Moses' request to see the divine face in Exodus 33.
Source: wiktionary