前一段时间不用代理,国内网就能连上,但最近两天又不行辽,跟我的IP有关吗?我用的是云南移动。
代码如下:
import os
from openai import OpenAIos.environ[‘OPENAI_API_KEY’] = ‘xxx’
os.environ[‘OPENAI_BASE_URL’] = ‘https://api.oaipro.com/v1’
client = OpenAI()stream = client.chat.completions.create(
model=“gpt-3.5-turbo”,
messages=[{“role”: “user”, “content”: “Say this is a test”}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end=“”)
报错信息:openai.PermissionDeniedError: Just a moment…(省略)