separated prompt_addhistory, prompt returns result