å°ãã¿ã§ãã
Gemini-ProãGemini-flashã使ã£ã¦ããã¨ãã«ãå®å ¨æ§ã«é¢ããã¡ãã»ã¼ã¸ã¨ã¨ãã«ã¨ã©ã¼ã«ãªããã¨ãããã¾ãã
ãã®ã¨ãã®å¯¾å¦æ¹æ³ã«ã¤ãã¦èª¿ã¹ã¦ã¿ãã®ã§ãã®ã¡ã¢ã§ãã
ã¨ã©ã¼å 容
大ä½ãã®è¾ºã®ã¡ãã»ã¼ã¸ã¨å ±ã«ã¨ã©ã¼ã«ãªã£ããå®å ¨æ§ã®ã¨ã©ã¼ãçã£ãã»ããè¯ãã§ãã
- HARM_CATEGORY_SEXUALLY_EXPLICIT
- HARM_CATEGORY_HATE_SPEECH
- HARM_CATEGORY_HARASSMENT
- HARM_CATEGORY_DANGEROUS_CONTENT
APIã ã£ããGoogle AI Studioã ã£ãããè²ã ããã¾ãã®ã§ããã®è¾ºã®ã¡ãã»ã¼ã¸ãåºããæªãããããã«è¦ãã¦ããã¾ãã
対å¿
åºæ¬çã«ã¯å ¥åºåããããã¹ã次第ãªã®ã§æ¥µåä¸é©åãªå 容ãåé¿ããã®ãä¸çªæ¥½ã§ã¯ããã¾ãã ãã ããè¨å®ã§ã©ãã«ããªããã¨ãããã¾ãã
SafetySetting
åºåãæ¢ãã¦ããã®ã¯SafetySettingã£ã¦ãã¤ã§ãã ãããæ¢å®å¤ä»¥ä¸ã«ãªãã¨Geminiããåºåã帰ã£ã¦ããªãã¦ã¨ã©ã¼ã«ãªãã¾ãã
ãã®ãããå¤ãè¨å®ãã¦ããããã¨ã§åºåãªããªããã¨ãåé¿ã§ããããã¾ãã
# Safety config
safety_config = {
generative_models.HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: generative_models.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
generative_models.HarmCategory.HARM_CATEGORY_HARASSMENT: generative_models.HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
}
ãããªæãã«ããããã«ã¤ãã¦ãããå¤ãè¨å®ãã¦ãããã¨ãã¨ã©ã¼ã®ã§ããããã³ã³ããã¼ã«ãããã¨ãã§ãã¾ãã
ãã ããBLOCK_NONE
ï¼ç¢ºçã«ããã常ã«è¡¨ç¤ºï¼ã®ãã©ã¡ã¼ã¿ã¯ä½¿ç¨ããã®ã«æ¡ä»¶ããããããªã®ã§ããã¥ã¡ã³ãããåç
§ãã ããã
ææ³
以ä¸ãã¡ãã£ã¨ã¨ã©ã¼ã§å¼ã£ããã£ãã®ã§åå¿é²ã§ããã