Adapting to Distribution Shift by Visual Domain Prompt Generation