New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APIConnectionError in the first Jupyter notebook, lesson 4 #239
Comments
👋 Thanks for contributing @webr5214! We will review the issue and get back to you soon. |
Thanks for reporting, will take a look and let you know if we need any additional information! |
I just walked through the notebook for Lesson 4 right now. I believe that has been updated now to use the Azure OpenAI provider key/endpoint vs. OpenAI which might be a reason why the call to the OpenAI API works from command-line, but the code fails. I believe there is an OpenAI-specific set of exercises planned for the lessons. But for now, you will need to use an Azure OpenAI endpoint. If you have issues with that, can you please update this with new details? Here is what the successful run looks like: cc @koreyspace |
The reason for this error is usually that a firewall or permissions are blocking access to the api; please check: 1) the correct api access permissions; 2) that there is no firewall between the client application and the api. |
This issue has not seen any action for a while! Closing for now, but it can be reopened at a later date. |
I forked the repository to run in GitHub Codespaces. I am loading my API key from a codespaces secret into the .env file. When I run the first code cell that uses the openai module in lesson 4, I get an http error. I tested with a print statement to make sure the OpenAI client is receiving my API key.
I tested with a curl command to see if I could access the openai api from within Codespaces and received the expected result.
curl https://api.openai.com/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer API_KEY " -d '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7}'
Which makes me think it's a Jupyter environment problem.
Here's the error message:
The text was updated successfully, but these errors were encountered: