Gonorrhea is caused by bacteria while herpes is a virus. Valtrex is in anti-viral medication so this implies he has herpes. Normally prescription choice is through combination of clinical assessment and culture but in this case, I would have though he would have needed further tests.
You need to see your doctor as soon as possible for a full assessment, including blood test to see if you have also been exposed. In the meantime I would recommend that you abstain from intercourse of any description until you get some definite information about infection.