I am trying to run a python script(jupyter notebook) by experimenting with GPT-3 open AI to create some NLP project and understand its functions and used cases. I got an error of SSL certification and API connection while I was trying to open a JSON file. I checked some solutions on the internet but it did not offer any remedy. I simply tried connecting to the server through API key but the code was not working. The code I executed is as follows-
import ssl
import certifi
certifi.where()
import openai
api_key='my_api_key' #it is confidential string
openai.api_key = api_key
response = openai.File.create(file=open("C:\\Users\\pythons_scripts\\Corporate Governance1658287996.json"), purpose="search")
print(response)
So the above script is throwing all of the following errors-
SSLCertVerificationError Traceback (most recent call last)
SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)
APIConnectionError Traceback (most recent call last)
APIConnectionError: Error communicating with OpenAI
Does anyone know how to get around with this ? or has anyone solved this kind of problem? can someone suggest a solution which will work?