The state senator’s campaign was accused of racism and sexism in a chatbot it created against his congressional opponent.