Open tmaeda-srm opened 3 weeks ago
@tmaeda-srm ガバナンスの章まで進めて頂きありがとうございます。 こちらでも改めて環境作成してopenai_api_call.pyを実行してみましたが、私の環境下では再現しませんでした。 お手数おかけいたしますが、以下の方法での対応をご検討頂けますでしょうか。
response = requests.post("https://" + apim_name + ".azure-api.net/api/deployments/chatgpt/chat/completions?api-version=2023-07-01-preview" , headers=headers, json=data, verify=False).
@ytatew ありがとうございます。 早速試してみたいと思います。
非常にわかりやすいAzure OpenAIの本ありがとうございます。 ご多用のところ恐れ入りますが、こちらの対処方法ご存知しょうか。
【実行】 aoai-apim/code/openai_api_call.pyを実行した際に、SSLErrorが出てしまい、先に進めなくなってしまいました。
【エラーメッセージ】 requests.exceptions.SSLError: HTTPSConnectionPool(host='○○○○.azure-api.net', port=443): Max retries exceeded with url: /api/deployments/chatgpt/chat/completions?api-version=2023-07-01-preview (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1007)')))
【ログ】 During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\○○○○\aoai-book-apim\lib\site-packages\flask\app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "C:\○○○○\aoai-book-apim\lib\site-packages\flask\app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\○○○○\aoai-book-apim\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "C:\○○○○\aoai-book-apim\lib\site-packages\flask\app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "C:\○○○○\book-azureopenai-sample\aoai-apim\code\openai_api_call.py", line 54, in me response = requests.post("https://" + apim_name + ".azure-api.net/api/deployments/chatgpt/chat/completions?api-version=2023-07-01-preview" File "C:\○○○○\aoai-book-apim\lib\site-packages\requests\api.py", line 115, in post return request("post", url, data=data, json=json, kwargs) File "C:\○○○○\aoai-book-apim\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "C:\○○○○\aoai-book-apim\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "C:\○○○○\aoai-book-apim\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "C:\○○○○\aoai-book-apim\lib\site-packages\requests\adapters.py", line 517, in send raise SSLError(e, request=request)