How to Unlock Gemini 1.5 Pro

Unblock All Safety Settings

#tutorial



On Web GUI:

aistudio.google.com
Safety Settings (click the gear icon)

On API (Python):

from google.generativeai.types import HarmCategory, HarmBlockThreshold


model = genai.GenerativeModel(model_name='gemini-1.5-flash')
safety_settings = {
    HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,
    HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,	
    HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,
    HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,	
}
response = model.generate_content(
    ['Do these look store-bought or homemade?'],
    safety_settings=safety_settings
)
chat = model.start_chat(history=[])
response = chat.send_message('Do these look store-bought or homemade?', safety_settings=safety_settings)