Hello, I have a project to finish very soon. So while I have properly executed all the other tasks but when it comes to the OpenAI integration, for whatever reason it is not working on VSCode. So, I checked the same code on Google Colab and it seamlessly gave me results. When I try on VSCode, I get: raise APITimeoutError(request=request) from err openai.APITimeoutError: Request timed out.
Tried everything under the sun: turning off firewall, upgrading python. packages, libraries, creating virtual environment, increasing timeout, etc. I am genuinely frustrated right now. Can someone guide me how to go about from here?
from openai import OpenAI
client = OpenAI(api_key='SECRET KEY')
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{
"role": "system",
"content": "You will be provided with a block of text, and your task is to extract a list of keywords from it."
},
{
"role": "user",
"content": "Black-on-black ware is a 20th- and 21st-century pottery tradition developed by the Puebloan Native American ceramic artists in Northern New Mexico. Traditional reduction-fired blackware has been made for centuries by pueblo artists. Black-on-black ware of the past century is produced with a smooth surface, with the designs applied through selective burnishing or the application of refractory slip. Another style involves carving or incising designs and selectively polishing the raised areas. For generations several families from Kha'po Owingeh and P'ohwhĂłge Owingeh pueblos have been making black-on-black ware with the techniques passed down from matriarch potters. Artists from other pueblos have also produced black-on-black ware. Several contemporary artists have created works honoring the pottery of their ancestors."
}
],
temperature=0.5,
max_tokens=64,
top_p=1
)
print(response)
I am just running this file and I am also getting this error: httpx.ConnectTimeout: timed out
Simply see if network is functional for you at all. VSCode as an application or Python might not have been set to make network connections through your firewall, either OS firewall or some proprietary wannabe app firewall.