Skip to content
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

翻译pdf代码显示The server could not be reached [Errno 0] Error,是我的api错了或者模型选错了吗 #87

Open
yujianwei1 opened this issue Mar 23, 2024 · 3 comments

Comments

@yujianwei1
Copy link

No description provided.

@sandbury
Copy link

我在笔记本上也出现你的情况,但换台主机后,就可以了,所以和代码无关,可能是网络等问题

@sandbury
Copy link

from openai import OpenAI
client = OpenAI()

completion = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."},
{"role": "user", "content": "Compose a poem that explains the concept of recursion in programming."}
]
)

print(completion.choices[0].message)你可以先试一下这个,我笔记本这个他显示openai连接错误,只要这个代码你能运行,翻译的代码大概率也是可以直接运行不会报错的

@yujianwei1
Copy link
Author

原来是我的python解释器版本太低了,要使用openai最低得3.7.1才行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants