import os
import openai
#
# openai.api_key = "sk-t你自己的API key"
# response = openai.Completion.create(
# model="text-davinci-003",
# #prompt="Translate this into 1. French, 2. Spanish and 3. Japanese:\n\nWhat rooms do you have available?\n\n1.",
# prompt="Translate this into English:\n\n操你妈呀!\n\n1.",
# temperature=0.3,
# max_tokens=100,
# top_p=1.0,
# frequency_penalty=0.0,
# presence_penalty=0.0
# )
# print(response)
# # openai.api_key = os.getenv("sk-t你自己的API key"") # 这个会报错
# openai.api_key = "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" # 这个不报错
# response = openai.Completion.create(
# model="text-davinci-003",
# prompt="I am a highly intelligent question answering bot. If you ask me a question that is rooted in truth, I will give you the answer. If you ask me a question that is nonsense, trickery, or has no clear answer, I will respond with \"Unknown\".\n\nQ: What is human life expectancy in the United States?\nA
GPT-3 API接口调用
最新推荐文章于 2025-07-05 18:56:11 发布