I got the error
E0517 16:14:17.611000000 26592 src/core/tsi/ssl_transport_security.cc:1653] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
when I ran the gemini suggested code:
“”"
Install the Google AI Python SDK
$ pip install google-generativeai
See the getting started guide for more information:
“”"
import os
import google.generativeai as genai
genai.configure(api_key=os.environ[“GEMINI_API_KEY”])
Create the model
See google.generativeai.GenerativeModel | Google AI for Developers | Google for Developers
generation_config = {
“temperature”: 1,
“top_p”: 0.95,
“top_k”: 64,
“max_output_tokens”: 8192,
“response_mime_type”: “text/plain”,
}
safety_settings = [
{
“category”: “HARM_CATEGORY_HARASSMENT”,
“threshold”: “BLOCK_MEDIUM_AND_ABOVE”,
},
{
“category”: “HARM_CATEGORY_HATE_SPEECH”,
“threshold”: “BLOCK_MEDIUM_AND_ABOVE”,
},
{
“category”: “HARM_CATEGORY_SEXUALLY_EXPLICIT”,
“threshold”: “BLOCK_MEDIUM_AND_ABOVE”,
},
{
“category”: “HARM_CATEGORY_DANGEROUS_CONTENT”,
“threshold”: “BLOCK_MEDIUM_AND_ABOVE”,
},
]
model = genai.GenerativeModel(
model_name=“gemini-1.5-flash-latest”,
safety_settings=safety_settings,
generation_config=generation_config,
)
chat_session = model.start_chat(
history=[
]
)
response = chat_session.send_message(“INSERT_INPUT_HERE”)
print(response.text)
print(chat_session.history)
What should I do to resolve this problem on python?