creating function to create prompt objects