OpenAI’s ChatGPT platform violated California law in advising a man on treatment for his mental health struggles, according to a lawsuit.