HarmCategory is an attribute from google.generrativeai, but im getting backend error

Hey everyone. Im wishing good luck to everyone and I also have a question about HarmCategory. HarmCategory is an attribute of generativeai. But im getting errors on my backend file (Flask)
Error: genai.HarmCategory.HARM_CATEGORY_HATE_SPEECH: genai.HarmBlockThreshold.BLOCK_MEDIUM_AND_ABOVE,

AttributeError: module ‘google.generativeai’ has no attribute ‘HarmCategory’

You are probably missing .types in the name

Hope that helps

thanks for that. I tried implementing settings using your advice with adding the ‘type’ attribute, but no luck. Here is screenshot of the different ways I have tried. I think its a key/dictionary error: KeyError: <HarmCategory.HARM_CATEGORY_HATE_SPEECH: 1>

nevermind! i fixed it