在 openai.py 中,Completion.create 突出显示为警报,但也不起作用。错误就在下面。代码有什么问题
response = openai.Completion.create(
engine="text-davinci-002",
prompt="Generate blog topic on: Ethical hacking",
temperature=0.7,
max_tokens=256,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)
$ python openai.py
Traceback (most recent call last):
File "E:\python\openAI\openai.py", line 2, in <module>
import openai
File "E:\python\openAI\openai.py", line 9, in <module>
response = openai.Completion.create(
AttributeError: partially initialized module 'openai' has no attribute 'Completion' (most likely due to a circular import)
Run Code Online (Sandbox Code Playgroud)